Commit e0a885c
committed
Rolling update for changes to PostgresInstanceSetSpec
We deploy PostgreSQL instances as individual StatefulSets so that:
- a Kubernetes controller keeps the Pods running,
- each Pod has a stable DNS name, and
- each Pod can be stopped and started independently
This commit leverages that last property to orchestrate rolling updates
of instance specifications while considering each Pod's availability and
role as primary or replica of the PostresCluster.
To that end, a new Instance type combines the PostgresInstanceSetSpec,
StatefulSet, and Pod objects of each logical instance to make it easy to
consider them together. It has methods like IsPrimary and IsAvailable
that can be useful outside of the rolling update logic.
A new "instances" section is added to PostgresClusterStatus that shows
the progress of rolling updates. Its "replicas", "readyReplicas", and
"updatedReplicas" fields have the same semantics as fields with those
names in appsv1.DeploymentStatus and appsv1.StatefulSetStatus.
Issue: [ch10193]
Issue: [ch11299]1 parent c9d4dda commit e0a885c
File tree
11 files changed
+1041
-12
lines changed- config
- crd/bases
- rbac
- cluster
- namespace
- internal/controller/postgrescluster
- pkg/apis/postgres-operator.crunchydata.com/v1beta1
11 files changed
+1041
-12
lines changedLines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2195 | 2195 | | |
2196 | 2196 | | |
2197 | 2197 | | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
2198 | 2224 | | |
2199 | 2225 | | |
2200 | 2226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
| |||
229 | 233 | | |
230 | 234 | | |
231 | 235 | | |
232 | | - | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
| 491 | + | |
495 | 492 | | |
496 | 493 | | |
497 | 494 | | |
| |||
0 commit comments