Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(helm chart): service account secrets, with fix for indentation #3291

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
43 changes: 43 additions & 0 deletions utils/helm/speckle-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1063,3 +1063,46 @@ Generate the environment variables for Speckle server and Speckle objects deploy
value: "/multi-region-config/multi-region-config.json"
{{- end }}
{{- end }}

{{/*
Generate the secrets to which the service account should allow access for the Speckle server and Speckle objects deployments
*/}}
{{- define "server.serviceAccountSecrets" -}}
{{- $secretNames := list ( default .Values.secretName .Values.db.connectionString.secretName ) }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.redis.connectionString.secretName ) }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.s3.secret_key.secretName ) }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.sessionSecret.secretName ) }}
{{- if .Values.server.auth.google.enabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.auth.google.clientSecret.secretName ) }}
{{- end }}
{{- if .Values.server.auth.github.enabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.auth.github.clientSecret.secretName ) }}
{{- end }}
{{- if .Values.server.auth.azure_ad.enabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.auth.azure_ad.clientSecret.secretName ) }}
{{- end }}
{{- if .Values.server.auth.oidc.enabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.auth.oidc.clientSecret.secretName ) }}
{{- end }}
{{- if .Values.server.email.enabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.email.password.secretName ) }}
{{- end }}
{{- if .Values.server.monitoring.apollo.enabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.monitoring.apollo.key.secretName ) }}
{{- end }}
{{- if .Values.featureFlags.automateModuleEnabled }}
{{- $secretNames := append $secretNames "encryption-keys" }}
{{- end }}
{{- if .Values.featureFlags.workspaceModuleEnabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.licenseTokenSecret.secretName ) }}
{{- end }}
{{- if .Values.featureFlags.workspacesMultiRegionEnabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.multiRegion.config.secretName ) }}
{{- end }}
{{- if .Values.featureFlags.gendoAIModuleEnabled }}
{{- $secretNames := append $secretNames ( default .Values.secretName .Values.server.gendoAI.key.secretName ) }}
{{- end }}
{{- range $secretName := uniq $secretNames }}
- name: {{ $secretName }}
{{- end }}
{{- end }}
35 changes: 1 addition & 34 deletions utils/helm/speckle-server/templates/objects/serviceaccount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,5 @@ metadata:
"kubernetes.io/enforce-mountable-secrets": "true"
automountServiceAccountToken: false
secrets:
- name: {{ default .Values.secretName .Values.db.connectionString.secretName }}
- name: {{ default .Values.secretName .Values.redis.connectionString.secretName }}
- name: {{ default .Values.secretName .Values.s3.secret_key.secretName }}
- name: {{ default .Values.secretName .Values.server.sessionSecret.secretName }}
{{- if .Values.server.auth.google.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.google.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.auth.github.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.github.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.auth.azure_ad.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.azure_ad.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.auth.oidc.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.oidc.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.email.enabled }}
- name: {{ default .Values.secretName .Values.server.email.password.secretName }}
{{- end }}
{{- if .Values.server.monitoring.apollo.enabled }}
- name: {{ default .Values.secretName .Values.server.monitoring.apollo.key.secretName }}
{{- end }}
{{- if .Values.featureFlags.automateModuleEnabled }}
- name: encryption-keys
{{- end }}
{{- if .Values.featureFlags.workspacesModuleEnabled }}
- name: {{ default .Values.secretName .Values.server.licenseTokenSecret.secretName }}
{{- end }}
{{- if .Values.featureFlags.workspacesMultiRegionEnabled }}
- name: {{ default .Values.secretName .Values.multiRegion.config.secretName }}
{{- end }}
{{- if .Values.featureFlags.gendoAIModuleEnabled }}
- name: {{ default .Values.secretName .Values.server.gendoAI.key.secretName }}
{{- end }}
{{- include "server.serviceAccountSecrets" $ | indent 2 }}
{{- end -}}
35 changes: 1 addition & 34 deletions utils/helm/speckle-server/templates/server/serviceaccount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,5 @@ metadata:
"kubernetes.io/enforce-mountable-secrets": "true"
automountServiceAccountToken: false
secrets:
- name: {{ default .Values.secretName .Values.db.connectionString.secretName }}
- name: {{ default .Values.secretName .Values.redis.connectionString.secretName }}
- name: {{ default .Values.secretName .Values.s3.secret_key.secretName }}
- name: {{ default .Values.secretName .Values.server.sessionSecret.secretName }}
{{- if .Values.server.auth.google.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.google.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.auth.github.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.github.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.auth.azure_ad.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.azure_ad.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.auth.oidc.enabled }}
- name: {{ default .Values.secretName .Values.server.auth.oidc.clientSecret.secretName }}
{{- end }}
{{- if .Values.server.email.enabled }}
- name: {{ default .Values.secretName .Values.server.email.password.secretName }}
{{- end }}
{{- if .Values.server.monitoring.apollo.enabled }}
- name: {{ default .Values.secretName .Values.server.monitoring.apollo.key.secretName }}
{{- end }}
{{- if .Values.featureFlags.automateModuleEnabled }}
- name: encryption-keys
{{- end }}
{{- if .Values.featureFlags.workspacesModuleEnabled }}
- name: {{ default .Values.secretName .Values.server.licenseTokenSecret.secretName }}
{{- end }}
{{- if .Values.featureFlags.workspacesMultiRegionEnabled }}
- name: {{ default .Values.secretName .Values.multiRegion.config.secretName }}
{{- end }}
{{- if .Values.featureFlags.gendoAIModuleEnabled }}
- name: {{ default .Values.secretName .Values.server.gendoAI.key.secretName }}
{{- end }}
{{- include "server.serviceAccountSecrets" $ | indent 2 }}
{{- end -}}