41755af6 by Adam Heath

Add istio VirtualService support to registry.

1 parent 8201f94b
...@@ -11,6 +11,14 @@ environments: ...@@ -11,6 +11,14 @@ environments:
11 service: 11 service:
12 registry: 12 registry:
13 nodePort: 32123 13 nodePort: 32123
14 istioVirtualService:
15 enabled: true
16 jsonPatches: []
17 strategicMergePatches: []
18 gateways:
19 - default/cluster-local-gateway
20 vhosts:
21 - registry.local
14 images: 22 images:
15 debian: "debian:bullseye-20211220" 23 debian: "debian:bullseye-20211220"
16 registry: "registry:2" 24 registry: "registry:2"
...@@ -25,7 +33,6 @@ helmfiles: ...@@ -25,7 +33,6 @@ helmfiles:
25 redis: {{ .Values.images.redis }} 33 redis: {{ .Values.images.redis }}
26 34
27 releases: 35 releases:
28
29 - name: {{ .Values.namePrefix }}registry 36 - name: {{ .Values.namePrefix }}registry
30 namespace: {{ .Values.namespace }} 37 namespace: {{ .Values.namespace }}
31 chart: . 38 chart: .
...@@ -44,10 +51,40 @@ releases: ...@@ -44,10 +51,40 @@ releases:
44 - op: replace 51 - op: replace
45 path: /spec/ports/0/nodePort 52 path: /spec/ports/0/nodePort
46 value: {{ .Values.registry.service.registry.nodePort }} 53 value: {{ .Values.registry.service.registry.nodePort }}
54 {{- if .Values.istioVirtualService.enabled }}
55 - target:
56 kind: VirtualService
57 name: {{ .Values.namePrefix }}registry
58 namespace: {{ .Values.namespace }}
59 version: v1beta1
60 group: networking.istio.io
61 patch:
62 - op: replace
63 path: /spec/http/0/route/0/destination/host
64 value: {{ .Values.namePrefix }}registry
65 {{- end }}
47 {{- if not (empty (.Values.registry.jsonPatches)) }} 66 {{- if not (empty (.Values.registry.jsonPatches)) }}
48 {{- .Values.registry.jsonPatches | toYaml | indent 6 }} 67 {{- .Values.registry.jsonPatches | toYaml | indent 6 }}
49 {{- end }} 68 {{- end }}
50 strategicMergePatches: 69 strategicMergePatches:
70 - apiVersion: networking.istio.io/v1beta1
71 kind: VirtualService
72 metadata:
73 name: {{ .Values.namePrefix }}registry
74 namespace: {{ .Values.namespace }}
75 {{- if .Values.istioVirtualService.enabled }}
76 spec:
77 hosts:
78 {{- range $vhost_index, $vhost := .Values.istioVirtualService.vhosts }}
79 - {{ $vhost | quote }}
80 {{- end }}
81 gateways:
82 {{- range $gateway_index, $gateway := .Values.istioVirtualService.gateways }}
83 - {{ $gateway | quote }}
84 {{- end }}
85 {{- else }}
86 $patch: delete
87 {{- end }}
51 - apiVersion: apps/v1 88 - apiVersion: apps/v1
52 kind: Deployment 89 kind: Deployment
53 metadata: 90 metadata:
......
1 --- 1 ---
2 apiVersion: networking.istio.io/v1beta1
3 kind: VirtualService
4 metadata:
5 name: registry
6 spec:
7 hosts:
8 - "registry.local"
9 gateways:
10 - default/cluster-local-gateway
11 http:
12 - route:
13 - destination:
14 port:
15 number: 5000
16 host: registry
17 ---
2 apiVersion: v1 18 apiVersion: v1
3 kind: Service 19 kind: Service
4 metadata: 20 metadata:
......