Skip to content

Commit

Permalink
feat: add envFrom support (#111)
Browse files Browse the repository at this point in the history
Signed-off-by: t3mi <t3mi@users.noreply.github.com>
  • Loading branch information
t3mi authored Nov 11, 2024
1 parent 5686d2f commit 3ddfc26
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/dgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `zero.antiAffinity` | Zero anti-affinity policy | `soft` |
| `zero.podAntiAffinitytopologyKey` | Anti affinity topology key for zero nodes | `kubernetes.io/hostname` |
| `zero.nodeAffinity` | Zero node affinity policy | `{}` |
| `zero.envFrom` | Extra environment variables loaded from configmap(s) and/or secret(s) | `[]` |
| `zero.extraEnvs` | extra env vars | `[]` |
| `zero.extraFlags` | Zero extra flags for command line | `""` |
| `zero.configFile` | Zero config file | `{}` |
Expand Down Expand Up @@ -127,6 +128,7 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `alpha.antiAffinity` | Alpha anti-affinity policy | `soft` |
| `alpha.podAntiAffinitytopologyKey` | Anti affinity topology key for zero nodes | `kubernetes.io/hostname` |
| `alpha.nodeAffinity` | Alpha node affinity policy | `{}` |
| `alpha.envFrom` | Extra environment variables loaded from configmap(s) and/or secret(s) | `[]` |
| `alpha.extraEnvs` | extra env vars | `[]` |
| `alpha.extraFlags` | Alpha extra flags for command | `""` |
| `alpha.configFile` | Alpha config file | `{}` |
Expand Down Expand Up @@ -177,6 +179,7 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `alpha.initContainers.init.image.tag` | Alpha initContainer image tag | `v21.03.0` |
| `alpha.initContainers.init.image.pullPolicy` | Alpha initContainer pull policy | `IfNotPresent` |
| `alpha.initContainers.init.env` | Adds environment variables for the alpha init container | `[]` |
| `alpha.initContainers.init.envFrom` | Extra environment variables loaded from configmap(s) and/or secret(s) | `[]` |
| `alpha.initContainers.init.command` | Alpha initContainer command line to execute | See `values.yaml` for defaults |
| `ratel.name` | Ratel component name | `ratel` |
| `ratel.enabled` | Ratel service enabled or disabled | `false` |
Expand All @@ -188,6 +191,7 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `ratel.image.pullPolicy` | Container pull policy | `IfNotPresent` |
| `ratel.schedulerName` | Configure an explicit scheduler | `nil` |
| `ratel.replicaCount` | Number of ratel nodes | `1` |
| `ratel.envFrom` | Extra environment variables loaded from configmap(s) and/or secret(s) | `[]` |
| `ratel.extraEnvs` | Extra env vars | `[]` |
| `ratel.args` | Ratel command line arguments | `[]` |
| `ratel.automountServiceAccountToken` | automatially mount a ServiceAccount API credentials | `true` |
Expand Down
8 changes: 8 additions & 0 deletions charts/dgraph/templates/alpha/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ spec:
env:
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
{{- with .Values.alpha.initContainers.init.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
command:
{{- range .Values.alpha.initContainers.init.command }}
- {{ . | quote }}
Expand Down Expand Up @@ -200,6 +204,10 @@ spec:
{{- with .Values.alpha.extraEnvs }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.alpha.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
{{/* NOTE: awk '{gsub(/\.$/,"") needed to trim */}}
command:
- bash
Expand Down
4 changes: 4 additions & 0 deletions charts/dgraph/templates/ratel/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- with .Values.ratel.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
args: {{ .Values.ratel.args | toYaml | nindent 10 }}
command:
- dgraph-ratel
Expand Down
4 changes: 4 additions & 0 deletions charts/dgraph/templates/zero/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ spec:
{{- with .Values.zero.extraEnvs }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.zero.envFrom }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
command:
- bash
- "-c"
Expand Down
10 changes: 10 additions & 0 deletions charts/dgraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ zero:
## https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature
nodeAffinity: {}

## Extra environment variables loaded from configmap(s) and/or secret(s)
envFrom: []

## Extra environment variables which will be appended to the env: definition for the container.
extraEnvs: []

Expand Down Expand Up @@ -276,6 +279,9 @@ alpha:
## https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature
nodeAffinity: {}

## Extra environment variables loaded from configmap(s) and/or secret(s)
envFrom: []

## Extra environment variables which will be appended to the env: definition for the container.
extraEnvs: []
# - name: AWS_ACCESS_KEY_ID
Expand Down Expand Up @@ -462,6 +468,7 @@ alpha:
enabled: false
# Adds environment variables for the alpha init container
env: []
envFrom: []
image:
<< : *image
command:
Expand Down Expand Up @@ -499,6 +506,9 @@ ratel:
##
replicaCount: 1

## Extra environment variables loaded from configmap(s) and/or secret(s)
envFrom: []

# Extra environment variables which will be appended to the env: definition for the container.
extraEnvs: []

Expand Down

0 comments on commit 3ddfc26

Please sign in to comment.