[COMMON][MARIABD] MariaDB ServiceMesh compatibility
[oom.git] / kubernetes / common / mariadb-galera / templates / service.yaml
index 75aff98..880bc55 100644 (file)
 {{ include "common.service" . }}
 ---
 {{ include "common.headlessService" . }}
+{{- if (include "common.onServiceMesh" .) }}
+{{- if eq (default "istio" .Values.global.serviceMesh.engine) "istio" }}
+---
+apiVersion: security.istio.io/v1beta1
+kind: PeerAuthentication
+metadata:
+  name: {{ include "common.servicename" . }}
+  namespace: {{ include "common.namespace" . }}
+spec:
+  selector:
+    matchLabels:
+      app: {{ include "common.servicename" . }}
+  portLevelMtls:
+    {{ .Values.service.internalPort }}:
+      mode: DISABLE
+{{- end}}
+{{- end}}