Skip to content

Commit

Permalink
Merge pull request #29 from philipclaesson/secrets
Browse files Browse the repository at this point in the history
Environment variables from Kubernetes Secrets
  • Loading branch information
RazcoDev authored Mar 16, 2023
2 parents 7e9d427 + a69052f commit c262efa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions templates/deployment-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.client.secrets }}
envFrom:
{{- range $name := .Values.client.secrets }}
- secretRef:
name: {{ $name }}
{{- end }}
{{- end }}
{{- if .Values.client.opaStartupData }}
volumeMounts:
- mountPath: /opt/opa/startup-data
Expand Down
7 changes: 7 additions & 0 deletions templates/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.server.secrets }}
envFrom:
{{- range $name := .Values.server.secrets }}
- secretRef:
name: {{ $name }}
{{- end }}
{{- end }}
readinessProbe:
httpGet:
path: /healthcheck
Expand Down
13 changes: 12 additions & 1 deletion values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@
},
"extraEnv": {
"type": "object", "title": "extra environment variables list", "default": null
},
"secrets": {
"type": "array",
"title": "name of a kubernetes secret from where to fetch secret environment variables.",
"default": null,
"items": { "type": "string" }
}

}
},
"client": {
Expand All @@ -91,6 +96,12 @@
},
"opaStartupData": {
"type": "object", "title": "client startup data for embedded opa", "default": null
},
"secrets": {
"type": "array",
"title": "name of a kubernetes secret from where to fetch secret environment variables.",
"default": null,
"items": { "type": "string" }
}
}
}
Expand Down

0 comments on commit c262efa

Please sign in to comment.