-
Notifications
You must be signed in to change notification settings - Fork 569
Expand file tree
/
Copy pathistio-destinationrule.yaml
More file actions
45 lines (45 loc) · 1.42 KB
/
istio-destinationrule.yaml
File metadata and controls
45 lines (45 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{{- with .Values.istio }}
{{- if and .enable .destinationRule.enabled }}
{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.istio.io/v1
{{ else }}
apiVersion: networking.istio.io/v1beta1
{{- end }}
kind: DestinationRule
metadata:
{{- if .destinationRule.name }}
name: {{ .destinationRule.name }}
{{- else }}
name: {{ template ".Chart.Name .fullname" $ }}-destinationrule
{{- end }}
{{- if .destinationRule.namespace }}
namespace: {{ .destinationRule.namespace }}
{{- end }}
labels:
app: {{ template ".Chart.Name .name" $ }}
appId: {{ $.Values.app | quote }}
envId: {{ $.Values.env | quote }}
chart: {{ template ".Chart.Name .chart" $ }}
release: {{ $.Release.Name }}
{{- if $.Values.appLabels }}
{{ toYaml $.Values.appLabels | indent 4 }}
{{- end }}
{{- if .destinationRule.labels }}
{{ toYaml .destinationRule.labels | indent 4 }}
{{- end }}
{{- if .destinationRule.annotations }}
annotations:
{{ toYaml .destinationRule.annotations | indent 4 }}
{{- end }}
spec:
host: "{{ include ".servicename" $ }}.{{ $.Release.Namespace }}.svc.cluster.local"
{{- if $.Values.istio.destinationRule.subsets }}
subsets:
{{ toYaml $.Values.istio.destinationRule.subsets | indent 4 }}
{{- end }}
{{- if $.Values.istio.destinationRule.trafficPolicy }}
trafficPolicy:
{{ toYaml $.Values.istio.destinationRule.trafficPolicy | indent 4 }}
{{- end }}
{{- end }}
{{- end }}