-
Notifications
You must be signed in to change notification settings - Fork 1.6k
✨ Allow helm plugin to use custom prefixes #5119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
4df61fe
5b12a7c
6dd6a78
dcb24ca
4d79f65
44e16fe
d2a79c6
182aa72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,12 @@ var _ machinery.Template = &ServiceMonitor{} | |
// ServiceMonitor scaffolds a ServiceMonitor for Prometheus monitoring in the Helm chart | ||
type ServiceMonitor struct { | ||
machinery.TemplateMixin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The best solution would be to have the ServiceMonitor from the kustomize install.yaml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When prometheus is enabled in kustomize, it'll use the ServiceMonitor from the kustomize install.yaml - this code path is only called when prometheus is disabled in kustomize. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that is the reason for we template this one.
Those values in the install.yaml and use here instead of use PROJECT name. Example:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok, I think I understand - so take the actual values of the service name from the install.yaml rather than assuming it's the project name or prefix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the clarification - I'll get something up ASAP for you to take a look at 🙇 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I meant that it's an option that we can consider, rather than an actual option that the user provides! It's not a new flag, and is the only way the data will be passed in to this template! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will be a new flag for the plugin: fs.StringVar(&p.kustomizePath, "kustomize-path", DefaultKustomizeFile, So, the best approach is we get the values from the install.yaml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see - you mean the kustomize path. I'll get something working and run it by you, I have an idea here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Get data from kustomize output rather than kustomization.yaml changes the way we get the prefix to instead get it from the deployment name. Is this closer to what you were hoping for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should ONLY:
This should make the scaffold populate the correct values automatically, without requiring extra information or flags. Only look for a specific path if one is explicitly provided and do not bring extra burn to keep things maintained. |
||
machinery.ProjectNameMixin | ||
|
||
// Prefix | ||
NamePrefix string | ||
|
||
// ServiceName is the full name of the metrics service, derived from Kustomize | ||
ServiceName string | ||
|
||
// OutputDir specifies the output directory for the chart | ||
OutputDir string | ||
|
@@ -59,7 +64,7 @@ metadata: | |
labels: | ||
{{ "{{- include \"chart.labels\" . | nindent 4 }}" }} | ||
control-plane: controller-manager | ||
name: {{ .ProjectName }}-controller-manager-metrics-monitor | ||
name: {{ .NamePrefix }}-controller-manager-metrics-monitor | ||
namespace: {{ "{{ .Release.Namespace }}" }} | ||
spec: | ||
endpoints: | ||
|
@@ -69,7 +74,7 @@ spec: | |
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
tlsConfig: | ||
{{ "{{- if .Values.certManager.enable }}" }} | ||
serverName: {{ .ProjectName }}-controller-manager-metrics-service.{{ "{{ .Release.Namespace }}" }}.svc | ||
serverName: {{ .ServiceName }}.{{ "{{ .Release.Namespace }}" }}.svc | ||
# Apply secure TLS configuration with cert-manager | ||
insecureSkipVerify: false | ||
ca: | ||
|
Uh oh!
There was an error while loading. Please reload this page.