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:
parent
375cce8174
commit
7f7cbac965
1 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue