diff --git a/stable/mariadb/Chart.yaml b/stable/mariadb/Chart.yaml index 623bc0c0e2..f105c37376 100644 --- a/stable/mariadb/Chart.yaml +++ b/stable/mariadb/Chart.yaml @@ -1,5 +1,5 @@ name: mariadb -version: 5.4.3 +version: 5.5.0 appVersion: 10.1.37 description: Fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. Highly available MariaDB cluster. keywords: diff --git a/stable/mariadb/README.md b/stable/mariadb/README.md index db1cff7c9b..16bf9a0d28 100644 --- a/stable/mariadb/README.md +++ b/stable/mariadb/README.md @@ -59,6 +59,8 @@ The following table lists the configurable parameters of the MariaDB chart and t | `service.type` | Kubernetes service type | `ClusterIP` | | `service.clusterIp` | Specific cluster IP when service type is cluster IP. Use None for headless service | `nil` | | `service.port` | MySQL service port | `3306` | +| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `false` | +| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the mariadb.fullname template | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `1001` | | `securityContext.runAsUser` | User ID for the container | `1001` | diff --git a/stable/mariadb/templates/_helpers.tpl b/stable/mariadb/templates/_helpers.tpl index 2512871a8f..99ff7806d8 100644 --- a/stable/mariadb/templates/_helpers.tpl +++ b/stable/mariadb/templates/_helpers.tpl @@ -84,3 +84,14 @@ Get the initialization scripts ConfigMap name. {{- printf "%s-init-scripts" (include "mariadb.fullname" .) -}} {{- end -}} {{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "mariadb.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "mariadb.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/stable/mariadb/templates/master-statefulset.yaml b/stable/mariadb/templates/master-statefulset.yaml index 34a2f2c389..c077a3b608 100644 --- a/stable/mariadb/templates/master-statefulset.yaml +++ b/stable/mariadb/templates/master-statefulset.yaml @@ -32,6 +32,7 @@ spec: release: "{{ .Release.Name }}" chart: {{ template "mariadb.chart" . }} spec: + serviceAccountName: "{{ template "mariadb.serviceAccountName" . }}" {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} diff --git a/stable/mariadb/templates/slave-statefulset.yaml b/stable/mariadb/templates/slave-statefulset.yaml index df9749faa1..f2cab6162e 100644 --- a/stable/mariadb/templates/slave-statefulset.yaml +++ b/stable/mariadb/templates/slave-statefulset.yaml @@ -33,6 +33,7 @@ spec: release: "{{ .Release.Name }}" chart: {{ template "mariadb.chart" . }} spec: + serviceAccountName: "{{ template "mariadb.serviceAccountName" . }}" {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} diff --git a/stable/mariadb/values-production.yaml b/stable/mariadb/values-production.yaml index e129c1c545..f8e3b0dae3 100644 --- a/stable/mariadb/values-production.yaml +++ b/stable/mariadb/values-production.yaml @@ -40,6 +40,16 @@ service: # master: 30001 # slave: 30002 +## Pods Service Account +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ +serviceAccount: + ## Specifies whether a ServiceAccount should be created + ## + create: false + ## The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the mariadb.fullname template + # name: + ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## diff --git a/stable/mariadb/values.yaml b/stable/mariadb/values.yaml index 9b94f1a055..9a2dfd52ab 100644 --- a/stable/mariadb/values.yaml +++ b/stable/mariadb/values.yaml @@ -40,6 +40,16 @@ service: # master: 30001 # slave: 30002 +## Pods Service Account +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ +serviceAccount: + ## Specifies whether a ServiceAccount should be created + ## + create: false + ## The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the mariadb.fullname template + # name: + ## Pod Security Context ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ##