From 476e74b4c4f967884be120fb75b87f232962103d Mon Sep 17 00:00:00 2001 From: Alex Nordlund Date: Tue, 8 Nov 2022 17:21:06 +0100 Subject: [PATCH] Assign unique set of labels to k8s deployments #19703 (#19706) --- chart/templates/cronjob-media-remove.yaml | 2 +- chart/templates/deployment-sidekiq.yaml | 8 +++++--- chart/templates/deployment-streaming.yaml | 2 ++ chart/templates/deployment-web.yaml | 6 ++++-- chart/templates/job-assets-precompile.yaml | 2 +- chart/templates/job-chewy-upgrade.yaml | 2 +- chart/templates/job-create-admin.yaml | 2 +- chart/templates/job-db-migrate.yaml | 2 +- chart/templates/service-streaming.yaml | 1 + chart/templates/service-web.yaml | 1 + 10 files changed, 18 insertions(+), 10 deletions(-) diff --git a/chart/templates/cronjob-media-remove.yaml b/chart/templates/cronjob-media-remove.yaml index 160aee20421..d3566e32d47 100644 --- a/chart/templates/cronjob-media-remove.yaml +++ b/chart/templates/cronjob-media-remove.yaml @@ -27,7 +27,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: component + - key: app.kubernetes.io/part-of operator: In values: - rails diff --git a/chart/templates/deployment-sidekiq.yaml b/chart/templates/deployment-sidekiq.yaml index b2e5af522e5..dd707a4d048 100644 --- a/chart/templates/deployment-sidekiq.yaml +++ b/chart/templates/deployment-sidekiq.yaml @@ -11,7 +11,8 @@ spec: selector: matchLabels: {{- include "mastodon.selectorLabels" . | nindent 6 }} - component: rails + app.kubernetes.io/component: sidekiq + app.kubernetes.io/part-of: rails template: metadata: annotations: @@ -22,7 +23,8 @@ spec: rollme: {{ randAlphaNum 5 | quote }} labels: {{- include "mastodon.selectorLabels" . | nindent 8 }} - component: rails + app.kubernetes.io/component: sidekiq + app.kubernetes.io/part-of: rails spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -40,7 +42,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: component + - key: app.kubernetes.io/part-of operator: In values: - rails diff --git a/chart/templates/deployment-streaming.yaml b/chart/templates/deployment-streaming.yaml index 12203a530bb..7f03c9e23ec 100644 --- a/chart/templates/deployment-streaming.yaml +++ b/chart/templates/deployment-streaming.yaml @@ -11,6 +11,7 @@ spec: selector: matchLabels: {{- include "mastodon.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: streaming template: metadata: {{- with .Values.podAnnotations }} @@ -19,6 +20,7 @@ spec: {{- end }} labels: {{- include "mastodon.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: streaming spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/chart/templates/deployment-web.yaml b/chart/templates/deployment-web.yaml index c50f32d9834..fb58b1ade00 100644 --- a/chart/templates/deployment-web.yaml +++ b/chart/templates/deployment-web.yaml @@ -11,7 +11,8 @@ spec: selector: matchLabels: {{- include "mastodon.selectorLabels" . | nindent 6 }} - component: rails + app.kubernetes.io/component: web + app.kubernetes.io/part-of: rails template: metadata: annotations: @@ -22,7 +23,8 @@ spec: rollme: {{ randAlphaNum 5 | quote }} labels: {{- include "mastodon.selectorLabels" . | nindent 8 }} - component: rails + app.kubernetes.io/component: web + app.kubernetes.io/part-of: rails spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/chart/templates/job-assets-precompile.yaml b/chart/templates/job-assets-precompile.yaml index faa51a20d9d..9bdec2ab7cf 100644 --- a/chart/templates/job-assets-precompile.yaml +++ b/chart/templates/job-assets-precompile.yaml @@ -27,7 +27,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: component + - key: app.kubernetes.io/part-of operator: In values: - rails diff --git a/chart/templates/job-chewy-upgrade.yaml b/chart/templates/job-chewy-upgrade.yaml index ae6fb38e129..556133dd32f 100644 --- a/chart/templates/job-chewy-upgrade.yaml +++ b/chart/templates/job-chewy-upgrade.yaml @@ -28,7 +28,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: component + - key: app.kubernetes.io/part-of operator: In values: - rails diff --git a/chart/templates/job-create-admin.yaml b/chart/templates/job-create-admin.yaml index 659c00671fc..94d39dcbb56 100644 --- a/chart/templates/job-create-admin.yaml +++ b/chart/templates/job-create-admin.yaml @@ -28,7 +28,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: component + - key: app.kubernetes.io/part-of operator: In values: - rails diff --git a/chart/templates/job-db-migrate.yaml b/chart/templates/job-db-migrate.yaml index 8e4f70dfb1d..e1544d2b66d 100644 --- a/chart/templates/job-db-migrate.yaml +++ b/chart/templates/job-db-migrate.yaml @@ -27,7 +27,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: component + - key: app.kubernetes.io/part-of operator: In values: - rails diff --git a/chart/templates/service-streaming.yaml b/chart/templates/service-streaming.yaml index a005e617c37..bade7b1e519 100644 --- a/chart/templates/service-streaming.yaml +++ b/chart/templates/service-streaming.yaml @@ -13,3 +13,4 @@ spec: name: streaming selector: {{- include "mastodon.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: streaming diff --git a/chart/templates/service-web.yaml b/chart/templates/service-web.yaml index 3563fde7013..acf1233dcef 100644 --- a/chart/templates/service-web.yaml +++ b/chart/templates/service-web.yaml @@ -13,3 +13,4 @@ spec: name: http selector: {{- include "mastodon.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: web