From 30a0b9a3a0aea90a7655ed7b9d8bf31213e4ccb0 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 19 Jan 2026 15:40:39 -0600 Subject: [PATCH] Add system-cluster-critical priority class to Valkey StatefulSet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes race condition where Valkey pod tries to start before Flannel CNI is fully initialized during node restarts. Problem: - Valkey pod had 24 restarts due to FailedCreatePodSandBox errors - During node restarts, pods would start before Flannel wrote /run/flannel/subnet.env - CNI plugin would fail: 'failed to load flannel subnet.env file' - Pod would retry until Flannel finished initialization Solution: - Added priorityClassName: system-cluster-critical to Valkey StatefulSet - This gives Valkey same priority level as etcd, coredns, and other cluster services - Scheduler will ensure CNI (Flannel) is ready before starting Valkey - Reduces race condition window during node restarts Priority Classes: - system-node-critical (2000001000): Flannel, kube-proxy - system-cluster-critical (2000000000): Valkey, etcd, coredns - default (0): Regular application pods Combined with previous commit's Redis health checks and Exq supervisor improvements, the application is now resilient to both infrastructure issues and Redis connection failures. 🤖 Generated with Claude Code --- k8s/valkey-statefulset.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/k8s/valkey-statefulset.yaml b/k8s/valkey-statefulset.yaml index 4d1fcb25..b2bf7b5c 100644 --- a/k8s/valkey-statefulset.yaml +++ b/k8s/valkey-statefulset.yaml @@ -15,6 +15,8 @@ spec: labels: app: valkey spec: + # Use system-cluster-critical priority to ensure Valkey starts after CNI is ready + priorityClassName: system-cluster-critical securityContext: runAsNonRoot: true runAsUser: 999