Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit 14900e5

Browse files
feat(chart): add envVarsFromConfigMap and envFrom support for more options to configure the Helm deployment (#706)
* [helm-chart] More options to configure the Helm deployment * Update charts/kubernetes-external-secrets/Chart.yaml Co-authored-by: Markus Maga <[email protected]> Co-authored-by: Markus Maga <[email protected]>
1 parent f06acec commit 14900e5

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

charts/kubernetes-external-secrets/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ The following table lists the configurable parameters of the `kubernetes-externa
6363
| `envVarsFromSecret.ALICLOUD_ENDPOINT` | Set ALICLOUD_ENDPOINT for KMS Service in Deployment Pod | |
6464
| `envVarsFromSecret.ALICLOUD_ACCESS_KEY_ID` | Set ALICLOUD_ACCESS_KEY_ID (from a secret) in Deployment Pod | |
6565
| `envVarsFromSecret.ALICLOUD_ACCESS_KEY_SECRET` | Set ALICLOUD_ACCESS_KEY_SECRET (from a secret) in Deployment Pod | |
66+
| `envVarsFromConfigMap.*` | Set any of the environment variables as `envVarsFromSecret` does but from a `configMap` in Deployment Pod | |
67+
| `envFrom` | Enables the [`envFrom` block](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables) on the Deployment pod | |
6668
| `image.repository` | kubernetes-external-secrets Image name | `godaddy/kubernetes-external-secrets` |
6769
| `image.tag` | kubernetes-external-secrets Image tag | `7.1.0` |
6870
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |

charts/kubernetes-external-secrets/templates/deployment.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ spec:
5959
name: {{ $value.secretKeyRef | quote }}
6060
key: {{ $value.key | quote }}
6161
{{- end }}
62+
{{- range $key, $value := .Values.envVarsFromConfigMap }}
63+
- name: {{ $key }}
64+
valueFrom:
65+
configMapKeyRef:
66+
name: {{ $value.configMapKeyRef | quote }}
67+
key: {{ $value.key | quote }}
68+
{{- end }}
69+
{{- if .Values.envFrom }}
70+
envFrom:
71+
{{- .Values.envFrom | toYaml | nindent 12 }}
72+
{{- end }}
6273
{{- if or .Values.filesFromSecret .Values.extraVolumeMounts }}
6374
volumeMounts:
6475
{{- if .Values.extraVolumeMounts }}

charts/kubernetes-external-secrets/values.yaml

+44-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
env:
77
AWS_REGION: us-west-2
88
AWS_DEFAULT_REGION: us-west-2
9-
POLLER_INTERVAL_MILLISECONDS: 10000 # Caution, setting this frequency may incur additional charges on some platforms
9+
POLLER_INTERVAL_MILLISECONDS: 10000 # Caution, setting this frequency may incur additional charges on some platforms
1010
WATCH_TIMEOUT: 60000
11-
WATCHED_NAMESPACES: "" # Comma separated list of namespaces, empty or unset means ALL namespaces.
11+
WATCHED_NAMESPACES: "" # Comma separated list of namespaces, empty or unset means ALL namespaces.
1212
LOG_LEVEL: info
1313
LOG_MESSAGE_KEY: "msg"
1414
# Print logs level as string ("info") rather than integer (30)
@@ -24,7 +24,7 @@ env:
2424
# AWS_SM_ENDPOINT: http://secretsmanager-fips.us-east-1.amazonaws.com
2525

2626
# Create environment variables from existing k8s secrets
27-
# envVarsFromSecret:
27+
envVarsFromSecret: {}
2828
# AWS_ACCESS_KEY_ID:
2929
# secretKeyRef: aws-credentials
3030
# key: id
@@ -50,6 +50,47 @@ env:
5050
# secretKeyRef: azure-credentials
5151
# key: clientsecret
5252

53+
# Create environment variables from existing k8s secrets
54+
envVarsFromConfigMap: {}
55+
# AWS_ACCESS_KEY_ID:
56+
# configMapKeyRef: aws-credentials
57+
# key: id
58+
# AWS_SECRET_ACCESS_KEY:
59+
# configMapKeyRef: aws-credentials
60+
# key: key
61+
# ALICLOUD_ENDPOINT:
62+
# configMapKeyRef: alicloud-credentials
63+
# key: endpoint
64+
# ALICLOUD_ACCESS_KEY_ID:
65+
# configMapKeyRef: alicloud-credentials
66+
# key: id
67+
# ALICLOUD_ACCESS_KEY_SECRET:
68+
# configMapKeyRef: alicloud-credentials
69+
# key: secret
70+
# AZURE_TENANT_ID:
71+
# configMapKeyRef: azure-credentials
72+
# key: tenantid
73+
# AZURE_CLIENT_ID:
74+
# configMapKeyRef: azure-credentials
75+
# key: clientid
76+
# AZURE_CLIENT_SECRET:
77+
# configMapKeyRef: azure-credentials
78+
# key: clientsecret
79+
80+
81+
# List of sources to populate environment variables in the container.
82+
# The keys defined within a source must be a C_IDENTIFIER. All invalid keys
83+
# will be reported as an event when the container is starting. When a key
84+
# exists in multiple sources, the value associated with the last source will
85+
# take precedence. Values defined by an Env with a duplicate key will take precedence.
86+
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables
87+
envFrom: {}
88+
# - configMapRef:
89+
# name: special-config
90+
# - secretRef:
91+
# name: special-config
92+
93+
5394
# Create files from existing k8s secrets
5495
# filesFromSecret:
5596
# gcp-creds:

0 commit comments

Comments
 (0)