Commit 1315aea
committed
Get MYSQL_PWD using an on-demand cluster query
In order to facilitate an in-place change to the name of the
Secret that is referenced by a Galera instance for the
mysql root password, rework
the approach used by pods and shell scripts to no longer
require the root secret name and/or password be passed by
environment variable, instead using a pod-level cluster
query to retrieve the current root password. The logic
to retrieve this password is encapsulated into a single
shell script that is present as a volume mount on running containers.
This allows Job objects to be created with hashes that
do not link to a specific Secret name, as well as to
create StatefulSet objects that don't refer to this name.
When the Secret name changes on a Galera instance for
an in-place root password change, the hashes / CRs for
these objects will remain unchanged.
A subsequent change to the mariadb operator will add the ability
to change the mysql root password of a Galera cluster using a
dual-reference architecture where
the "current" root secret will be part of <CR>/Status, while
the secret referenced in <CR>/Spec will be the "new" root
secret. When these two names differ, that will indicate an
in-place password change should take place, as well
as allowing the pre-existing root password to be available
at the same time as the new one in order to do a root password
change. The same
architecture will be applied to a new class of "system" MariaDBAccount
objects that are for use only by the Galera instance itself
and do not have a link to any MariaDBDatabase CR. The
Galera CR itself will no longer use osp-secret
for the mysql root password nor will the secret be directly
referenced from the Galera CR, instead referenced by a
"system" MariaDBAccount CR which the Galera operator itself
will create.1 parent 0b437e3 commit 1315aea
File tree
28 files changed
+176
-164
lines changed- controllers
- pkg/mariadb
- templates
- galera/bin
- tests
- chainsaw
- scripts
- kuttl
- common/scripts
- tests
- account_create
- database_create
- galera_cluster_restart
- galera_create_user_require_tls
- galera_deploy_external_tls
- galera_deploy_tls
28 files changed
+176
-164
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
498 | 513 | | |
499 | 514 | | |
500 | 515 | | |
| |||
948 | 963 | | |
949 | 964 | | |
950 | 965 | | |
951 | | - | |
| 966 | + | |
| 967 | + | |
952 | 968 | | |
953 | 969 | | |
954 | 970 | | |
955 | 971 | | |
956 | 972 | | |
957 | 973 | | |
958 | 974 | | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
964 | 981 | | |
965 | 982 | | |
966 | 983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
| |||
289 | 288 | | |
290 | 289 | | |
291 | 290 | | |
292 | | - | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
| |||
480 | 479 | | |
481 | 480 | | |
482 | 481 | | |
483 | | - | |
| 482 | + | |
484 | 483 | | |
485 | 484 | | |
486 | 485 | | |
| |||
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
498 | | - | |
499 | 497 | | |
500 | 498 | | |
501 | 499 | | |
| |||
514 | 512 | | |
515 | 513 | | |
516 | 514 | | |
517 | | - | |
| 515 | + | |
518 | 516 | | |
519 | 517 | | |
520 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
| 201 | + | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 66 | | |
77 | 67 | | |
78 | 68 | | |
| |||
85 | 75 | | |
86 | 76 | | |
87 | 77 | | |
| 78 | + | |
88 | 79 | | |
89 | 80 | | |
| 81 | + | |
90 | 82 | | |
91 | 83 | | |
92 | 84 | | |
| |||
100 | 92 | | |
101 | 93 | | |
102 | 94 | | |
103 | | - | |
| 95 | + | |
104 | 96 | | |
105 | 97 | | |
106 | 98 | | |
| |||
124 | 116 | | |
125 | 117 | | |
126 | 118 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
143 | 123 | | |
144 | 124 | | |
| 125 | + | |
145 | 126 | | |
146 | 127 | | |
147 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 52 | | |
63 | 53 | | |
64 | 54 | | |
| |||
73 | 63 | | |
74 | 64 | | |
75 | 65 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 66 | + | |
89 | 67 | | |
90 | 68 | | |
91 | 69 | | |
| |||
104 | 82 | | |
105 | 83 | | |
106 | 84 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
111 | 90 | | |
112 | 91 | | |
| 92 | + | |
113 | 93 | | |
114 | 94 | | |
115 | 95 | | |
| |||
123 | 103 | | |
124 | 104 | | |
125 | 105 | | |
126 | | - | |
| 106 | + | |
127 | 107 | | |
128 | 108 | | |
129 | 109 | | |
| |||
145 | 125 | | |
146 | 126 | | |
147 | 127 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 128 | | |
160 | 129 | | |
161 | 130 | | |
| |||
171 | 140 | | |
172 | 141 | | |
173 | 142 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 143 | + | |
187 | 144 | | |
188 | 145 | | |
189 | 146 | | |
| |||
199 | 156 | | |
200 | 157 | | |
201 | 158 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
206 | 164 | | |
207 | 165 | | |
| 166 | + | |
208 | 167 | | |
209 | 168 | | |
210 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 107 | | |
118 | 108 | | |
119 | 109 | | |
| |||
132 | 122 | | |
133 | 123 | | |
134 | 124 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | 125 | | |
146 | 126 | | |
147 | 127 | | |
| |||
0 commit comments