Skip to content

Commit

Permalink
deployment: Mount env-file only if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisommore committed Nov 3, 2022
1 parent 4f2e474 commit e68ccf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/deployment/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.5
version: 0.1.6

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
11 changes: 7 additions & 4 deletions charts/deployment/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ spec:
cpu: "100m"
ports:
- containerPort: {{.Values.port }}
env:
- name: "APP_PORT"
value: "{{.Values.port }}"
{{ if .Values.env_secret_name }}
volumeMounts:
- mountPath: "/app/.env"
subPath: ".env"
name: env-file
readOnly: true
env:
- name: "APP_PORT"
value: "{{.Values.port }}"

volumes:
- name: env-file
secret:
secretName: {{.Values.env_secret_name}}
secretName: {{.Values.env_secret_name}}
{{ end }}

0 comments on commit e68ccf3

Please sign in to comment.