Skip to content
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

Adding extra pod labels to post-upgrade and post-delete hook job pods #46029

Merged
merged 11 commits into from
Sep 4, 2024
Merged
9 changes: 9 additions & 0 deletions examples/chart/teleport-kube-agent/templates/delete_hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ spec:
template:
metadata:
name: {{ .Release.Name }}-delete-hook
{{- if .Values.annotations.pod }}
annotations:
{{- toYaml .Values.annotations.pod | nindent 8 }}
{{- end }}
labels:
app: {{ .Release.Name }}
{{- if .Values.extraLabels.pod }}
{{- toYaml .Values.extraLabels.pod | nindent 8 }}
{{- end }}
spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
97 changes: 0 additions & 97 deletions examples/chart/teleport-kube-agent/templates/hook.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this hook because it was only important for v10--> v11 migration.
Since we are in v16 and v11 is not supported since v14, it should be fine to delete the whole hook

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After debugging a situation with a customer, I realized this is still useful. can you please re-add it and add support for the annotations and labels?

sorry about the confusion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ should not create ServiceAccount for post-delete hook if serviceAccount.create i
spec:
template:
metadata:
labels:
app: RELEASE-NAME
name: RELEASE-NAME-delete-hook
spec:
containers:
Expand Down
2 changes: 1 addition & 1 deletion examples/chart/teleport-kube-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ extraLabels:
# extraLabels.job(object) -- are labels to set on the post-delete Job created by the chart.
job: {}
# extraLabels.pod(object) -- are labels to set on the Pods created by the
# Deployment or StatefulSet.
# Deployment, StatefulSet, or Job.
pod: {}
# extraLabels.podDisruptionBudget(object) -- are labels to set on the podDisruptionBudget.
podDisruptionBudget: {}
Expand Down
Loading