{{- if .Values.istio.enabled -}}
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  annotations:
  labels:
  name: blog-virtual-service
spec:
  gateways:
  - istio-system/badhouseplants-net
  hosts: {{ .Values.istio.hosts }}
  http:
  - match:
    - uri:
        prefix:  {{ .Values.istio.prefix }}
    route:
    - destination:
        host: {{ include "badhouseplants-net.fullname" . }}
        port:
          number: {{ .Values.service.port }}
{{- end }}
