Skip to content

Commit 37b06e2

Browse files
fix(kubevirt-cdi-operator): add startupProbe to survive slow leader election
cdi-operator's controller-runtime starts the health probe HTTP server (:8444) only after the leader election lease is acquired. On a fresh cluster the lease can take 15–20 s, exceeding the liveness probe's 5s + 3×10s grace under load. Kubelet kills the container before the probe can succeed; the pod loops in CrashLoopBackOff, CDI never reconciles its CR, datavolumes.cdi.kubevirt.io stays unavailable, and every downstream test that creates a DataVolume (tenant kubernetes worker VMs, vm-instance) fails. Add a startupProbe that hits /healthz with 30×5s grace (150 s total). Once it succeeds once, liveness/readiness take over with their existing strict config. No effect on healthy clusters; only relaxes the ramp-up window. Implemented as a patches/*.diff applied from the Makefile update target, mirroring the fluxcd-operator pattern. Survives the next upstream regen; if upstream restructures the area around the readinessProbe/resources boundary the patch will fail loudly so the maintainer notices. Co-Authored-By: Claude Opus 4.7 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent cc37fec commit 37b06e2

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎packages/system/kubevirt-cdi-operator/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ update:
1010
wget https://github.com/kubevirt/containerized-data-importer/releases/download/$$VERSION/cdi-operator.yaml -O templates/cdi-operator.yaml
1111
sed -i 's/namespace: cdi/namespace: cozy-kubevirt-cdi/g' templates/cdi-operator.yaml
1212
awk -i inplace -v RS="---" '!/kind: Namespace/{printf "%s", $$0 RS}' templates/cdi-operator.yaml
13+
patch --no-backup-if-mismatch -p1 < patches/startupProbe.diff
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/packages/system/kubevirt-cdi-operator/templates/cdi-operator.yaml b/packages/system/kubevirt-cdi-operator/templates/cdi-operator.yaml
2+
index f46ba09e6..03ac3b3a2 100644
3+
--- a/packages/system/kubevirt-cdi-operator/templates/cdi-operator.yaml
4+
+++ b/packages/system/kubevirt-cdi-operator/templates/cdi-operator.yaml
5+
@@ -5782,6 +5782,14 @@ spec:
6+
scheme: HTTP
7+
initialDelaySeconds: 5
8+
timeoutSeconds: 10
9+
+ startupProbe:
10+
+ httpGet:
11+
+ path: /healthz
12+
+ port: 8444
13+
+ scheme: HTTP
14+
+ periodSeconds: 5
15+
+ failureThreshold: 30
16+
+ timeoutSeconds: 10
17+
resources:
18+
requests:
19+
cpu: 100m

‎packages/system/kubevirt-cdi-operator/templates/cdi-operator.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5782,6 +5782,14 @@ spec:
57825782
scheme: HTTP
57835783
initialDelaySeconds: 5
57845784
timeoutSeconds: 10
5785+
startupProbe:
5786+
httpGet:
5787+
path: /healthz
5788+
port: 8444
5789+
scheme: HTTP
5790+
periodSeconds: 5
5791+
failureThreshold: 30
5792+
timeoutSeconds: 10
57855793
resources:
57865794
requests:
57875795
cpu: 100m

0 commit comments

Comments
 (0)