kubernetes: Scheduler ignores requests for unknown fully-qualified resources.
/kind bug /sig scheduling
What happened:
Scenario A:
- Create a pod that requires one
example.com/foo
resource. - Observe that the pod is scheduled, despite there being no matching resources available in the cluster.
Scenario B:
- Create a pod that requires one
kubernetes.io/foo
resource. - Observe that the pod is scheduled, despite there being no matching resources available in the cluster.
What you expected to happen:
I did not expect the pod to be scheduled and run. In both cases, I expected the pod to do one of the following:
- Remain in pending state, having failed a scheduler predicate for all available nodes.
- Fail validation. Since there is no facility in the scheduler or kubelet for checking feasibility of these resources, you could argue that they should have failed admission.
How to reproduce it (as minimally and precisely as possible):
See above.
Anything else we need to know?:
There is a pull request in progress that attempts to fix this problem for all resources outside of the default namespace: PR 48922: . Another patch will be needed to handle fully-qualified resources in the kubernetes.io
domain.
Environment:
- Kubernetes version (use
kubectl version
): v1.7, recent master - Cloud provider or hardware configuration**: Local cluster
- OS (e.g. from /etc/os-release): Linux Mint 18.1, CentOS 7
- Kernel (e.g.
uname -a
): 4.4, 3.10 - Install tools: ./hack/local-up-cluster.sh
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (21 by maintainers)
Commits related to this issue
- Reject unknown container resource names. - Requires resource names in container requests and limits to be known to the system if in the *kubernetes.io/ namespace, or no namespace is specified. - ... — committed to ConnorDoyle/kubernetes by ConnorDoyle 7 years ago
- Merge pull request #61860 from mindprince/kubernetes.io-resources Automatic merge from submit-queue (batch tested with PRs 60073, 58519, 61860). If you want to cherry-pick this change to another bran... — committed to kubernetes/kubernetes by deleted user 6 years ago
I also think that we should add the check for kubernetes.io resources to the scheduler’s PodFitsResources predicate. We should probably make cpu and memory aliases for kubernetes.io/cpu and kubernetes.io/memory as well. AFAIK, this change should not cause any backward compatibility issues.
I would expect such pods to remain pending.