{"record":{"id":"54031fddaf0f2984","repo":"derailed/k9s","slug":"want-d-replicas-got-d-available","errorCode":null,"errorMessage":"want %d replicas got %d available","messagePattern":"want (.+?) replicas got (.+?) available","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/render/sts.go","lineNumber":93,"sourceCode":"\t\tstrconv.Itoa(int(sts.Status.ReadyReplicas)) + \"/\" + strconv.Itoa(int(desired)),\n\t\tasSelector(sts.Spec.Selector),\n\t\tna(sts.Spec.ServiceName),\n\t\tpodContainerNames(&sts.Spec.Template.Spec, true),\n\t\tpodImageNames(&sts.Spec.Template.Spec, true),\n\t\tmapToStr(sts.Labels),\n\t\tAsStatus(s.diagnose(desired, sts.Status.Replicas, sts.Status.ReadyReplicas)),\n\t\tToAge(sts.GetCreationTimestamp()),\n\t}\n\n\treturn nil\n}\n\nfunc (StatefulSet) diagnose(d, c, r int32) error {\n\tif c != r {\n\t\treturn fmt.Errorf(\"desired %d replicas got %d available\", c, r)\n\t}\n\tif d != r {\n\t\treturn fmt.Errorf(\"want %d replicas got %d available\", d, r)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":75,"sourceCodeEnd":98,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/sts.go#L75-L98","documentation":"StatefulSet.diagnose's second check fires when desired (spec.replicas) != ready (status.readyReplicas) and returns 'want D replicas got R available', shown by AsStatus in the VALID column. It means the StatefulSet has not converged to its configured replica count — scale-up in progress, blocked provisioning, or stuck pods. It is status text only and never propagates as a Render error.","triggerScenarios":"After kubectl scale sts or a manifest change raising spec.replicas before new pods become ready; pods blocked by unavailable storage, scheduling, or failing readiness probes; scale-down with terminating pods still counted.","commonSituations":"Autoscaler raising STS replicas; StorageClass capacity limits; OrderedReady pods blocked on an earlier ordinal; rolling updates viewed mid-flight.","solutions":["Compare READY vs DESIRED (kubectl get sts <name>), then kubectl rollout status sts/<name>","Describe the highest not-yet-ready ordinals to find the blocker","Verify StorageClass capacity and PVC binding for the new ordinals","If the desired count is wrong, scale back with kubectl scale sts/<name> --replicas=<n>"],"exampleFix":"# before: want 5 got 3 — new ordinals pending\nkubectl scale sts/mysts --replicas=5\nkubectl rollout status sts/mysts\n# after: converge to 5, or set the reachable target\nkubectl scale sts/mysts --replicas=3","handlingStrategy":"validation","validationCode":"# catch the condition before it renders\nkubectl get sts -o json | jq '.items[] | select(.spec.replicas != .status.readyReplicas) | {name:.metadata.name, desired:.spec.replicas, ready:.status.readyReplicas}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After scaling, wait with kubectl rollout status sts/<name> instead of reading raw counts","Verify StorageClass capacity and PVC binding can satisfy new ordinals before scaling up","Keep readiness probes realistic so new pods converge promptly","Treat the message as convergence state; act on the workload, not the renderer"],"tags":["kubernetes","workloads","statefulset","cluster-state","health","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}