@@ -10,35 +10,22 @@ metadata:
10
10
{{- list . "database" | include "component.labels" | nindent 4 }}
11
11
spec :
12
12
updateOnConfigChange : true
13
- activePassiveProbes :
14
- database :
15
- periodSeconds : 5
16
- exec :
17
- command :
18
- - /bin/bash
19
- - -c
20
- - |
21
- {{- .Files.Get "assets/scripts/jobs/pxc/active_passive_probe.sh" | nindent 12 }}
22
13
template :
23
14
metadata :
24
15
name : database
25
16
namespace : {{ .Release.Namespace | quote }}
26
17
labels :
27
18
{{- list . "database" | include "component.labels" | nindent 8 }}
28
19
spec :
29
- {{- $replicas := 1 }}
30
- {{- if $.Values.sizing.database.instances }}
31
- {{- $replicas = $.Values.sizing.database.instances }}
32
- {{- else if $.Values.high_availability }}
33
- {{- $replicas = 3 }}
34
- {{- end }}
35
- {{- if eq (mod $replicas 2) 0 }}
36
- {{- include "_config.fail" "The number of database instances must be odd to avoid split-brain" }}
37
- {{- end }}
38
- replicas : {{ $replicas }}
20
+ # Database replicas are not allowed.
21
+ # High-availability is not currently feasible to support in k8s.
22
+ # Galera replication on rolling updates of the statefulset is hard to get
23
+ # right and to maintain as part of KubeCF. For an HA database, prefer
24
+ # using a specialized external one.
25
+ replicas : 1
39
26
selector :
40
27
matchLabels :
41
- {{- list . "database" | include "component.labels " | nindent 10 }}
28
+ {{- list . "database" | include "component.selector " | nindent 10 }}
42
29
serviceName : database
43
30
template :
44
31
metadata :
47
34
spec :
48
35
{{- if $.Values.sizing.database.affinity }}
49
36
affinity : {{ $.Values.sizing.database.affinity | toJson }}
50
- {{- else }}
51
- affinity :
52
- podAntiAffinity :
53
- preferredDuringSchedulingIgnoredDuringExecution :
54
- - weight : 100
55
- podAffinityTerm :
56
- labelSelector :
57
- matchExpressions :
58
- - key : quarks.cloudfoundry.org/quarks-statefulset-name
59
- operator : In
60
- values :
61
- - database
62
- topologyKey : kubernetes.io/hostname
63
37
{{- end }}
64
38
initContainers :
65
39
- name : remove-lost-found
@@ -89,30 +63,13 @@ spec:
89
63
secretKeyRef :
90
64
name : var-pxc-password
91
65
key : password
92
- - name : XTRABACKUP_PASSWORD
93
- valueFrom :
94
- secretKeyRef :
95
- name : var-xtrabackup-password
96
- key : password
97
66
- name : ALLOW_ROOT_FROM
98
67
value : " %"
99
- - name : CLUSTER_NAME
100
- value : {{ .Release.Name }}-database
101
- - name : SHORT_CLUSTER_NAME
102
- value : {{ .Release.Name }}-database
103
- - name : K8S_SERVICE_NAME
104
- value : database-repl
105
68
- name : PXC_STRICT_MODE
106
69
value : ENFORCING
107
70
ports :
108
71
- name : mysql
109
72
containerPort : 3306
110
- - name : galera-repl
111
- containerPort : 4567
112
- - name : state-transfer
113
- containerPort : 4568
114
- - name : state-snapshot
115
- containerPort : 4444
116
73
livenessProbe :
117
74
exec :
118
75
command :
0 commit comments