diff --git a/k8s/valkey-statefulset.yaml b/k8s/valkey-statefulset.yaml index b2bf7b5c..5328206a 100644 --- a/k8s/valkey-statefulset.yaml +++ b/k8s/valkey-statefulset.yaml @@ -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