fix(keycloak): use management port health endpoints for probes by mattia-eleuteri · Pull Request #2162 · cozystack/cozystack

@dosubot dosubot bot added size:S

This PR changes 10-29 lines, ignoring generated files.

bug

Something isn't working

labels

Mar 6, 2026

@mattia-eleuteri @claude

Keycloak 26.x exposes dedicated health endpoints on the management
port (9000) via /health/live and /health/ready. The previous probes
used GET / on port 8080 which redirects to the configured KC_HOSTNAME
(HTTPS), causing kubelet to fail the probe with "Probe terminated
redirects" and eventually kill the pod in a crashloop.

Changes:
- Add KC_HEALTH_ENABLED=true to activate health endpoints
- Expose management port 9000 in container ports
- Switch liveness probe to /health/live on port 9000
- Switch readiness probe to /health/ready on port 9000
- Increase failure thresholds for more tolerance during startup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>

gemini-code-assist[bot]

@mattia-eleuteri @claude

Use a startupProbe to defer liveness/readiness checks until Keycloak
has fully started, instead of relying on initialDelaySeconds. This is
more robust for applications with variable startup times.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>

@dosubot dosubot bot added the lgtm

This PR has been approved by a maintainer

label

Mar 10, 2026

kvaps added a commit that referenced this pull request

Mar 10, 2026
…oints for probes (#2178)

# Description
Backport of #2162 to `release-1.0`.

kvaps added a commit that referenced this pull request

Mar 10, 2026
…oints for probes (#2179)

# Description
Backport of #2162 to `release-1.1`.