Skip to content

Commit

Permalink
Fixes to gateway template environment variables (#16957)
Browse files Browse the repository at this point in the history
* Fixes to gateway template environment variables

* Fix older helm versions
  • Loading branch information
howardjohn authored and istio-testing committed Sep 11, 2019
1 parent 1a2afae commit 081cfc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{{- range $key, $spec := .Values }}
{{- if ne $key "enabled" }}
{{- if $spec.enabled }}

{{- $labels := merge (dict "release" $.Release.Name "chart" (include "gateway.chart" $) "heritage" $.Release.Service) $spec.labels }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $key }}
namespace: {{ $spec.namespace | default $.Release.Namespace }}
labels:
chart: {{ template "gateway.chart" $ }}
heritage: {{ $.Release.Service }}
release: {{ $.Release.Name }}
{{- range $key, $val := $spec.labels }}
{{ $key }}: {{ $val }}
{{- end }}
{{ $labels | toYaml | indent 4 }}
spec:
{{- if not $spec.autoscaleEnabled }}
{{- if $spec.replicaCount }}
Expand All @@ -33,12 +30,7 @@ spec:
template:
metadata:
labels:
chart: {{ template "gateway.chart" $ }}
heritage: {{ $.Release.Service }}
release: {{ $.Release.Name }}
{{- range $key, $val := $spec.labels }}
{{ $key }}: {{ $val }}
{{- end }}
{{ $labels | toYaml | indent 8 }}
annotations:
sidecar.istio.io/inject: "false"
{{- if $spec.podAnnotations }}
Expand Down Expand Up @@ -236,6 +228,11 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: ISTIO_METAJSON_LABELS
value: |
{{ $labels | toJson}}
- name: ISTIO_META_CLUSTER_ID
value: "{{ $.Values.global.multiCluster.clusterName | default `Kubernetes` }}"
- name: SDS_ENABLED
value: "{{ $.Values.global.sds.enabled }}"
- name: ISTIO_META_WORKLOAD_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ containers:
{{- end}}
]
- name: ISTIO_META_CLUSTER_ID
value: "{{ valueOrDefault .Values.global.multicluster.clusterName `Kubernetes` }}"
value: "{{ valueOrDefault .Values.global.multiCluster.clusterName `Kubernetes` }}"
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down

0 comments on commit 081cfc1

Please sign in to comment.