-
Notifications
You must be signed in to change notification settings - Fork 87
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
conditionally add annotations key #179
Conversation
@@ -19,8 +19,10 @@ spec: | |||
{{- with .Values.certManager.additionalPodLabels }} | |||
{{- toYaml . | nindent 8 }} | |||
{{- end }} | |||
{{- if .Values.certManager.podAnnotations }} |
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.
is it currently broken?
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.
It's not currently broken. However, GitOps tools will detect differences when K8s adds annotations like restartAt.... In contrast, I do not see any value in rendering empty as default.
What do you think?
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.
Maybe this diff helps to clarify my previous comments.
When AroCD syncs the application, it will detect changes because of explicit empty annotations in helm render.
# Source: cert-exporter/charts/cert-exporter/templates/cert-m # Source: cert-exporter/charts/cert-exporter/templates/cert-m
apiVersion: apps/v1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: "cert-exporter-cert-manager" name: "cert-exporter-cert-manager"
labels: labels:
helm.sh/chart: cert-exporter-3.9.0 | helm.sh/chart: cert-exporter-3.10.0
app.kubernetes.io/name: cert-exporter app.kubernetes.io/name: cert-exporter
app.kubernetes.io/instance: cert-exporter app.kubernetes.io/instance: cert-exporter
cert-exporter.io/type: daemon-set cert-exporter.io/type: daemon-set
app.kubernetes.io/version: "v2.14.0" app.kubernetes.io/version: "v2.14.0"
app.kubernetes.io/managed-by: Helm app.kubernetes.io/managed-by: Helm
spec: spec:
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: cert-exporter app.kubernetes.io/name: cert-exporter
app.kubernetes.io/instance: cert-exporter app.kubernetes.io/instance: cert-exporter
cert-exporter.io/type: daemon-set cert-exporter.io/type: daemon-set
template: template:
metadata: metadata:
labels: labels:
app.kubernetes.io/name: cert-exporter app.kubernetes.io/name: cert-exporter
app.kubernetes.io/instance: cert-exporter app.kubernetes.io/instance: cert-exporter
cert-exporter.io/type: daemon-set cert-exporter.io/type: daemon-set
annotations: <
{} <
spec: spec:
serviceAccountName: cert-exporter serviceAccountName: cert-exporter
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.
ah, i see
glad to remove this. thank you for the improvement! 🙏
@@ -19,8 +19,10 @@ spec: | |||
{{- with .Values.certManager.additionalPodLabels }} | |||
{{- toYaml . | nindent 8 }} | |||
{{- end }} | |||
{{- if .Values.certManager.podAnnotations }} |
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.
ah, i see
glad to remove this. thank you for the improvement! 🙏
While deploying with ArgoCD, I faced and issue where application is out of sync after daemonset restart.
This is because helm render "forces" empty annotations.