From f1a2e8b665853bf4b4c7f8bfa8931c7bca7947ef Mon Sep 17 00:00:00 2001 From: eddycharly Date: Wed, 18 Sep 2019 11:25:31 +0200 Subject: [PATCH] [stable/mariadb] add service annotations support (#17171) * [stable/mariadb] added support for service annotations [stable/mariadb] bump minor version + comments in values files Signed-off-by: charles-edouard.breteche * [stable/mariadb] fix version Signed-off-by: charles-edouard.breteche --- stable/mariadb/Chart.yaml | 2 +- stable/mariadb/README.md | 2 ++ stable/mariadb/templates/master-svc.yaml | 7 ++++++- stable/mariadb/templates/slave-svc.yaml | 7 ++++++- stable/mariadb/values-production.yaml | 14 ++++++++++++++ stable/mariadb/values.yaml | 16 ++++++++++++++++ 6 files changed, 45 insertions(+), 3 deletions(-) diff --git a/stable/mariadb/Chart.yaml b/stable/mariadb/Chart.yaml index 7b1fdce48c..1b1582a925 100644 --- a/stable/mariadb/Chart.yaml +++ b/stable/mariadb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: mariadb -version: 6.8.10 +version: 6.9.0 appVersion: 10.3.18 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 e016774b3d..76562e197d 100644 --- a/stable/mariadb/README.md +++ b/stable/mariadb/README.md @@ -124,6 +124,7 @@ The following table lists the configurable parameters of the MariaDB chart and t | `master.podDisruptionBudget.enabled` | If true, create a pod disruption budget for master pods. | `false` | | `master.podDisruptionBudget.minAvailable` | Minimum number / percentage of pods that should remain scheduled | `1` | | `master.podDisruptionBudget.maxUnavailable`| Maximum number / percentage of pods that may be made unavailable | `nil` | +| `master.service.annotations` | Master service annotations | `{}` | | `slave.replicas` | Desired number of slave replicas | `1` | | `slave.annotations[].key` | key for the the annotation list item | `nil` | | `slave.annotations[].value` | value for the the annotation list item | `nil` | @@ -156,6 +157,7 @@ The following table lists the configurable parameters of the MariaDB chart and t | `slave.podDisruptionBudget.enabled` | If true, create a pod disruption budget for slave pods. | `false` | | `slave.podDisruptionBudget.minAvailable` | Minimum number / percentage of pods that should remain scheduled | `1` | | `slave.podDisruptionBudget.maxUnavailable`| Maximum number / percentage of pods that may be made unavailable | `nil` | +| `slave.service.annotations` | Slave service annotations | `{}` | | `metrics.enabled` | Start a side-car prometheus exporter | `false` | | `metrics.image.registry` | Exporter image registry | `docker.io` | | `metrics.image.repository` | Exporter image name | `bitnami/mysqld-exporter` | diff --git a/stable/mariadb/templates/master-svc.yaml b/stable/mariadb/templates/master-svc.yaml index 2ab2e7a1ab..7f5d8af572 100644 --- a/stable/mariadb/templates/master-svc.yaml +++ b/stable/mariadb/templates/master-svc.yaml @@ -8,10 +8,15 @@ metadata: chart: "{{ template "mariadb.chart" . }}" release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} -{{- if .Values.metrics.enabled }} +{{- if or .Values.metrics.enabled .Values.master.service.annotations }} annotations: +{{- if .Values.metrics.enabled }} {{ toYaml .Values.metrics.annotations | indent 4 }} {{- end }} +{{- if .Values.master.service.annotations }} +{{ toYaml .Values.master.service.annotations | indent 4 }} +{{- end }} +{{- end }} spec: type: {{ .Values.service.type }} {{- if eq .Values.service.type "ClusterIP" }} diff --git a/stable/mariadb/templates/slave-svc.yaml b/stable/mariadb/templates/slave-svc.yaml index ddec4a22b5..4292f1b6f3 100644 --- a/stable/mariadb/templates/slave-svc.yaml +++ b/stable/mariadb/templates/slave-svc.yaml @@ -9,10 +9,15 @@ metadata: component: "slave" release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} -{{- if .Values.metrics.enabled }} +{{- if or .Values.metrics.enabled .Values.slave.service.annotations }} annotations: +{{- if .Values.metrics.enabled }} {{ toYaml .Values.metrics.annotations | indent 4 }} {{- end }} +{{- if .Values.slave.service.annotations }} +{{ toYaml .Values.slave.service.annotations | indent 4 }} +{{- end }} +{{- end }} spec: type: {{ .Values.service.type }} {{- if eq .Values.service.type "ClusterIP" }} diff --git a/stable/mariadb/values-production.yaml b/stable/mariadb/values-production.yaml index efb8b9f965..85db97d954 100644 --- a/stable/mariadb/values-production.yaml +++ b/stable/mariadb/values-production.yaml @@ -293,6 +293,13 @@ master: minAvailable: 1 # maxUnavailable: 1 + ## Allow customization of the service resource + ## + service: + ## Add custom annotations to the service + ## + annotations: {} + slave: replicas: 2 @@ -408,6 +415,13 @@ slave: minAvailable: 1 # maxUnavailable: 1 + ## Allow customization of the service resource + ## + service: + ## Add custom annotations to the service + ## + annotations: {} + metrics: enabled: true image: diff --git a/stable/mariadb/values.yaml b/stable/mariadb/values.yaml index e94bda318e..c87d477118 100644 --- a/stable/mariadb/values.yaml +++ b/stable/mariadb/values.yaml @@ -293,6 +293,14 @@ master: minAvailable: 1 # maxUnavailable: 1 + ## Allow customization of the service resource + ## + service: + ## Add custom annotations to the service + ## + annotations: {} + # external-dns.alpha.kubernetes.io/hostname: db.example.com + slave: replicas: 1 @@ -408,6 +416,14 @@ slave: minAvailable: 1 # maxUnavailable: 1 + ## Allow customization of the service resource + ## + service: + ## Add custom annotations to the service + ## + annotations: {} + # external-dns.alpha.kubernetes.io/hostname: rodb.example.com + metrics: enabled: false image: