{{- if .Values.global.meshExpansion }}

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: meshexpansion-citadel
spec:
  hosts:
  - "istio-citadel.istio-system"
  gateways:
  - meshexpansion-gateway
  tcp:
  - match:
    - port: 8060
    route:
    - destination:
        host: istio-citadel.istio-system.svc.cluster.local
        port:
          number: 8060

{{- end }}

---

{{- if .Values.global.meshExpansionILB }}

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: meshexpansion-ilb-citadel
spec:
  hosts:
  - "istio-citadel.istio-system"
  gateways:
  - meshexpansion-ilb-gateway
  tcp:
  - match:
    - port: 8060
    route:
    - destination:
        host: istio-citadel.istio-system.svc.cluster.local
        port:
          number: 8060

{{- end }}
