diff --git a/incubator/mysqlha/Chart.yaml b/incubator/mysqlha/Chart.yaml index 67954c4580..788e72b41f 100644 --- a/incubator/mysqlha/Chart.yaml +++ b/incubator/mysqlha/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: mysqlha -version: 0.8.0 +version: 1.0.0 appVersion: 5.7.13 description: MySQL cluster with a single master and zero or more slave replicas keywords: @@ -12,7 +12,5 @@ icon: https://www.mysql.com/common/logos/logo-mysql-170x115.png maintainers: - name: jpoon email: helmchart-mysql@jasonpoon.ca - - name: jonhoare - email: jon.bitbucket@livewire-uk.co.uk - name: aisuko email: urakiny@gmail.com diff --git a/incubator/mysqlha/README.md b/incubator/mysqlha/README.md index d92471b330..f68065141a 100644 --- a/incubator/mysqlha/README.md +++ b/incubator/mysqlha/README.md @@ -38,6 +38,8 @@ The following table lists the configurable parameters of the MySQL chart and the | `mysqlImage` | `mysql` image and tag. | `mysql:5.7.13` | | `xtraBackupImage` | `xtrabackup` image and tag. | `gcr.io/google-samples/xtrabackup:1.0` | | `imagePullPolicy` | Image pull policy. | `IfNotPresent` | +| `nameOverride` | `String to partially override mysqlha.fullname template with a string (will prepend the release name)` | `nil` | +| `fullnameOverride` | `String to fully override mysqlha.fullname template with a string` | `nil` | | `replicaCount` | Number of MySQL replicas | 3 | | `mysqlRootPassword` | Password for the `root` user. | Randomly generated | | `mysqlUser` | Username of new user to create. | `nil` | diff --git a/incubator/mysqlha/templates/_helpers.tpl b/incubator/mysqlha/templates/_helpers.tpl index f7877c321f..ef8c807074 100644 --- a/incubator/mysqlha/templates/_helpers.tpl +++ b/incubator/mysqlha/templates/_helpers.tpl @@ -3,14 +3,29 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "mysqlha.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/incubator/mysqlha/templates/configmap.yaml b/incubator/mysqlha/templates/configmap.yaml index 376bfe5fea..13e2d4e19f 100644 --- a/incubator/mysqlha/templates/configmap.yaml +++ b/incubator/mysqlha/templates/configmap.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "fullname" . }} labels: app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: "{{ template "mysqlha.chart" . }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" data: diff --git a/incubator/mysqlha/templates/secret.yaml b/incubator/mysqlha/templates/secret.yaml index b55a96245c..8ee0a56900 100644 --- a/incubator/mysqlha/templates/secret.yaml +++ b/incubator/mysqlha/templates/secret.yaml @@ -4,25 +4,25 @@ metadata: name: {{ template "fullname" . }} labels: app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: "{{ template "mysqlha.chart" . }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" type: Opaque data: - {{ if .Values.mysqlha.mysqlRootPassword }} + {{- if .Values.mysqlha.mysqlRootPassword }} mysql-root-password: {{ .Values.mysqlha.mysqlRootPassword | b64enc | quote }} - {{ else }} + {{- else }} mysql-root-password: {{ randAlphaNum 12 | b64enc | quote }} - {{ end }} - {{ if .Values.mysqlha.mysqlUser }} - {{ if .Values.mysqlha.mysqlPassword }} + {{- end }} + {{- if .Values.mysqlha.mysqlUser }} + {{- if .Values.mysqlha.mysqlPassword }} mysql-password: {{ .Values.mysqlha.mysqlPassword | b64enc | quote }} - {{ else }} + {{- else }} mysql-password: {{ randAlphaNum 12 | b64enc | quote }} - {{ end }} - {{ end }} - {{ if .Values.mysqlha.mysqlReplicationPassword }} + {{- end }} + {{- end }} + {{- if .Values.mysqlha.mysqlReplicationPassword }} mysql-replication-password: {{ .Values.mysqlha.mysqlReplicationPassword | b64enc | quote }} - {{ else }} + {{- else }} mysql-replication-password: {{ randAlphaNum 12 | b64enc | quote }} - {{ end }} \ No newline at end of file + {{- end }} diff --git a/incubator/mysqlha/templates/statefulset.yaml b/incubator/mysqlha/templates/statefulset.yaml index 6044da5044..9701271271 100644 --- a/incubator/mysqlha/templates/statefulset.yaml +++ b/incubator/mysqlha/templates/statefulset.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "fullname" . }} labels: app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: "{{ template "mysqlha.chart" . }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: @@ -251,7 +251,7 @@ spec: port: metrics initialDelaySeconds: {{ .Values.metrics.livenessProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.metrics.livenessProbe.timeoutSeconds }} - readinessprobe: + readinessProbe: httpGet: path: / port: metrics diff --git a/incubator/mysqlha/templates/svc.yaml b/incubator/mysqlha/templates/svc.yaml index f0e24c7877..7fb942ec09 100644 --- a/incubator/mysqlha/templates/svc.yaml +++ b/incubator/mysqlha/templates/svc.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "fullname" . }} labels: app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: "{{ template "mysqlha.chart" . }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: @@ -24,7 +24,7 @@ metadata: name: {{ template "fullname" . }}-readonly labels: app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: "{{ template "mysqlha.chart" . }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: diff --git a/incubator/mysqlha/values.yaml b/incubator/mysqlha/values.yaml index 0c8e23b073..706e3a8e1f 100644 --- a/incubator/mysqlha/values.yaml +++ b/incubator/mysqlha/values.yaml @@ -10,6 +10,13 @@ xtraBackupImage: gcr.io/google-samples/xtrabackup:1.0 ## imagePullPolicy: IfNotPresent +## String to partially override orangehrm.fullname template (will maintain the release name) +## +# nameOverride: "" +## String to fully override orangehrm.fullname template +## +# fullnameOverride: "" + mysqlha: replicaCount: 3