From 8f612abc721bffbf7fe9f5aeb730bc93cf5eb45e Mon Sep 17 00:00:00 2001 From: Tim Campbell Date: Wed, 19 Apr 2023 15:31:36 -0700 Subject: [PATCH] Added deployment annotations to chart --- templates/deployment-sidekiq.yaml | 4 ++++ templates/deployment-streaming.yaml | 4 ++++ templates/deployment-web.yaml | 4 ++++ values.yaml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/templates/deployment-sidekiq.yaml b/templates/deployment-sidekiq.yaml index 8a0e9e8..6aac6e8 100644 --- a/templates/deployment-sidekiq.yaml +++ b/templates/deployment-sidekiq.yaml @@ -9,6 +9,10 @@ metadata: {{- include "mastodon.labels" $context | nindent 4 }} app.kubernetes.io/component: sidekiq-{{ .name }} app.kubernetes.io/part-of: rails + annotations: + {{- with $context.Values.deployAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (has "scheduler" .queues) }} {{- if (gt (int .replicas) 1) }} diff --git a/templates/deployment-streaming.yaml b/templates/deployment-streaming.yaml index dd80404..1e690ac 100644 --- a/templates/deployment-streaming.yaml +++ b/templates/deployment-streaming.yaml @@ -4,6 +4,10 @@ metadata: name: {{ include "mastodon.fullname" . }}-streaming labels: {{- include "mastodon.labels" . | nindent 4 }} + annotations: + {{- with .Values.deployAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.mastodon.streaming.replicas }} selector: diff --git a/templates/deployment-web.yaml b/templates/deployment-web.yaml index 30308e2..e707b3c 100644 --- a/templates/deployment-web.yaml +++ b/templates/deployment-web.yaml @@ -4,6 +4,10 @@ metadata: name: {{ include "mastodon.fullname" . }}-web labels: {{- include "mastodon.labels" . | nindent 4 }} + annotations: + {{- with .Values.deployAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.mastodon.web.replicas }} selector: diff --git a/values.yaml b/values.yaml index ea9848b..c8c5d96 100644 --- a/values.yaml +++ b/values.yaml @@ -408,6 +408,10 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "" +# Custom annotations to apply to all created deployment objects. These can be +# used to help mastodon interact with other services in the cluster. +deployAnnotations: {} + # -- Kubernetes manages pods for jobs and pods for deployments differently, so you might # need to apply different annotations to the two different sets of pods. The annotations # set with podAnnotations will be added to all deployment-managed pods.