Skip to content

Commit

Permalink
[stable/mariadb] Add PodDisruptionBudget for MariaDB (helm#11417)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Bedrich <[email protected]>
  • Loading branch information
tomasbedrich authored and k8s-ci-robot committed Feb 28, 2019
1 parent 1f18aa5 commit 30369a1
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/mariadb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: mariadb
version: 5.6.0
version: 5.7.0
appVersion: 10.1.38
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:
Expand Down
6 changes: 6 additions & 0 deletions stable/mariadb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ The following table lists the configurable parameters of the MariaDB chart and t
| `master.readinessProbe.timeoutSeconds` | When the probe times out (master) | `1` |
| `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe (master)| `1` |
| `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe (master) | `3` |
| `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` |
| `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` |
Expand All @@ -129,6 +132,9 @@ The following table lists the configurable parameters of the MariaDB chart and t
| `slave.readinessProbe.timeoutSeconds` | When the probe times out (slave) | `1` |
| `slave.readinessProbe.successThreshold` | Minimum consecutive successes for the probe (slave) | `1` |
| `slave.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe (slave) | `3` |
| `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` |
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
| `metrics.image.registry` | Exporter image registry | `docker.io` |
| `metrics.image.repository` | Exporter image name | `prom/mysqld-exporter` |
Expand Down
24 changes: 24 additions & 0 deletions stable/mariadb/templates/master-pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.master.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "mariadb.fullname" . }}
labels:
app: "{{ template "mariadb.name" . }}"
component: "master"
chart: {{ template "mariadb.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
{{- if .Values.master.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.master.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.master.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.master.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: "{{ template "mariadb.name" . }}"
component: "master"
release: {{ .Release.Name | quote }}
{{- end }}
26 changes: 26 additions & 0 deletions stable/mariadb/templates/slave-pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.replication.enabled }}
{{- if .Values.slave.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "mariadb.fullname" . }}
labels:
app: "{{ template "mariadb.name" . }}"
component: "slave"
chart: {{ template "mariadb.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
{{- if .Values.slave.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.slave.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.slave.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.slave.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: "{{ template "mariadb.name" . }}"
component: "slave"
release: {{ .Release.Name | quote }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions stable/mariadb/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ master:
successThreshold: 1
failureThreshold: 3

podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1

slave:
replicas: 2

Expand Down Expand Up @@ -330,6 +335,11 @@ slave:
successThreshold: 1
failureThreshold: 3

podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1

metrics:
enabled: true
image:
Expand Down
10 changes: 10 additions & 0 deletions stable/mariadb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ master:
successThreshold: 1
failureThreshold: 3

podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1

slave:
replicas: 1

Expand Down Expand Up @@ -329,6 +334,11 @@ slave:
successThreshold: 1
failureThreshold: 3

podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1

metrics:
enabled: false
image:
Expand Down

0 comments on commit 30369a1

Please sign in to comment.