Skip to content

Commit

Permalink
Merge pull request #15 from rsvalerio/add_raw_envvars
Browse files Browse the repository at this point in the history
Add support to define env vars in raw yaml notation
  • Loading branch information
lkysow authored Jan 13, 2021
2 parents 3cb9877 + 07fb4e7 commit 62da7f3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
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.8
version: 3.12.9
keywords:
- terraform
home: https://www.runatlantis.io
Expand Down
3 changes: 2 additions & 1 deletion charts/atlantis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ The following options are supported. See [values.yaml](values.yaml) for more de
| `bitbucket.secret` | Webhook secret for Bitbucket repositories (Bitbucket Server only). | n/a |
| `bitbucket.baseURL` | Base URL of Bitbucket Server installation. | n/a |
| `environment` | Map of environment variables for the container. | `{}` |
| `environmentSecrets` | Array of Kubernetes secrets that can be used to set environment variables. See `values.yaml` for example. | `{}` |
| `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. | `[]` |
| `extraVolumes` | List of additional volumes available to the pod. | `[]` |
| `extraVolumeMounts` | List of additional volumes mounted to the container. | `[]` |
Expand Down
5 changes: 5 additions & 0 deletions charts/atlantis/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ spec:
{{- end }}
{{- end }}
env:
{{- if .Values.environmentRaw }}
{{- with .Values.environmentRaw }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- range $key, $value := .Values.environment }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand Down
9 changes: 9 additions & 0 deletions charts/atlantis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ environmentSecrets: []
# name: the_k8s_secret_name
# key: the_key_of_the_value_in_the_secret

# Optionally specify additional environment variables in raw yaml format
# Useful to specify variables refering to k8s objects
# environmentRaw:
# - name: POD_IP
# valueFrom:
# fieldRef:
# fieldPath: status.podIP
environmentRaw: []

# Optionally specify additional Kubernetes secrets to load environment variables from.
# All key-value pairs within these secrets 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.
Expand Down

0 comments on commit 62da7f3

Please sign in to comment.