{{- if .Values.istio.enabled }}
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: redis
  namespace: {{ .Release.Namespace }}
  labels:
{{ include "kubezero-lib.labels" . | indent 4 }}
spec:
  hosts:
  - {{ .Values.istio.url }}
  gateways:
  - {{ .Values.istio.gateway }}
  tcp:
  - match:
    - port: {{ default 6379 .Values.istio.port }}
    route:
    - destination:
        host: redis-cluster-headless
        port:
          number: 6379
{{- end }}
