generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Warning seen in pdb events:
Warning CalculateExpectedPodCountFailed 19s (x6 over 15m) controllermanager
Failed to calculate the number of expected pods:
Internal error occurred: the spec replicas field ".spec.replicas" does not exist
Reason:
Sandbox implements scale .spec.replicas as an int pointer.
when it is not specified, the controller defaults locally to 1.
It does not set the value 1 in the resource.
Then when PDB tries to use scale subresource Get() https://github.com/kubernetes/kubernetes/blob/2711e8cb53987ad7aca9eee21e1be3a4961fea39/pkg/controller/disruption/disruption.go#L387
Scale get reads fails at read from etcd/crd: https://github.com/kubernetes/kubernetes/blob/2711e8cb53987ad7aca9eee21e1be3a4961fea39/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go#L183
scale subresource get fails when replica is not specified.
Options to fix:
- make
.spec.replicasanintinstead of*int(how does defaulting to 1 work in this case ?) - default in controller and write back to the sandbox object (breaks controller mutating spec principle)
Related PR #85
Metadata
Metadata
Assignees
Labels
No labels