Skip to content

Commit

Permalink
Merge pull request #424 from hellofresh/patch/update-deployment
Browse files Browse the repository at this point in the history
allow option to add valuesFrom env vars
  • Loading branch information
Ashley Schuett authored Dec 13, 2019
2 parents 680e0cb + f394527 commit 82e0213
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions janus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The following table lists the configurable parameters of the Janus chart and the
| `allowEmptyPassword` | Allow DB blank passwords | `yes` |
| `deployment.replicaCount` | Number of Janus pod replicas | `2` |
| `deployment.minAvailable` | Creates PDB is min available (must be less than replicaCount) | `1` |
| `deployment.valuesFrom` | Add needed env vars from Kubernetes metadata | `POD_NAME` |
| `deployment.databaseDSN` | Database connection string | `mongodb://janus-database:27017/janus` |
| `service.type` | Kubernetes Service type | `LoadBalancer` |
| `service.name` | Override service name | `` |
Expand Down
3 changes: 3 additions & 0 deletions janus/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
name: http-private
protocol: TCP
env:
{{- if .Values.deployment.valuesFrom }}
{{ toYaml .Values.deployment.valuesFrom | nindent 12 }}
{{- end}}
{{- if .Values.envConfig }}
{{- range $key, $value := .Values.envConfig }}
- name: {{ $key | quote }}
Expand Down
5 changes: 5 additions & 0 deletions janus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ deployment:
replicaCount: 2
minAvailable: 1
databaseDSN: "mongodb://janus-database:27017/janus"
valuesFrom:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name

imagePullSecrets: []

Expand Down

0 comments on commit 82e0213

Please sign in to comment.