From ec67590472843d8bcbf0bb6326756789a989b54c Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Tue, 6 Aug 2024 13:29:31 +0200 Subject: [PATCH] helm: common labels --- .../helmcharts/openreplay/charts/alerts/templates/_helpers.tpl | 3 +++ .../helmcharts/openreplay/charts/assets/templates/_helpers.tpl | 3 +++ .../openreplay/charts/assist-stats/templates/_helpers.tpl | 3 +++ .../helmcharts/openreplay/charts/assist/templates/_helpers.tpl | 3 +++ .../openreplay/charts/canvas-handler/templates/_helpers.tpl | 3 +++ .../openreplay/charts/chalice/templates/_helpers.tpl | 3 +++ .../openreplay/charts/connector/templates/_helpers.tpl | 3 +++ scripts/helmcharts/openreplay/charts/db/templates/_helpers.tpl | 3 +++ .../helmcharts/openreplay/charts/ender/templates/_helpers.tpl | 3 +++ .../openreplay/charts/frontend/templates/_helpers.tpl | 3 +++ .../openreplay/charts/frontend/templates/ingress.yaml | 2 ++ .../openreplay/charts/heuristics/templates/_helpers.tpl | 3 +++ .../helmcharts/openreplay/charts/http/templates/_helpers.tpl | 3 +++ .../openreplay/charts/imagestorage/templates/_helpers.tpl | 3 +++ .../openreplay/charts/ingress-nginx/templates/_helpers.tpl | 3 +++ .../openreplay/charts/integrations/templates/_helpers.tpl | 3 +++ .../helmcharts/openreplay/charts/peers/templates/_helpers.tpl | 3 +++ .../openreplay/charts/quickwit/templates/_helpers.tpl | 3 +++ .../helmcharts/openreplay/charts/sink/templates/_helpers.tpl | 3 +++ .../openreplay/charts/sourcemapreader/templates/_helpers.tpl | 3 +++ .../openreplay/charts/storage/templates/_helpers.tpl | 3 +++ .../openreplay/charts/utilities/templates/_helpers.tpl | 3 +++ .../openreplay/charts/utilities/templates/api-crons.yaml | 2 ++ .../openreplay/charts/utilities/templates/efs-cron.yaml | 2 ++ scripts/helmcharts/openreplay/templates/_helpers.tpl | 3 +++ scripts/helmcharts/openreplay/templates/job.yaml | 3 +++ scripts/helmcharts/openreplay/values.yaml | 1 + 27 files changed, 76 insertions(+) diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/alerts/templates/_helpers.tpl index 35ad32196..6b9a30bdf 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "alerts.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/assets/templates/_helpers.tpl index 6d684eed5..090a3824e 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/assets/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "assets.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/assist-stats/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/assist-stats/templates/_helpers.tpl index d23f2c782..31c699457 100644 --- a/scripts/helmcharts/openreplay/charts/assist-stats/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/assist-stats/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "assist-stats.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/assist/templates/_helpers.tpl index 95cab7e2b..47239a84d 100644 --- a/scripts/helmcharts/openreplay/charts/assist/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/assist/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "assist.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/canvas-handler/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/canvas-handler/templates/_helpers.tpl index 59bc66bf2..a0c186c7e 100644 --- a/scripts/helmcharts/openreplay/charts/canvas-handler/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/canvas-handler/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "canvas-handler.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/chalice/templates/_helpers.tpl index 27c1ff9f3..eec575a96 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "chalice.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/connector/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/connector/templates/_helpers.tpl index 9661f20a2..29b4f9b07 100644 --- a/scripts/helmcharts/openreplay/charts/connector/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/connector/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "connector.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/db/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/db/templates/_helpers.tpl index 8df84e9e2..8afba5495 100644 --- a/scripts/helmcharts/openreplay/charts/db/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/db/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "db.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/ender/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/ender/templates/_helpers.tpl index 1d0dc291c..a6bf8628a 100644 --- a/scripts/helmcharts/openreplay/charts/ender/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/ender/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "ender.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/frontend/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/frontend/templates/_helpers.tpl index 92c6c3b2d..c97909702 100644 --- a/scripts/helmcharts/openreplay/charts/frontend/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/frontend/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "frontend.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/frontend/templates/ingress.yaml b/scripts/helmcharts/openreplay/charts/frontend/templates/ingress.yaml index 2322119a1..b7c9d3a96 100644 --- a/scripts/helmcharts/openreplay/charts/frontend/templates/ingress.yaml +++ b/scripts/helmcharts/openreplay/charts/frontend/templates/ingress.yaml @@ -57,6 +57,8 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: openreplay-tracker-ingress + labels: + {{- include "frontend.labels" . | nindent 4 }} annotations: {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} diff --git a/scripts/helmcharts/openreplay/charts/heuristics/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/heuristics/templates/_helpers.tpl index cec89d6e3..9472a7ba6 100644 --- a/scripts/helmcharts/openreplay/charts/heuristics/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/heuristics/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "heuristics.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/http/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/http/templates/_helpers.tpl index c695edd7e..c59412833 100644 --- a/scripts/helmcharts/openreplay/charts/http/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/http/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "http.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/imagestorage/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/imagestorage/templates/_helpers.tpl index c57877578..c5dff4f0b 100644 --- a/scripts/helmcharts/openreplay/charts/imagestorage/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/imagestorage/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "imagestorage.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/ingress-nginx/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/ingress-nginx/templates/_helpers.tpl index 7db5b2ca8..6000e41ba 100644 --- a/scripts/helmcharts/openreplay/charts/ingress-nginx/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/ingress-nginx/templates/_helpers.tpl @@ -129,6 +129,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/part-of: {{ template "ingress-nginx.name" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- if .Values.commonLabels}} {{ toYaml .Values.commonLabels }} {{- end }} diff --git a/scripts/helmcharts/openreplay/charts/integrations/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/integrations/templates/_helpers.tpl index cdeef0f54..04269213e 100644 --- a/scripts/helmcharts/openreplay/charts/integrations/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/integrations/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "integrations.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/peers/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/peers/templates/_helpers.tpl index 9dce56cdd..3767d046a 100644 --- a/scripts/helmcharts/openreplay/charts/peers/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/peers/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "peers.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/quickwit/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/quickwit/templates/_helpers.tpl index e0dcda017..c6862969d 100644 --- a/scripts/helmcharts/openreplay/charts/quickwit/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/quickwit/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "quickwit.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/sink/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/sink/templates/_helpers.tpl index 39f92ccc1..f26f860db 100644 --- a/scripts/helmcharts/openreplay/charts/sink/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/sink/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "sink.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/_helpers.tpl index 2a99388f1..006e48ba4 100644 --- a/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "sourcemapreader.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/storage/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/storage/templates/_helpers.tpl index 9f87a2965..78144ff59 100644 --- a/scripts/helmcharts/openreplay/charts/storage/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/storage/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "storage.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/utilities/templates/_helpers.tpl b/scripts/helmcharts/openreplay/charts/utilities/templates/_helpers.tpl index 8999db4be..78d701aa7 100644 --- a/scripts/helmcharts/openreplay/charts/utilities/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/charts/utilities/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "utilities.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/charts/utilities/templates/api-crons.yaml b/scripts/helmcharts/openreplay/charts/utilities/templates/api-crons.yaml index a89bd05c2..5a679c9cd 100644 --- a/scripts/helmcharts/openreplay/charts/utilities/templates/api-crons.yaml +++ b/scripts/helmcharts/openreplay/charts/utilities/templates/api-crons.yaml @@ -13,6 +13,8 @@ kind: CronJob metadata: name: {{$key | kebabcase}}-cron namespace: {{ .Release.Namespace }} + labels: + {{- include "utilities.labels" . | nindent 4 }} spec: schedule: "{{ $job.cron }}" failedJobsHistoryLimit: 1 diff --git a/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml b/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml index dd3ca2609..55f8b8fc2 100644 --- a/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml +++ b/scripts/helmcharts/openreplay/charts/utilities/templates/efs-cron.yaml @@ -8,6 +8,8 @@ kind: CronJob metadata: name: efs-cleaner namespace: {{ .Release.Namespace }} + labels: + {{- include "utilities.labels" . | nindent 4 }} spec: schedule: "{{ .Values.cron }}" failedJobsHistoryLimit: 1 diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index 38ec6a459..554dd402a 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -71,6 +71,9 @@ helm.sh/chart: {{ include "openreplay.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.global.appLabels }} +{{- .Values.global.appLabels | toYaml | nindent 0}} +{{- end}} {{- end }} {{/* diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index 29a0ab363..5ad028be8 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -11,6 +11,8 @@ kind: ConfigMap metadata: name: db-migration-script namespace: "{{ .Release.Namespace }}" + labels: + {{- include "openreplay.labels" . | nindent 4 }} annotations: "helm.sh/hook": pre-install, pre-upgrade "helm.sh/hook-weight": "-6" # Higher precidence, so the first the config map will get created. @@ -24,6 +26,7 @@ metadata: namespace: "{{ .Release.Namespace }}" labels: app: databases + {{- include "openreplay.labels" . | nindent 4 }} annotations: "helm.sh/hook": pre-install, pre-upgrade "helm.sh/hook-weight": "-5" diff --git a/scripts/helmcharts/openreplay/values.yaml b/scripts/helmcharts/openreplay/values.yaml index a4273492c..96164aa20 100644 --- a/scripts/helmcharts/openreplay/values.yaml +++ b/scripts/helmcharts/openreplay/values.yaml @@ -41,6 +41,7 @@ minio: forceInit: false global: + appLabels: {} vault: *vault redis: *redis clusterDomain: "svc.cluster.local"