diff --git a/charts/atlantis/templates/secret-api.yaml b/charts/atlantis/templates/secret-api.yaml index 1fe2e761..f0a4e17b 100644 --- a/charts/atlantis/templates/secret-api.yaml +++ b/charts/atlantis/templates/secret-api.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: apisecret: {{ .Values.api.secret | b64enc }} diff --git a/charts/atlantis/templates/secret-aws.yaml b/charts/atlantis/templates/secret-aws.yaml index 0e202fab..dcf0747d 100644 --- a/charts/atlantis/templates/secret-aws.yaml +++ b/charts/atlantis/templates/secret-aws.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: {{- if .Values.aws.credentials }} diff --git a/charts/atlantis/templates/secret-basic-auth.yaml b/charts/atlantis/templates/secret-basic-auth.yaml index 66b7c469..ff5d3802 100644 --- a/charts/atlantis/templates/secret-basic-auth.yaml +++ b/charts/atlantis/templates/secret-basic-auth.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: username: {{ .Values.basicAuth.username | b64enc }} diff --git a/charts/atlantis/templates/secret-gitconfig.yaml b/charts/atlantis/templates/secret-gitconfig.yaml index 05cbcabb..8e9ffd8c 100644 --- a/charts/atlantis/templates/secret-gitconfig.yaml +++ b/charts/atlantis/templates/secret-gitconfig.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: gitconfig: {{ .Values.gitconfig | b64enc }} diff --git a/charts/atlantis/templates/secret-netrc.yaml b/charts/atlantis/templates/secret-netrc.yaml index d985664a..cbcab2e2 100644 --- a/charts/atlantis/templates/secret-netrc.yaml +++ b/charts/atlantis/templates/secret-netrc.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: netrc: {{ .Values.netrc | b64enc }} diff --git a/charts/atlantis/templates/secret-redis.yaml b/charts/atlantis/templates/secret-redis.yaml index d43082ad..92b193ac 100644 --- a/charts/atlantis/templates/secret-redis.yaml +++ b/charts/atlantis/templates/secret-redis.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: password: {{ .Values.redis.password | b64enc }} diff --git a/charts/atlantis/templates/secret-service-account.yaml b/charts/atlantis/templates/secret-service-account.yaml index b0ea4793..f7912b80 100644 --- a/charts/atlantis/templates/secret-service-account.yaml +++ b/charts/atlantis/templates/secret-service-account.yaml @@ -8,9 +8,14 @@ metadata: labels: component: service-account-secret {{- include "atlantis.labels" $ | nindent 4 }} - {{- with $.Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: service-account.json: {{ $secret }} diff --git a/charts/atlantis/templates/secret-webhook.yaml b/charts/atlantis/templates/secret-webhook.yaml index b309a2ff..53d23e21 100644 --- a/charts/atlantis/templates/secret-webhook.yaml +++ b/charts/atlantis/templates/secret-webhook.yaml @@ -6,9 +6,14 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "atlantis.labels" . | nindent 4 }} - {{- with .Values.extraAnnotations }} + {{- if or .Values.secretAnnotations .Values.extraAnnotations }} annotations: + {{- with .Values.secretAnnotations }} {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.extraAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} data: {{- if .Values.githubApp }} diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index 9bd743fc..8e1e63cc 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -1193,6 +1193,16 @@ "description": "SecurityContext configuration for atlantis containers.", "$ref": "#/definitions/io.k8s.api.core.v1.SecurityContext" }, + "secretAnnotations": { + "type": "object", + "description": "Add additional secret annotations", + "items": { + "type": "object" + }, + "examples": { + "team": "example" + } + }, "servicemonitor": { "type": "object", "description": "ServiceMonitor configuration for atlantis containers.", diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index 52881a68..86de13c9 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -652,6 +652,12 @@ dnsConfig: {} hostNetwork: false +# - These annotations will be added to secrets. +# Check values.yaml for examples. +secretAnnotations: {} +# secretAnnotations: +# team: example + # - These annotations will be added to all the resources. # Check values.yaml for examples. extraAnnotations: {}