[bitnami/mysql] feat: add headless services and fix a helper (#4554)

* [bitnami/mysql] feat: add headless services

Signed-off-by: darteaga <darteaga@vmware.com>

* fix(mysql): use of a wrong template name in mysql.initdbScriptsCM

* fix: missing space in template

Co-authored-by: Marcos Bjoerkelund <marcosbc@users.noreply.github.com>

Co-authored-by: Marcos Bjoerkelund <marcosbc@users.noreply.github.com>
This commit is contained in:
Daniel Arteaga
2020-12-09 15:50:33 +01:00
committed by GitHub
parent 5fcf3c0ddd
commit 2cf5a12ff7
4 changed files with 58 additions and 2 deletions

View File

@@ -25,4 +25,4 @@ name: mysql
sources:
- https://github.com/bitnami/bitnami-docker-mysql
- https://mysql.com
version: 8.1.2
version: 8.2.0

View File

@@ -48,7 +48,7 @@ Get the initialization scripts ConfigMap name.
{{- if .Values.initdbScriptsConfigMap -}}
{{- printf "%s" .Values.initdbScriptsConfigMap -}}
{{- else -}}
{{- printf "%s-init-scripts" (include "mysql.master.fullname" .) -}}
{{- printf "%s-init-scripts" (include "mysql.primary.fullname" .) -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,27 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "mysql.primary.fullname" . }}-headless
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: primary
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.primary.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.primary.service.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
publishNotReadyAddresses: true
ports:
- name: mysql
port: {{ .Values.primary.service.port }}
targetPort: mysql
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: primary

View File

@@ -0,0 +1,29 @@
{{- if eq .Values.architecture "replication" }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mysql.secondary.fullname" . }}-headless
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: secondary
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.secondary.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.secondary.service.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
publishNotReadyAddresses: true
ports:
- name: mysql
port: {{ .Values.secondary.service.port }}
targetPort: mysql
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: secondary
{{- end }}