diff --git a/mariadb/README.md b/mariadb/README.md index 7d4a8ab1..2be7897c 100644 --- a/mariadb/README.md +++ b/mariadb/README.md @@ -73,6 +73,7 @@ The following table lists the configurable parameters of the MariaDB chart and t | `service.clusterIp.master` | Specific cluster IP for master when service type is cluster IP. Use None for headless service | `nil` | | `service.clusterIp.slave` | Specific cluster IP for slave when service type is cluster IP. Use None for headless service | `nil` | | `service.port` | MySQL service port | `3306` | +| `enableServiceLinks` | Set to false to disable service links, which can cause slow pod startup times when there are many services in the current namespace. | `true` | | `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 | | `schedulerName` | Name of the k8s scheduler (other than default) | `nil` | diff --git a/mariadb/templates/master-statefulset.yaml b/mariadb/templates/master-statefulset.yaml index 5d335814..21d6fd52 100644 --- a/mariadb/templates/master-statefulset.yaml +++ b/mariadb/templates/master-statefulset.yaml @@ -36,6 +36,7 @@ spec: component: master {{- include "mariadb.podLabels" . | nindent 8 }} spec: + enableServiceLinks: {{ .Values.enableServiceLinks }} {{- if .Values.schedulerName }} schedulerName: {{ .Values.schedulerName | quote }} {{- end }} diff --git a/mariadb/templates/slave-statefulset.yaml b/mariadb/templates/slave-statefulset.yaml index aab861f3..79243170 100644 --- a/mariadb/templates/slave-statefulset.yaml +++ b/mariadb/templates/slave-statefulset.yaml @@ -37,6 +37,7 @@ spec: component: slave {{- include "mariadb.podLabels" . | nindent 8 }} spec: + enableServiceLinks: {{ .Values.enableServiceLinks }} {{- if .Values.schedulerName }} schedulerName: {{ .Values.schedulerName | quote }} {{- end }} diff --git a/mariadb/values.yaml b/mariadb/values.yaml index 906f433f..510417c1 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -82,6 +82,11 @@ service: # master: 30001 # slave: 30002 +# The environment variables injected by service links are not used, but can lead to slow boot times when +# there are many services in the current namespace. +# If you experience slow pod startups you probably want to set this to `false`. +enableServiceLinks: true + ## Pods Service Account ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ serviceAccount: