{{- if .Values.fluentd.istio.enabled }}
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: {{ template "kubezero-lib.fullname" $ }}-fluentd
  namespace: {{ .Release.Namespace }}
  labels:
{{ include "kubezero-lib.labels" . | indent 4 }}
spec:
  gateways:
  - {{ .Values.fluentd.istio.gateway }}
  hosts:
  - {{ .Values.fluentd.url }}
  tcp:
  - match:
    - port: 24224
    route:
    - destination:
        host: {{ template "kubezero-lib.fullname" $ }}-fluentd
        port:
          number: 24224
  http:
  - route:
    - destination:
        host: {{ template "kubezero-lib.fullname" $ }}-fluentd
        port:
          number: 9880
{{- end }}
