From 09787c75895ef9c7201262405151f7444e1695aa Mon Sep 17 00:00:00 2001 From: Juan Ariza Toledano Date: Tue, 29 Aug 2023 09:00:12 +0200 Subject: [PATCH] [bitnami/mastodon] Support for customizing standard labels (#18621) --- bitnami/mastodon/Chart.yaml | 2 +- .../mastodon/templates/apache-configmap.yaml | 5 +---- .../mastodon/templates/default-configmap.yaml | 5 +---- bitnami/mastodon/templates/default-secret.yaml | 5 +---- .../mastodon/templates/externaldb-secret.yaml | 5 +---- .../templates/externalelasticsearch-secret.yaml | 5 +---- .../templates/externalredis-secret.yaml | 5 +---- .../mastodon/templates/externals3-secret.yaml | 5 +---- bitnami/mastodon/templates/extra-configmap.yaml | 5 +---- bitnami/mastodon/templates/extra-secret.yaml | 5 +---- .../templates/init-job/init-job-configmap.yaml | 5 +---- .../mastodon/templates/init-job/init-job.yaml | 11 +++-------- bitnami/mastodon/templates/pvc.yaml | 14 +++----------- bitnami/mastodon/templates/service-account.yaml | 14 +++----------- .../mastodon/templates/sidekiq/deployment.yaml | 17 ++++++----------- bitnami/mastodon/templates/smtp-secret.yaml | 5 +---- .../templates/streaming/deployment.yaml | 17 ++++++----------- .../mastodon/templates/streaming/service.yaml | 17 +++++------------ .../tootctlMediaManagement/configmap.yaml | 5 +---- .../tootctlMediaManagement/cronjob.yaml | 5 +---- bitnami/mastodon/templates/web/deployment.yaml | 17 ++++++----------- bitnami/mastodon/templates/web/service.yaml | 17 +++++------------ 22 files changed, 51 insertions(+), 140 deletions(-) diff --git a/bitnami/mastodon/Chart.yaml b/bitnami/mastodon/Chart.yaml index 33510d0a99..f980a1926d 100644 --- a/bitnami/mastodon/Chart.yaml +++ b/bitnami/mastodon/Chart.yaml @@ -49,4 +49,4 @@ maintainers: name: mastodon sources: - https://github.com/bitnami/charts/tree/main/bitnami/mastodon -version: 2.0.0 +version: 2.1.0 diff --git a/bitnami/mastodon/templates/apache-configmap.yaml b/bitnami/mastodon/templates/apache-configmap.yaml index fe524f4a40..4fd2b649f4 100644 --- a/bitnami/mastodon/templates/apache-configmap.yaml +++ b/bitnami/mastodon/templates/apache-configmap.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{ include "mastodon.apache.vhostconfigmap" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/default-configmap.yaml b/bitnami/mastodon/templates/default-configmap.yaml index 9d8da49086..f25843882b 100644 --- a/bitnami/mastodon/templates/default-configmap.yaml +++ b/bitnami/mastodon/templates/default-configmap.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-default" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/default-secret.yaml b/bitnami/mastodon/templates/default-secret.yaml index 4b1acef006..8c7de49179 100644 --- a/bitnami/mastodon/templates/default-secret.yaml +++ b/bitnami/mastodon/templates/default-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-default" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/externaldb-secret.yaml b/bitnami/mastodon/templates/externaldb-secret.yaml index c44fa8b1ee..bc3efd3ac4 100644 --- a/bitnami/mastodon/templates/externaldb-secret.yaml +++ b/bitnami/mastodon/templates/externaldb-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-externaldb" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/externalelasticsearch-secret.yaml b/bitnami/mastodon/templates/externalelasticsearch-secret.yaml index d3fc917877..e3132ac123 100644 --- a/bitnami/mastodon/templates/externalelasticsearch-secret.yaml +++ b/bitnami/mastodon/templates/externalelasticsearch-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-externalelasticsearch" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/externalredis-secret.yaml b/bitnami/mastodon/templates/externalredis-secret.yaml index f420636b20..0e5f2c1121 100644 --- a/bitnami/mastodon/templates/externalredis-secret.yaml +++ b/bitnami/mastodon/templates/externalredis-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-externalredis" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/externals3-secret.yaml b/bitnami/mastodon/templates/externals3-secret.yaml index 6627266d73..5cee1569d1 100644 --- a/bitnami/mastodon/templates/externals3-secret.yaml +++ b/bitnami/mastodon/templates/externals3-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-externals3" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/extra-configmap.yaml b/bitnami/mastodon/templates/extra-configmap.yaml index b822e58ef1..85253f40a7 100644 --- a/bitnami/mastodon/templates/extra-configmap.yaml +++ b/bitnami/mastodon/templates/extra-configmap.yaml @@ -9,11 +9,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-extra" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/extra-secret.yaml b/bitnami/mastodon/templates/extra-secret.yaml index 287e5a4dbf..bda39218bf 100644 --- a/bitnami/mastodon/templates/extra-secret.yaml +++ b/bitnami/mastodon/templates/extra-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-extra" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/init-job/init-job-configmap.yaml b/bitnami/mastodon/templates/init-job/init-job-configmap.yaml index f40d655073..3183537c92 100644 --- a/bitnami/mastodon/templates/init-job/init-job-configmap.yaml +++ b/bitnami/mastodon/templates/init-job/init-job-configmap.yaml @@ -8,11 +8,8 @@ kind: ConfigMap metadata: name: {{ printf "%s-init-scripts" (include "common.names.fullname" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/init-job/init-job.yaml b/bitnami/mastodon/templates/init-job/init-job.yaml index 6255bafb05..0e14e3ecaf 100644 --- a/bitnami/mastodon/templates/init-job/init-job.yaml +++ b/bitnami/mastodon/templates/init-job/init-job.yaml @@ -9,11 +9,8 @@ kind: Job metadata: name: {{ include "common.names.fullname" . }}-init namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.initJob.annotations "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -22,11 +19,9 @@ spec: backoffLimit: {{ .Values.initJob.backoffLimit }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- $podLabels := merge .Values.initJob.podLabels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: init - {{- if .Values.initJob.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.initJob.podLabels "context" $) | nindent 8 }} - {{- end }} {{- if .Values.initJob.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.podAnnotations "context" $) | nindent 8 }} {{- end }} diff --git a/bitnami/mastodon/templates/pvc.yaml b/bitnami/mastodon/templates/pvc.yaml index 5b1984ceec..f1fcb82643 100644 --- a/bitnami/mastodon/templates/pvc.yaml +++ b/bitnami/mastodon/templates/pvc.yaml @@ -9,19 +9,11 @@ apiVersion: v1 metadata: name: {{ include "mastodon.pvc" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.persistence.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.persistence.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.persistence.annotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.persistence.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: accessModes: diff --git a/bitnami/mastodon/templates/service-account.yaml b/bitnami/mastodon/templates/service-account.yaml index 33956e67e0..bfa24ae2f2 100644 --- a/bitnami/mastodon/templates/service-account.yaml +++ b/bitnami/mastodon/templates/service-account.yaml @@ -9,19 +9,11 @@ kind: ServiceAccount metadata: name: {{ include "mastodon.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.serviceAccount.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.annotations "context" $) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.serviceAccount.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} {{- end }} diff --git a/bitnami/mastodon/templates/sidekiq/deployment.yaml b/bitnami/mastodon/templates/sidekiq/deployment.yaml index 8e3ffe2b20..aff43f771c 100644 --- a/bitnami/mastodon/templates/sidekiq/deployment.yaml +++ b/bitnami/mastodon/templates/sidekiq/deployment.yaml @@ -9,12 +9,9 @@ kind: Deployment metadata: name: {{ template "mastodon.sidekiq.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: sidekiq - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -23,19 +20,17 @@ spec: {{- if .Values.sidekiq.updateStrategy }} strategy: {{- toYaml .Values.sidekiq.updateStrategy | nindent 4 }} {{- end }} + {{- $podLabels := merge .Values.sidekiq.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: sidekiq template: metadata: {{- if .Values.sidekiq.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.podAnnotations "context" $) | nindent 8 }} {{- end }} - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: sidekiq - {{- if .Values.sidekiq.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.podLabels "context" $) | nindent 8 }} - {{- end }} spec: serviceAccountName: {{ template "mastodon.serviceAccountName" . }} {{- include "mastodon.imagePullSecrets" . | nindent 6 }} @@ -46,8 +41,8 @@ spec: affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.sidekiq.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.sidekiq.podAffinityPreset "component" "sidekiq" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.sidekiq.podAntiAffinityPreset "component" "sidekiq" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.sidekiq.podAffinityPreset "component" "sidekiq" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.sidekiq.podAntiAffinityPreset "component" "sidekiq" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.sidekiq.nodeAffinityPreset.type "key" .Values.sidekiq.nodeAffinityPreset.key "values" .Values.sidekiq.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.sidekiq.nodeSelector }} diff --git a/bitnami/mastodon/templates/smtp-secret.yaml b/bitnami/mastodon/templates/smtp-secret.yaml index 65bc4f0c3b..e7e6467456 100644 --- a/bitnami/mastodon/templates/smtp-secret.yaml +++ b/bitnami/mastodon/templates/smtp-secret.yaml @@ -9,11 +9,8 @@ kind: Secret metadata: name: {{ printf "%s-smtp" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/mastodon/templates/streaming/deployment.yaml b/bitnami/mastodon/templates/streaming/deployment.yaml index 442d221a7e..abeccb54c1 100644 --- a/bitnami/mastodon/templates/streaming/deployment.yaml +++ b/bitnami/mastodon/templates/streaming/deployment.yaml @@ -9,12 +9,9 @@ kind: Deployment metadata: name: {{ template "mastodon.streaming.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: streaming - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -23,19 +20,17 @@ spec: {{- if .Values.streaming.updateStrategy }} strategy: {{- toYaml .Values.streaming.updateStrategy | nindent 4 }} {{- end }} + {{- $podLabels := merge .Values.streaming.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: streaming template: metadata: {{- if .Values.streaming.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.streaming.podAnnotations "context" $) | nindent 8 }} {{- end }} - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: streaming - {{- if .Values.streaming.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.streaming.podLabels "context" $) | nindent 8 }} - {{- end }} spec: serviceAccountName: {{ template "mastodon.serviceAccountName" . }} {{- include "mastodon.imagePullSecrets" . | nindent 6 }} @@ -46,8 +41,8 @@ spec: affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.streaming.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.streaming.podAffinityPreset "component" "streaming" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.streaming.podAntiAffinityPreset "component" "streaming" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.streaming.podAffinityPreset "component" "streaming" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.streaming.podAntiAffinityPreset "component" "streaming" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.streaming.nodeAffinityPreset.type "key" .Values.streaming.nodeAffinityPreset.key "values" .Values.streaming.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.streaming.nodeSelector }} diff --git a/bitnami/mastodon/templates/streaming/service.yaml b/bitnami/mastodon/templates/streaming/service.yaml index 2479e6ff52..dc5c2b6885 100644 --- a/bitnami/mastodon/templates/streaming/service.yaml +++ b/bitnami/mastodon/templates/streaming/service.yaml @@ -8,20 +8,12 @@ kind: Service metadata: name: {{ template "mastodon.streaming.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: streaming - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.streaming.service.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.streaming.service.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.streaming.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.streaming.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: {{ .Values.streaming.service.type }} @@ -56,5 +48,6 @@ spec: {{- if .Values.streaming.service.extraPorts }} {{- include "common.tplvalues.render" (dict "value" .Values.streaming.service.extraPorts "context" $) | nindent 4 }} {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.streaming.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: streaming diff --git a/bitnami/mastodon/templates/tootctlMediaManagement/configmap.yaml b/bitnami/mastodon/templates/tootctlMediaManagement/configmap.yaml index 6baddadabb..8383080dea 100644 --- a/bitnami/mastodon/templates/tootctlMediaManagement/configmap.yaml +++ b/bitnami/mastodon/templates/tootctlMediaManagement/configmap.yaml @@ -9,12 +9,9 @@ kind: ConfigMap metadata: name: {{ template "mastodon.tootctlMediaManagement.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: tootctlMediaManagement - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} data: media-cache-manage.sh: | set -o errexit diff --git a/bitnami/mastodon/templates/tootctlMediaManagement/cronjob.yaml b/bitnami/mastodon/templates/tootctlMediaManagement/cronjob.yaml index 7f4b21083d..196f89e4e9 100644 --- a/bitnami/mastodon/templates/tootctlMediaManagement/cronjob.yaml +++ b/bitnami/mastodon/templates/tootctlMediaManagement/cronjob.yaml @@ -10,12 +10,9 @@ metadata: annotations: name: {{ template "mastodon.tootctlMediaManagement.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: tootctlMediaManagement - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} spec: concurrencyPolicy: {{ .Values.tootctlMediaManagement.concurrencyPolicy }} failedJobsHistoryLimit: {{ .Values.tootctlMediaManagement.failedJobsHistoryLimit }} diff --git a/bitnami/mastodon/templates/web/deployment.yaml b/bitnami/mastodon/templates/web/deployment.yaml index 3a097b7e69..0b8918678a 100644 --- a/bitnami/mastodon/templates/web/deployment.yaml +++ b/bitnami/mastodon/templates/web/deployment.yaml @@ -9,12 +9,9 @@ kind: Deployment metadata: name: {{ template "mastodon.web.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: web - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -23,19 +20,17 @@ spec: {{- if .Values.web.updateStrategy }} strategy: {{- toYaml .Values.web.updateStrategy | nindent 4 }} {{- end }} + {{- $podLabels := merge .Values.web.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: web template: metadata: {{- if .Values.web.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.web.podAnnotations "context" $) | nindent 8 }} {{- end }} - labels: {{- include "common.labels.standard" . | nindent 8 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: web - {{- if .Values.web.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.web.podLabels "context" $) | nindent 8 }} - {{- end }} spec: serviceAccountName: {{ template "mastodon.serviceAccountName" . }} {{- include "mastodon.imagePullSecrets" . | nindent 6 }} @@ -46,8 +41,8 @@ spec: affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.web.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.web.podAffinityPreset "component" "web" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.web.podAntiAffinityPreset "component" "web" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.web.podAffinityPreset "component" "web" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.web.podAntiAffinityPreset "component" "web" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.web.nodeAffinityPreset.type "key" .Values.web.nodeAffinityPreset.key "values" .Values.web.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.web.nodeSelector }} diff --git a/bitnami/mastodon/templates/web/service.yaml b/bitnami/mastodon/templates/web/service.yaml index 25380fa5db..c7e9b9bbd3 100644 --- a/bitnami/mastodon/templates/web/service.yaml +++ b/bitnami/mastodon/templates/web/service.yaml @@ -8,20 +8,12 @@ kind: Service metadata: name: {{ template "mastodon.web.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/part-of: mastodon app.kubernetes.io/component: web - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} {{- if or .Values.web.service.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.web.service.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.web.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.web.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: {{ .Values.web.service.type }} @@ -56,5 +48,6 @@ spec: {{- if .Values.web.service.extraPorts }} {{- include "common.tplvalues.render" (dict "value" .Values.web.service.extraPorts "context" $) | nindent 4 }} {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.web.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: web