-
Notifications
You must be signed in to change notification settings - Fork 569
Expand file tree
/
Copy pathistio-virtualservice.yaml
More file actions
71 lines (71 loc) · 2.01 KB
/
istio-virtualservice.yaml
File metadata and controls
71 lines (71 loc) · 2.01 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{{- with .Values.istio }}
{{- if and .enable .virtualService.enabled }}
{{ if semverCompare ">=1.22-0" $.Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.istio.io/v1
{{ else }}
apiVersion: networking.istio.io/v1beta1
{{- end }}
kind: VirtualService
metadata:
{{- if .virtualService.name }}
name: {{ .virtualService.name }}
{{- else }}
name: {{ template ".Chart.Name .fullname" $ }}-virtualservice
{{- end }}
{{- if .virtualService.namespace }}
namespace: {{ .virtualService.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 .virtualService.labels }}
{{ toYaml .virtualService.labels | indent 4 }}
{{- end }}
{{- if .virtualService.annotations }}
annotations:
{{ toYaml .virtualService.annotations | indent 4 }}
{{- end }}
spec:
{{- if or .gateway.enabled .virtualService.gateways }}
{{- if .virtualService.virtualServiceExtraSpec }}
{{ toYaml .virtualService.virtualServiceExtraSpec | indent 2}}
{{- else }}
gateways:
{{- if .gateway.enabled }}
- {{ template ".Chart.Name .fullname" $ }}-istio-gateway
{{- end }}
{{- range .virtualService.gateways }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- if or .gateway.enabled .virtualService.hosts }}
hosts:
{{- if .gateway.enabled }}
{{- if .gateway.host }}
- {{ .gateway.host | quote }}
{{- else if .gateway.hosts }}
{{- range .gateway.hosts }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- range .virtualService.hosts }}
- {{ . | quote }}
{{- end }}
{{- else }}
hosts:
- "{{ include ".servicename" $ }}.{{ $.Release.Namespace }}.svc.cluster.local"
{{- end }}
{{- if $.Values.istio.virtualService.http }}
http:
{{ toYaml $.Values.istio.virtualService.http | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}