Skip to content

Commit

Permalink
Merge pull request #18 from czerasz/feature/load-env-from-config-maps
Browse files Browse the repository at this point in the history
Feature: Add support for loadEnvFromConfigMaps
  • Loading branch information
lkysow authored Jan 18, 2021
2 parents 8491e23 + 3a2e77b commit 23e92c5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The following options are supported. See [values.yaml](values.yaml) for more de
| `environmentSecrets` | Array of Kubernetes secrets that can be used to set environment variables. See `values.yaml` for example. | `{}` |
| `environmentRaw` | Array environment variables in plain Kubernetes yaml format. See `values.yaml` for example. | `[]` |
| `loadEnvFromSecrets` | Array of Kubernetes secrets to set all key-value pairs as environment variables. See `values.yaml` for example. | `[]` |
| `loadEnvFromConfigMaps` | Array of Kubernetes `ConfigMap`s to set all key-value pairs as environment variables. See `values.yaml` for example. | `[]` |
| `extraVolumes` | List of additional volumes available to the pod. | `[]` |
| `extraVolumeMounts` | List of additional volumes mounted to the container. | `[]` |
| `imagePullSecrets` | List of secrets for pulling images from private registries. | `[]` |
Expand Down
2 changes: 1 addition & 1 deletion charts/atlantis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: v0.16.0
description: A Helm chart for Atlantis https://www.runatlantis.io
name: atlantis
version: 3.12.9
version: 3.12.10
keywords:
- terraform
home: https://www.runatlantis.io
Expand Down
6 changes: 5 additions & 1 deletion charts/atlantis/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ spec:
ports:
- name: atlantis
containerPort: 4141
{{- if .Values.loadEnvFromSecrets }}
{{- if or .Values.loadEnvFromSecrets .Values.loadEnvFromConfigMaps }}
envFrom:
{{- range .Values.loadEnvFromSecrets }}
- secretRef:
name: {{ . }}
{{- end }}
{{- range .Values.loadEnvFromConfigMaps }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- end }}
env:
{{- if .Values.environmentRaw }}
Expand Down
9 changes: 9 additions & 0 deletions charts/atlantis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ loadEnvFromSecrets: []
# - secret_one
# - secret_two

# Optionally specify additional Kubernetes ConfigMaps to load environment variables from.
# All key-value pairs within these ConfigMaps will be set as environment variables.
# Note that any variables set here will be ignored if also defined in the env block of the atlantis statefulset.
# For example, providing ATLANTIS_ALLOW_FORK_PRS here and defining a value for allowForkPRs will result in the allowForkPRs value being used.
loadEnvFromConfigMaps: []
# loadEnvFromConfigMaps:
# - config_one
# - config_two

# Optionally specify google service account credentials as Kubernetes secrets. If you are using the terraform google provider you can specify the credentials as "${file("/var/secrets/some-secret-name/key.json")}".
googleServiceAccountSecrets: []
# googleServiceAccountSecrets:
Expand Down

0 comments on commit 23e92c5

Please sign in to comment.