Commit 3bafb17
feat: startup and readiness probes for replicas (cloudnative-pg#6623)
Extend the startup and readiness probes configured through the
`.spec.probes.startup` and `.spec.probes.readiness` sections by adding
two additional parameters:
- `type`: Defines the criteria for considering the probe successful.
Accepted values include:
- `pg_isready`: This setting marks the probe as successful when the
`pg_isready` command exits with a status of `0`. This is the default for
both primary instances and replicas.
- `query`: This setting marks the probe as successful when a basic query
is executed locally on the `postgres` database.
- `streaming`: This setting marks the probe successful when the replica
starts streaming from its source and meets the specified lag
requirements (details below).
- `lag`: Specifies the maximum acceptable replication lag, measured in
bytes (expressed using Kubernetes quantities). This parameter is
applicable only when `type` is set to `streaming`. If the `lag`
parameter is not specified, the replica is considered successfully
started/ready as soon as it begins streaming.
Consequently, the liveness probe has been streamlined to verify solely
that the instance manager is operational, without monitoring the
underlying PostgreSQL instance.
Closes: cloudnative-pg#6621
## Release Notes
**Improved Startup and Readiness Probes for Replicas**: Enhanced support
for Kubernetes startup and readiness probes in PostgreSQL instances,
providing greater control over replicas based on the streaming lag.
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>1 parent 82d09bf commit 3bafb17
File tree
33 files changed
+986
-203
lines changed- api/v1
- config/crd/bases
- docs/src
- release_notes
- samples
- internal/management/controller
- roles
- tablespaces
- pkg
- management
- postgres
- readiness
- webserver
- probes
- url
- specs
- tests/e2e
- fixtures
- pg_data_corruption
- sync_replicas
33 files changed
+986
-203
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
346 | 347 | | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| |||
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
| 447 | + | |
| 448 | + | |
445 | 449 | | |
446 | 450 | | |
447 | 451 | | |
| |||
957 | 961 | | |
958 | 962 | | |
959 | 963 | | |
| 964 | + | |
960 | 965 | | |
961 | 966 | | |
962 | 967 | | |
| |||
1348 | 1353 | | |
1349 | 1354 | | |
1350 | 1355 | | |
| 1356 | + | |
1351 | 1357 | | |
1352 | 1358 | | |
1353 | 1359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1482 | 1482 | | |
1483 | 1483 | | |
1484 | 1484 | | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
1485 | 1495 | | |
1486 | 1496 | | |
1487 | 1497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
| 490 | + | |
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
499 | 533 | | |
500 | 534 | | |
501 | 535 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4302 | 4302 | | |
4303 | 4303 | | |
4304 | 4304 | | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
| 4308 | + | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
4305 | 4312 | | |
4306 | 4313 | | |
4307 | 4314 | | |
| |||
4335 | 4342 | | |
4336 | 4343 | | |
4337 | 4344 | | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
4338 | 4352 | | |
4339 | 4353 | | |
4340 | 4354 | | |
| |||
4351 | 4365 | | |
4352 | 4366 | | |
4353 | 4367 | | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
4354 | 4375 | | |
4355 | 4376 | | |
4356 | 4377 | | |
| |||
4384 | 4405 | | |
4385 | 4406 | | |
4386 | 4407 | | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
4387 | 4415 | | |
4388 | 4416 | | |
4389 | 4417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4216 | 4216 | | |
4217 | 4217 | | |
4218 | 4218 | | |
| 4219 | + | |
| 4220 | + | |
4219 | 4221 | | |
4220 | 4222 | | |
4221 | 4223 | | |
| |||
4286 | 4288 | | |
4287 | 4289 | | |
4288 | 4290 | | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
| 4298 | + | |
| 4299 | + | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
| 4308 | + | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
4289 | 4344 | | |
4290 | 4345 | | |
4291 | 4346 | | |
| |||
4302 | 4357 | | |
4303 | 4358 | | |
4304 | 4359 | | |
4305 | | - | |
| 4360 | + | |
4306 | 4361 | | |
4307 | 4362 | | |
4308 | 4363 | | |
| |||
4316 | 4371 | | |
4317 | 4372 | | |
4318 | 4373 | | |
4319 | | - | |
| 4374 | + | |
4320 | 4375 | | |
4321 | 4376 | | |
4322 | 4377 | | |
| |||
0 commit comments