diff --git a/charts/charts/templates/deployment.yaml b/charts/charts/templates/deployment.yaml index 09274f5..0c4f2e0 100644 --- a/charts/charts/templates/deployment.yaml +++ b/charts/charts/templates/deployment.yaml @@ -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: diff --git a/charts/charts/templates/ksvc.yaml b/charts/charts/templates/ksvc.yaml index 632938d..dde1db7 100644 --- a/charts/charts/templates/ksvc.yaml +++ b/charts/charts/templates/ksvc.yaml @@ -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: diff --git a/helm/charts/templates/deployment.yaml b/helm/charts/templates/deployment.yaml index 1c6669c..95d56f1 100644 --- a/helm/charts/templates/deployment.yaml +++ b/helm/charts/templates/deployment.yaml @@ -30,17 +30,20 @@ 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 }} @@ -48,7 +51,7 @@ spec: 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 }} diff --git a/helm/charts/templates/ksvc.yaml b/helm/charts/templates/ksvc.yaml index d37fb3f..83e2824 100644 --- a/helm/charts/templates/ksvc.yaml +++ b/helm/charts/templates/ksvc.yaml @@ -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: diff --git a/helm/charts/values.yaml b/helm/charts/values.yaml index 75a9f43..1153bdd 100644 --- a/helm/charts/values.yaml +++ b/helm/charts/values.yaml @@ -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: diff --git a/helm/preview/helmfile.yaml b/helm/preview/helmfile.yaml index 3a8edeb..a2bfab5 100644 --- a/helm/preview/helmfile.yaml +++ b/helm/preview/helmfile.yaml @@ -1,3 +1,7 @@ +environments: + default: + values: + - jx-values.yaml releases: - chart: '../{{ requiredEnv "APP_NAME" }}' name: preview @@ -5,8 +9,9 @@ releases: createNamespace: true namespace: '{{ requiredEnv "PREVIEW_NAMESPACE" }}' values: - - values.yaml.gotmpl - jx-values.yaml + - imagePullSecrets.yaml + - values.yaml.gotmpl hooks: - events: ["presync"] showlogs: true