Skip to content

Commit

Permalink
Merge pull request #1156 from sudoleg/chart-secret-key
Browse files Browse the repository at this point in the history
Allow setting secret key by referencing a present/custom secret
  • Loading branch information
ralgozino authored Aug 19, 2024
2 parents 20f4274 + ef2484d commit a676225
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ app/static-content/*
tests/e2e/test-results
build/
node_modules/
static-content/
static-content/
*.tgz
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ keywords:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.10.0"
version: "0.11.0"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 7 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,17 @@ spec:
- name: GPM_PREFERRED_URL_SCHEME
value: {{ required "A valid .Values.config.preferredURLScheme entry required! Choose either http or https" .Values.config.preferredURLScheme | quote }}
- name: GPM_SECRET_KEY
{{- if .Values.config.secretKey }}
valueFrom:
secretKeyRef:
name: {{ include "gatekeeper-policy-manager.fullname" . }}
key: secretKey
{{- else }}
valueFrom:
secretKeyRef:
name: {{ .Values.config.secretRef }}
key: secretKey
{{- end }}
{{- if .Values.config.oidc.enabled }}
- name: GPM_AUTH_ENABLED
value: "OIDC"
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.config.secretKey }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
{{- include "gatekeeper-policy-manager.labels" . | nindent 4 }}
stringData:
secretKey: {{ required "A valid .Values.config.secretKey entry required! Choose a secure string" .Values.config.secretKey | quote }}
{{- end }}
6 changes: 5 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ topologySpreadConstraints: []
config:
preferredURLScheme: http
logLevel: info
secretKey:
# secret in plain text
secretKey: null
# name of the secret containing the secret key. if set, config.secretKey should be null!
# supported fields: secretKey
secretRef: null
multiCluster:
enabled: false
kubeconfig: |
Expand Down

0 comments on commit a676225

Please sign in to comment.