[MARIADB] Set mTLS mode to STRICT to solve mysql connection issues
[oom.git] / kubernetes / common / mariadb-galera / templates / service.yaml
index 75aff98..2dea4e9 100644 (file)
 # limitations under the License.
 */}}
 
+{{- if not .Values.global.mariadbGalera.useOperator }}
 {{ include "common.service" . }}
 ---
 {{ include "common.headlessService" . }}
+{{- end }}
+{{- 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: STRICT
+{{-   end }}
+{{- end }}