feat: add environment variables and secrets to statefulset and deployment (#644)
* feat: add environment variables and secrets to statefulset * feat: add env and envFromSecrets to deplyoment container
This commit is contained in:
committed by
GitHub
parent
ec26888487
commit
f67bff59c3
@@ -63,6 +63,19 @@ spec:
|
|||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
{{- if or .Values.deployment.env .Values.deployment.envFromSecrets }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.deployment.env }}
|
||||||
|
{{- toYaml .Values.deployment.env | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range .Values.deployment.envFromSecrets }}
|
||||||
|
- name: {{ .name }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .secretName }}
|
||||||
|
key: {{ .secretKey }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.service.http.port }}
|
containerPort: {{ .Values.service.http.port }}
|
||||||
|
|||||||
@@ -131,6 +131,19 @@ spec:
|
|||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
{{- if or .Values.deployment.env .Values.deployment.envFromSecrets }}
|
||||||
|
env:
|
||||||
|
{{- if .Values.deployment.env }}
|
||||||
|
{{- toYaml .Values.deployment.env | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range .Values.deployment.envFromSecrets }}
|
||||||
|
- name: {{ .name }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .secretName }}
|
||||||
|
key: {{ .secretKey }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.service.http.port }}
|
containerPort: {{ .Values.service.http.port }}
|
||||||
|
|||||||
@@ -258,6 +258,13 @@ autoscaling:
|
|||||||
## Additional deployment configuration
|
## Additional deployment configuration
|
||||||
deployment:
|
deployment:
|
||||||
env: []
|
env: []
|
||||||
|
## Load environment variables from specific secret keys
|
||||||
|
## Each entry creates an env.valueFrom.secretKeyRef in the container spec
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables
|
||||||
|
envFromSecrets: []
|
||||||
|
# - name: OG_OIDC_SECRET
|
||||||
|
# secretName: opengist-oidc-client-secret
|
||||||
|
# secretKey: client_secret
|
||||||
terminationGracePeriodSeconds: 60
|
terminationGracePeriodSeconds: 60
|
||||||
labels: {}
|
labels: {}
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user