feat: add istio support to mariadb-galera

This commit is contained in:
Stefan Reimer 2021-05-12 22:27:53 +02:00
parent d40dfea5f3
commit e4ab333320
3 changed files with 31 additions and 0 deletions

View File

@ -17,6 +17,9 @@ spec:
enabled: true enabled: true
serviceMonitor: serviceMonitor:
enabled: true enabled: true
istio:
enabled: true
url: mariadb.dev.mayneinc.com
destination: destination:
server: 'https://kubernetes.default.svc' server: 'https://kubernetes.default.svc'

View File

@ -0,0 +1,22 @@
{{- 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 }}

View File

@ -7,6 +7,7 @@ mariadb-galera:
rootUser: rootUser:
password: 12345qwert password: 12345qwert
db: db:
user: mariadb
password: 12345qwert password: 12345qwert
galera: galera:
mariabackup: mariabackup:
@ -19,3 +20,8 @@ mariadb-galera:
prometheusRules: prometheusRules:
enabled: false enabled: false
istio:
enabled: false
gateway: istio-system/private-ingressgateway
url: mariadb.example.com