From 0dfb06afe71598fef29d898252d7be72117a6d86 Mon Sep 17 00:00:00 2001 From: Ravi Singal <62086374+ravisingal@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:00:22 +0530 Subject: [PATCH] chore: add common labels and annotations to pods (#138) --- .../templates/hypertrace-collector/deployment.yaml | 14 ++++++++++---- .../hypertrace-metrics-collector/deployment.yaml | 14 ++++++++++---- helm/values.yaml | 6 ++++++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/helm/templates/hypertrace-collector/deployment.yaml b/helm/templates/hypertrace-collector/deployment.yaml index 93c2852..501eb8d 100644 --- a/helm/templates/hypertrace-collector/deployment.yaml +++ b/helm/templates/hypertrace-collector/deployment.yaml @@ -25,14 +25,20 @@ spec: prometheus.io/path: "/metrics" prometheus.io/port: "8888" prometheus.io/scrape: "true" - {{- with .Values.podAnnotations }} + {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + {{- with .Values.commonPodAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} labels: release: {{ .Release.Name }} - {{- with .Values.podLabels }} + {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + {{- with .Values.commonPodLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/helm/templates/hypertrace-metrics-collector/deployment.yaml b/helm/templates/hypertrace-metrics-collector/deployment.yaml index 31b3579..e2cba7e 100644 --- a/helm/templates/hypertrace-metrics-collector/deployment.yaml +++ b/helm/templates/hypertrace-metrics-collector/deployment.yaml @@ -26,14 +26,20 @@ spec: prometheus.io/path: "/metrics" prometheus.io/port: "8888" prometheus.io/scrape: "true" - {{- with .Values.metrics.podAnnotations }} + {{- with .Values.metrics.podAnnotations }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + {{- with .Values.commonPodAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} labels: release: {{ .Release.Name }} - {{- with .Values.metrics.podLabels }} + {{- with .Values.metrics.podLabels }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + {{- with .Values.commonPodLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/helm/values.yaml b/helm/values.yaml index 5fad2fd..3ea5ed5 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -97,6 +97,10 @@ podLabels: podAnnotations: {} +commonPodLabels: {} + +commonPodAnnotations: {} + podSecurityContext: runAsUser: 65532 fsGroup: 65532 @@ -117,6 +121,8 @@ affinity: {} hostNetwork: false +imagePullSecrets: [] + # The Deployment Selector match labels are different from the pod labels. Note that they should be a subset of the pod # labels. You append new labels to them but cannot remove labels. If you remove or modify the labels you will need to # delete the existing deployment bearing the same name and then redeploy. This is the reason why they are separated from