Skip to content

Commit

Permalink
Merge pull request #235 from openziti/env_secrets_block
Browse files Browse the repository at this point in the history
Add support for injecting secrets as environment variables (ziti-controller chart)
  • Loading branch information
qrkourier authored Jul 23, 2024
2 parents 3fc1f5c + c512080 commit ffb69ea
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/ziti-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dependencies:
description: Host an OpenZiti controller in Kubernetes
name: ziti-controller
type: application
version: 1.0.11
version: 1.0.12
3 changes: 2 additions & 1 deletion charts/ziti-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ziti-controller

![Version: 1.0.11](https://img.shields.io/badge/Version-1.0.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.3](https://img.shields.io/badge/AppVersion-1.1.3-informational?style=flat-square)
![Version: 1.0.12](https://img.shields.io/badge/Version-1.0.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.3](https://img.shields.io/badge/AppVersion-1.1.3-informational?style=flat-square)

Host an OpenZiti controller in Kubernetes

Expand Down Expand Up @@ -235,6 +235,7 @@ For more information, please check [here](https://openziti.io/docs/learn/core-co
| edgeSignerPki.admin_client_cert.renewBefore | string | `"720h"` | renew admin client certificate before expiry as Go time.Duration |
| edgeSignerPki.enabled | bool | `true` | generate a separate PKI root of trust for the edge signer CA |
| env | string | `nil` | set name to value in containers' environment |
| envSecrets | string | `nil` | set secrets as environment variables in the container |
| fabric.events.enabled | bool | `false` | enable fabric event logger and file handler |
| fabric.events.fileName | string | `"fabric-events.json"` | |
| fabric.events.mountDir | string | `"/var/run/ziti"` | |
Expand Down
9 changes: 9 additions & 0 deletions charts/ziti-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,19 @@ spec:
secretKeyRef:
name: {{ include "ziti-controller.fullname" . }}-admin-secret
key: admin-password
# Add additional environment variables
{{- range $key, $val := .Values.env }}
- name: {{ $key | quote }}
value: {{ $val | quote }}
{{- end }}
# Add additional secrets as environment variables
{{- range .Values.envSecrets }}
- name: {{ .name | quote }}
valueFrom:
secretKeyRef:
name: {{ .valueFrom.secretKeyRef.name | quote }}
key: {{ .valueFrom.secretKeyRef.key | quote }}
{{- end }}
volumeMounts:
- mountPath: {{ include "dataMountDir" . }}
name: data
Expand Down
8 changes: 8 additions & 0 deletions charts/ziti-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ managementApi:
env:
# SOME_ENV: "true"

# -- set secrets as environment variables in the container
envSecrets:
# - name: SOME_SECRET_ENV
# valueFrom:
# secretKeyRef:
# name: some-secret
# key: some_secret_key

prometheus:
# -- cluster service target port on the container
containerPort: 9090
Expand Down

0 comments on commit ffb69ea

Please sign in to comment.