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

Fixes to gateway template environment variables #16957

Merged
merged 2 commits into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{{- range $key, $spec := .Values }}
{{- if ne $key "enabled" }}
{{- if $spec.enabled }}

{{- $labels := dict "release" $.Release.Name "chart" (include "gateway.chart" $) "heritage" $.Release.Service }}
{{- $labels = merge $labels $spec.labels }}
Copy link
Member

@morvencao morvencao Sep 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an helm issue that complains the = here, which has been fixed from helm v2.13.0, see: helm/helm#4987
istio/istio is still using helm v2.10.0, isn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh thanks! thats why it worked locally then.

We advertise helm 2.10 support so probably need to find an even dirtier hack to accomplish this

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 +31,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 +229,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