{"record":{"id":"987c5ef1b8ace5ca","repo":"derailed/k9s","slug":"readiness-gate-check-failed-d-of-d","errorCode":null,"errorMessage":"readiness gate check failed: %d of %d","messagePattern":"readiness gate check failed: (.+?) of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/render/pod.go","lineNumber":250,"sourceCode":"\ticr, ict, _ := p.initContainerStats(spec.InitContainers, st.InitContainerStatuses)\n\tcr += icr\n\tct += ict\n\n\tready := hasPodReadyCondition(st.Conditions)\n\trgr, rgt := p.readinessGateStats(spec, &st)\n\n\treturn p.diagnose(phase, cr, ct, ready, rgr, rgt)\n}\n\nfunc (*Pod) diagnose(phase string, cr, ct int, ready bool, rgr, rgt int) error {\n\tif phase == Completed {\n\t\treturn nil\n\t}\n\tif cr != ct || ct == 0 {\n\t\treturn fmt.Errorf(\"container ready check failed: %d of %d\", cr, ct)\n\t}\n\tif rgt > 0 && rgr != rgt {\n\t\treturn fmt.Errorf(\"readiness gate check failed: %d of %d\", rgr, rgt)\n\t}\n\tif !ready {\n\t\treturn fmt.Errorf(\"pod condition ready is false\")\n\t}\n\tif phase == Terminating {\n\t\treturn fmt.Errorf(\"pod is terminating\")\n\t}\n\n\treturn nil\n}\n\n// ----------------------------------------------------------------------------\n// Helpers...\n\nfunc asNominated(n string) string {\n\tif n == \"\" {\n\t\treturn MissingValue\n\t}","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/pod.go#L232-L268","documentation":"Pod.diagnose second gate: when the pod declares readiness gates (podspec.readinessGates) and the satisfied-gate count (rgr, computed from the pod's 'KubeletReady'-style gate conditions) does not equal the declared total (rgt > 0 && rgr != rgt), the pod is flagged not ready.","triggerScenarios":"Using pod-readiness operators (e.g. AWS Load Balancer Controller target-group-binding gates, Keptn) where the external condition writer has not yet set all gate conditions to True; gate conditions set to False by the controller.","commonSituations":"Pods pending registration behind an LB whose controller is down or misconfigured; service mesh injection adding gates the cluster does not fulfill; operator lag during mass scheduling.","solutions":["kubectl get pod <name> -o jsonpath='{.status.conditions}' and check the readinessGate condition statuses","Fix/inspect the external controller that owns the gate (e.g. aws-load-balancer-controller logs)","Remove the readinessGate from the spec if nothing implements it","Once gates report True the pod status self-heals"],"exampleFix":"# before: gate declared but no controller implements it\nreadinessGates:\n- conditionType: target-health.example.com/ready\n# after: drop the gate (or deploy the controller that sets it)","handlingStrategy":"fallback","validationCode":"declared := len(pod.Spec.ReadinessGates)\nif declared > 0 {\n\tsatisfied := 0\n\tfor _, c := range pod.Status.Conditions {\n\t\tfor _, g := range pod.Spec.ReadinessGates {\n\t\t\tif c.Type == g.ConditionType && c.Status == v1.ConditionTrue {\n\t\t\t\tsatisfied++\n\t\t\t}\n\t\t}\n\t}\n\t// satisfied == declared -> gate check passes\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Deploy the controller that satisfies each gate condition before rolling pods","Do not declare readinessGates no operator implements","Watch the owning controller's logs when gate conditions stay False"],"tags":["pod","readiness-gates","health","kubernetes"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}