From b6c887e83fe19414c3aad45e5fd4b2fa2c225b99 Mon Sep 17 00:00:00 2001 From: Tim Campbell Date: Fri, 14 Mar 2025 09:37:30 +0100 Subject: [PATCH] Add ability to add labels to all deployed pods at a global level --- templates/deployment-sidekiq.yaml | 3 +++ templates/deployment-streaming.yaml | 3 +++ templates/deployment-web.yaml | 3 +++ values.yaml | 2 ++ 4 files changed, 11 insertions(+) diff --git a/templates/deployment-sidekiq.yaml b/templates/deployment-sidekiq.yaml index 5951bd6..74f6472 100644 --- a/templates/deployment-sidekiq.yaml +++ b/templates/deployment-sidekiq.yaml @@ -53,6 +53,9 @@ spec: {{- include "mastodon.globalLabels" $context | nindent 8 }} {{- include "mastodon.selectorLabels" $context | nindent 8 }} {{- include "mastodon.statsdExporterLabels" $context | nindent 8 }} + {{- with $context.Values.mastodon.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with $context.Values.mastodon.sidekiq.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/templates/deployment-streaming.yaml b/templates/deployment-streaming.yaml index 1139f9d..6715195 100644 --- a/templates/deployment-streaming.yaml +++ b/templates/deployment-streaming.yaml @@ -40,6 +40,9 @@ spec: labels: {{- include "mastodon.globalLabels" . | nindent 8 }} {{- include "mastodon.selectorLabels" . | nindent 8 }} + {{- with .Values.mastodon.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.mastodon.streaming.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/templates/deployment-web.yaml b/templates/deployment-web.yaml index 078bb5f..c62af1a 100644 --- a/templates/deployment-web.yaml +++ b/templates/deployment-web.yaml @@ -42,6 +42,9 @@ spec: {{- include "mastodon.globalLabels" . | nindent 8 }} {{- include "mastodon.selectorLabels" . | nindent 8 }} {{- include "mastodon.statsdExporterLabels" . | nindent 8 }} + {{- with .Values.mastodon.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.mastodon.web.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/values.yaml b/values.yaml index 89e637b..26f69be 100644 --- a/values.yaml +++ b/values.yaml @@ -13,6 +13,8 @@ image: mastodon: # Labels added to every Mastodon-related object labels: {} + # Labes added to every deployed mastodon pod + podLabels: {} # -- create an initial administrator user; the password is autogenerated and will # have to be reset