KubeZero/charts/kubezero-sql/templates/mariadb/istio-service.yaml

23 lines
687 B
YAML

{{- if index .Values "mariadb-galera" "istio" "enabled" }}
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: mariadb
namespace: {{ .Release.Namespace }}
labels:
{{ include "kubezero-lib.labels" . | indent 4 }}
spec:
hosts:
- {{ index .Values "mariadb-galera" "istio" "url" }}
gateways:
- {{ index .Values "mariadb-galera" "istio" "gateway" }}
tcp:
- match:
- port: {{ default 3306 ( index .Values "mariadb-galera" "service" "port" ) }}
route:
- destination:
host: {{ .Release.Name }}-mariadb-galera-headless
port:
number: {{ default 3306 ( index .Values "mariadb-galera" "service" "port" ) }}
{{- end }}