MySQL: Add non-root support and fix replication bug

This commit is contained in:
Javier J. Salmeron Garcia
2018-07-25 13:49:54 +02:00
parent 5a6cfae40c
commit dabe6897ea
5 changed files with 29 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
name: mysql
version: 1.1.3
version: 2.0.0
appVersion: 5.7.22-debian-9
description: Chart to create a Highly available MySQL cluster
keywords:

View File

@@ -20,6 +20,11 @@ spec:
component: "master"
release: "{{ .Release.Name }}"
spec:
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
{{- if eq .Values.master.antiAffinity "hard" }}
affinity:
podAntiAffinity:

View File

@@ -21,6 +21,11 @@ spec:
component: "slave"
release: "{{ .Release.Name }}"
spec:
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
{{- if eq .Values.slave.antiAffinity "hard" }}
affinity:
podAntiAffinity:
@@ -77,7 +82,7 @@ spec:
value: "3306"
- name: MYSQL_MASTER_USER
value: "root"
- name: MYSQL_MASTER_PASSWORD
- name: MYSQL_MASTER_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}

View File

@@ -3,7 +3,7 @@
##
image:
registry: docker.io
repository: bitnami/mariadb
repository: bitnami/mysql
tag: 5.7.22-debian-9
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
@@ -22,6 +22,14 @@ service:
type: ClusterIP
port: 3306
## Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
##
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
root:
## MySQL admin password
## ref: https://github.com/bitnami/bitnami-docker-mysql#setting-the-root-password-on-first-run

View File

@@ -23,6 +23,14 @@ service:
type: ClusterIP
port: 3306
## Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
##
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
root:
## MySQL admin password
## ref: https://github.com/bitnami/bitnami-docker-mysql#setting-the-root-password-on-first-run