41755af6 by Adam Heath

Add istio VirtualService support to registry.

1 parent 8201f94b
......@@ -11,6 +11,14 @@ environments:
service:
registry:
nodePort: 32123
istioVirtualService:
enabled: true
jsonPatches: []
strategicMergePatches: []
gateways:
- default/cluster-local-gateway
vhosts:
- registry.local
images:
debian: "debian:bullseye-20211220"
registry: "registry:2"
......@@ -25,7 +33,6 @@ helmfiles:
redis: {{ .Values.images.redis }}
releases:
- name: {{ .Values.namePrefix }}registry
namespace: {{ .Values.namespace }}
chart: .
......@@ -44,10 +51,40 @@ releases:
- op: replace
path: /spec/ports/0/nodePort
value: {{ .Values.registry.service.registry.nodePort }}
{{- if .Values.istioVirtualService.enabled }}
- target:
kind: VirtualService
name: {{ .Values.namePrefix }}registry
namespace: {{ .Values.namespace }}
version: v1beta1
group: networking.istio.io
patch:
- op: replace
path: /spec/http/0/route/0/destination/host
value: {{ .Values.namePrefix }}registry
{{- end }}
{{- if not (empty (.Values.registry.jsonPatches)) }}
{{- .Values.registry.jsonPatches | toYaml | indent 6 }}
{{- end }}
strategicMergePatches:
- apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: {{ .Values.namePrefix }}registry
namespace: {{ .Values.namespace }}
{{- if .Values.istioVirtualService.enabled }}
spec:
hosts:
{{- range $vhost_index, $vhost := .Values.istioVirtualService.vhosts }}
- {{ $vhost | quote }}
{{- end }}
gateways:
{{- range $gateway_index, $gateway := .Values.istioVirtualService.gateways }}
- {{ $gateway | quote }}
{{- end }}
{{- else }}
$patch: delete
{{- end }}
- apiVersion: apps/v1
kind: Deployment
metadata:
......
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: registry
spec:
hosts:
- "registry.local"
gateways:
- default/cluster-local-gateway
http:
- route:
- destination:
port:
number: 5000
host: registry
---
apiVersion: v1
kind: Service
metadata:
......