Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use toYaml instead of 'range' for environment variables, and ali… #14

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions charts/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ spec:
env:
- name: VERSION
value: {{ .Chart.Version }}
{{- range $pkey, $pval := .Values.env }}
- name: {{ $pkey }}
value: {{ quote $pval }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 10 }}
{{- end }}
{{- if .Values.envFrom }}
envFrom:
{{ toYaml .Values.envFrom | indent 10 }}
{{- end }}
ports:
- containerPort: {{ .Values.service.internalPort }}
livenessProbe:
Expand Down
9 changes: 6 additions & 3 deletions charts/charts/templates/ksvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ spec:
env:
- name: VERSION
value: {{ .Chart.Version }}
{{- range $pkey, $pval := .Values.env }}
- name: {{ $pkey }}
value: {{ quote $pval }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 12 }}
{{- end }}
{{- if .Values.envFrom }}
envFrom:
{{ toYaml .Values.envFrom | indent 12 }}
{{- end }}
livenessProbe:
httpGet:
Expand Down
15 changes: 9 additions & 6 deletions helm/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,28 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range $pkey, $pval := .Values.env }}
- name: {{ $pkey }}
value: {{ quote $pval }}
- name: VERSION
value: {{ .Chart.Version }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}
{{- if .Values.envFrom }}
envFrom:
{{ toYaml .Values.envFrom | indent 10 }}
{{ toYaml .Values.envFrom | indent 8 }}
{{- end }}
ports:
- containerPort: {{ .Values.service.internalPort }}
livenessProbe:
httpGet:
path: {{ .Values.probePath }}
path: {{ .Values.livenessProbe.probePath | default .Values.probePath }}
port: {{ .Values.service.internalPort }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
readinessProbe:
httpGet:
path: {{ .Values.probePath }}
path: {{ .Values.readinessProbe.probePath | default .Values.probePath }}
port: {{ .Values.service.internalPort }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
Expand Down
11 changes: 8 additions & 3 deletions helm/charts/templates/ksvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range $pkey, $pval := .Values.env }}
- name: {{ $pkey }}
value: {{ quote $pval }}
- name: VERSION
value: {{ .Chart.Version }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 12 }}
{{- end }}
{{- if .Values.envFrom }}
envFrom:
{{ toYaml .Values.envFrom | indent 12 }}
{{- end }}
livenessProbe:
httpGet:
Expand Down
5 changes: 4 additions & 1 deletion helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ livenessProbe:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
# Optional distinct liveness probe path, if empty the probePath is used
probePath: ""
readinessProbe:
failureThreshold: 1
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1

# Optional distinct liveness probe path, if empty the probePath is used
probePath: ""

# custom ingress annotations on this service
ingress:
Expand Down
7 changes: 6 additions & 1 deletion helm/preview/helmfile.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
environments:
default:
values:
- jx-values.yaml
releases:
- chart: '../{{ requiredEnv "APP_NAME" }}'
name: preview
wait: true
createNamespace: true
namespace: '{{ requiredEnv "PREVIEW_NAMESPACE" }}'
values:
- values.yaml.gotmpl
- jx-values.yaml
- imagePullSecrets.yaml
- values.yaml.gotmpl
hooks:
- events: ["presync"]
showlogs: true
Expand Down