Skip to content

Commit 1bb24f5

Browse files
committed
Add HTTP healthchecks to metal3 quadlet containers
Add podman healthchecks with HealthOnFailure=kill to the three metal3 quadlet container templates. Combined with the existing Restart=always in [Service], this creates a self-healing loop: podman kills unhealthy containers and systemd restarts them automatically. https://redhat.atlassian.net/browse/MGMT-22876 Signed-off-by: Rafa Porres Molina <rporresm@redhat.com> Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f371f5c commit 1bb24f5

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

playbooks/templates/quadlets/metal3-bmo.container.j2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ Environment=IRONIC_ENDPOINT=http://{{ lzBmcIP }}:6385/v1/
1717
Environment=WATCH_NAMESPACE=infraenv
1818
Environment=LIVE_ISO_FORCE_PERSISTENT_BOOT_DEVICE=Never
1919
Environment=METAL3_AUTH_ROOT_DIR=/auth
20-
Exec=/baremetal-operator --webhook-port=0 --metrics-addr=0 --health-addr=0 --dev --enable-leader-election=false
20+
Exec=/baremetal-operator --webhook-port=0 --metrics-addr=0 --health-addr=:9440 --dev --enable-leader-election=false
21+
HealthCmd=curl -sf http://localhost:9440/healthz
22+
HealthInterval=30s
23+
HealthTimeout=10s
24+
HealthRetries=3
25+
HealthStartPeriod=60s
26+
HealthOnFailure=kill
2127

2228
[Service]
2329
Restart=always

playbooks/templates/quadlets/metal3-httpd.container.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Environment=LISTEN_ALL_INTERFACES=true
1515
Environment=USE_IRONIC_INSPECTOR=false
1616
Environment=PROVISIONING_IP={{ lzBmcIP }}
1717
Exec=/bin/runhttpd
18+
HealthCmd=curl -sf http://localhost:6180/
19+
HealthInterval=30s
20+
HealthTimeout=10s
21+
HealthRetries=3
22+
HealthStartPeriod=60s
23+
HealthOnFailure=kill
1824

1925
[Service]
2026
Restart=always

playbooks/templates/quadlets/metal3-ironic-api.container.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ Environment=OS_JSON_RPC__PORT=6189
2727
Environment=WEBSERVER_CACERT_FILE=/certs/ca-bundle.crt
2828
{% endif %}
2929
Exec=/bin/runironic
30+
HealthCmd=curl -sf http://localhost:6385/
31+
HealthInterval=30s
32+
HealthTimeout=10s
33+
HealthRetries=3
34+
HealthStartPeriod=60s
35+
HealthOnFailure=kill
3036

3137
[Service]
3238
Restart=always

0 commit comments

Comments
 (0)