derailed/k9s · warning

readiness gate check failed: %d of %d

Error message

readiness gate check failed: %d of %d

What it means

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.

Source

Thrown at internal/render/pod.go:250

	icr, ict, _ := p.initContainerStats(spec.InitContainers, st.InitContainerStatuses)
	cr += icr
	ct += ict

	ready := hasPodReadyCondition(st.Conditions)
	rgr, rgt := p.readinessGateStats(spec, &st)

	return p.diagnose(phase, cr, ct, ready, rgr, rgt)
}

func (*Pod) diagnose(phase string, cr, ct int, ready bool, rgr, rgt int) error {
	if phase == Completed {
		return nil
	}
	if cr != ct || ct == 0 {
		return fmt.Errorf("container ready check failed: %d of %d", cr, ct)
	}
	if rgt > 0 && rgr != rgt {
		return fmt.Errorf("readiness gate check failed: %d of %d", rgr, rgt)
	}
	if !ready {
		return fmt.Errorf("pod condition ready is false")
	}
	if phase == Terminating {
		return fmt.Errorf("pod is terminating")
	}

	return nil
}

// ----------------------------------------------------------------------------
// Helpers...

func asNominated(n string) string {
	if n == "" {
		return MissingValue
	}

View on GitHub (pinned to 2d3ccc6ba2)

Solutions

  1. kubectl get pod <name> -o jsonpath='{.status.conditions}' and check the readinessGate condition statuses
  2. Fix/inspect the external controller that owns the gate (e.g. aws-load-balancer-controller logs)
  3. Remove the readinessGate from the spec if nothing implements it
  4. Once gates report True the pod status self-heals

Example fix

# before: gate declared but no controller implements it
readinessGates:
- conditionType: target-health.example.com/ready
# after: drop the gate (or deploy the controller that sets it)
Defensive patterns

Strategy: fallback

Validate before calling

declared := len(pod.Spec.ReadinessGates)
if declared > 0 {
	satisfied := 0
	for _, c := range pod.Status.Conditions {
		for _, g := range pod.Spec.ReadinessGates {
			if c.Type == g.ConditionType && c.Status == v1.ConditionTrue {
				satisfied++
			}
		}
	}
	// satisfied == declared -> gate check passes
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of derailed/k9s@2d3ccc6ba2 (2026-08-15). Data as JSON: /api/errors/987c5ef1b8ace5ca. Report an issue: GitHub.