Add init container to Valkey to wait for Flannel CNI readiness

Prevents FailedCreatePodSandBox errors when talos-worker1 reboots and pods
try to start before Flannel writes /run/flannel/subnet.env.

Init container polls DNS resolution until network is ready before starting Valkey.
This commit is contained in:
Graham McIntire 2026-01-20 11:41:21 -06:00
parent 375cce8174
commit 7f7cbac965
No known key found for this signature in database

View file

@ -23,6 +23,29 @@ spec:
fsGroup: 999
seccompProfile:
type: RuntimeDefault
# Init container to wait for network to be ready (Flannel CNI)
initContainers:
- name: wait-for-network
image: busybox:1.36
command:
- sh
- -c
- |
echo "Waiting for network to be ready..."
until nslookup kubernetes.default.svc.cluster.local > /dev/null 2>&1; do
echo "Network not ready, retrying in 2s..."
sleep 2
done
echo "Network is ready!"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 999
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
containers:
- name: valkey
image: valkey/valkey:8.0-alpine