{"record":{"id":"1788ff839994118d","repo":"derailed/k9s","slug":"desiring-d-replicas-but-d-ready","errorCode":null,"errorMessage":"desiring %d replicas but %d ready","messagePattern":"desiring (.+?) replicas but (.+?) ready","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/render/ds.go","lineNumber":89,"sourceCode":"\t\tds.Name,\n\t\tcomputeVulScore(ds.Namespace, ds.Labels, &ds.Spec.Template.Spec),\n\t\tstrconv.Itoa(int(ds.Status.DesiredNumberScheduled)),\n\t\tstrconv.Itoa(int(ds.Status.CurrentNumberScheduled)),\n\t\tstrconv.Itoa(int(ds.Status.NumberReady)),\n\t\tstrconv.Itoa(int(ds.Status.UpdatedNumberScheduled)),\n\t\tstrconv.Itoa(int(ds.Status.NumberAvailable)),\n\t\tmapToStr(ds.Labels),\n\t\tAsStatus(d.diagnose(ds.Status.DesiredNumberScheduled, ds.Status.NumberReady)),\n\t\tToAge(ds.GetCreationTimestamp()),\n\t}\n\n\treturn nil\n}\n\n// Happy returns true if resource is happy, false otherwise.\nfunc (DaemonSet) diagnose(d, r int32) error {\n\tif d != r {\n\t\treturn fmt.Errorf(\"desiring %d replicas but %d ready\", d, r)\n\t}\n\treturn nil\n}\n","sourceCodeStart":71,"sourceCodeEnd":93,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/ds.go#L71-L93","documentation":"DaemonSet.diagnose compares status.desiredNumberScheduled with status.numberReady; a mismatch yields 'desiring N replicas but M ready'. It is the health indicator for DaemonSet rows: nodes where the daemon pod is not (yet) ready.","triggerScenarios":"Daemon rollout in progress on a large fleet; pods unschedulable on some nodes (taints, resources); CNI/node-exporter daemons crashing on specific kernels; newly joined nodes still pulling images.","commonSituations":"Upgrading kube-proxy/node-exporter DaemonSets; nodes with incompatible taints missing tolerations; slow registries delaying image pulls; disk pressure evicting daemon pods.","solutions":["Wait if a rollout is in flight: kubectl rollout status ds/<name>","Find not-ready pods: kubectl get pods -l <selector> -o wide | grep -v Running/Ready, then describe the failing ones","Add missing tolerations/affinity for tainted nodes, or fix resources","Check kubelet/containerd on nodes whose daemon pods stay pending"],"exampleFix":"# before: daemon pods not scheduled on control-plane\n# tolerations missing\n# after\ntolerations:\n- key: node-role.kubernetes.io/control-plane\n  operator: Exists\n  effect: NoSchedule","handlingStrategy":"fallback","validationCode":"if ds.Status.DesiredNumberScheduled == ds.Status.NumberReady {\n\tstatus = \"ok\" // skip diagnose\n}","typeGuard":null,"tryCatchPattern":"Use the error as row status; when desired-ready persists across refreshes, escalate to per-node pod inspection.","preventionTips":["Add tolerations for all node roles your daemon must run on","Pre-pull daemon images or use registry mirrors on large fleets","Alert on per-node daemon gaps rather than aggregate mismatch alone"],"tags":["daemonset","rollout","health","kubernetes"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}