-
Notifications
You must be signed in to change notification settings - Fork 265
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
Fix Helm chart service labels #615
Conversation
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
/assign @bwagner5 |
@@ -25,5 +25,5 @@ spec: | |||
{{- end }} | |||
selector: | |||
matchLabels: | |||
{{- include "aws-node-termination-handler.labels" . | nindent 6 }} | |||
{{- include "aws-node-termination-handler.selectorLabelsDeployment" . | nindent 6 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is defined here, for reference:
aws-node-termination-handler/config/helm/aws-node-termination-handler/templates/_helpers.tpl
Lines 71 to 74 in 1c61c2d
{{- define "aws-node-termination-handler.selectorLabelsDeployment" -}} | |
{{ include "aws-node-termination-handler.selectorLabels" . }} | |
app.kubernetes.io/component: deployment | |
{{- end -}} |
The important point is that it defines component
to be deployment
.
@@ -48,7 +48,6 @@ Common labels | |||
{{- if .Chart.AppVersion }} | |||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | |||
{{- end }} | |||
app.kubernetes.io/component: {{ .Release.Name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify that my understanding of this change: the bug previously was that component
was set to aws-node-termination-handler
, which is not correct. The value should have been daemonset
or deployment
(depending on the way NTH runs in the cluster). Your solution is to remove this from the generic labels
and instead assign it in the supersets of labels
called labelsDeployment
and labelsDaemonset
, and then to use the unrelated selectorLabelsDeployment
for the service monitor template, which separately sets component
to deployment
.
Do I understand correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that is correct. When I refactored the chart I accidentally left the component in the main labels function and forgot to add the component labels functions. Without these functions the component was incorrectly set in the resource labels but the only bug would be the ServiceMonitor as that's the only selector working on these labels.
Description of changes:
This PR undoes the change made in #604 and fixes the actual issue I introduced in the chart refactor work.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.