CentaurusInfra / arktos

Arktos for large-scale cloud platform
Apache License 2.0
245 stars 69 forks source link

Pod in a tenant created namespace does not get scheduled #379

Closed vinaykul closed 4 years ago

vinaykul commented 4 years ago

What happened:

  1. As tenant-admin create a namespace: kubectl create ns foo
  2. Create a pod in that namespace: kubectl -n foo create -f 1pod.yaml
  3. Get pod: kubectl get po --all-namespaces -owide
  4. Describe pod 1pod to check status.

What you expected to happen: 1pod should come up and running.

How to reproduce it (as minimally and precisely as possible):

root@ip-172-31-38-225:~/ARK# cat ~/YML/1pod.yml 
apiVersion: v1
kind: Pod
metadata:
  name: 1pod
spec:
  restartPolicy: OnFailure
  terminationGracePeriodSeconds: 2
  containers:
  - name: stress
    image: skiibum/ubuntu-stress:18.10
    resources:
      limits:
        cpu: "2"
        memory: "2Gi"
        ephemeral-storage: "1Gi"
      requests:
        cpu: "1"
        memory: "1Gi"
        ephemeral-storage: "1Gi"

root@ip-172-31-38-225:~/ARK# kubectl create ns foo
namespace/foo created
root@ip-172-31-38-225:~/ARK# kubectl -n foo create -f ../YML/1pod.yml 
pod/1pod created
root@ip-172-31-38-225:~/ARK#
root@ip-172-31-38-225:~/ARK# kubectl get ns -owide
NAME          STATUS   AGE     TENANT
default       Active   4h18m   vinay-1
foo           Active   4m50s   vinay-1
kube-public   Active   4h18m   vinay-1
kube-system   Active   4h18m   vinay-1
root@ip-172-31-38-225:~/ARK# kubectl get po --all-namespaces -owide
NAMESPACE   NAME   HASHKEY               READY   STATUS    RESTARTS   AGE     IP            NODE               NOMINATED NODE   READINESS GATES
default     1pod   6781352353242108456   1/1     Running   0          72m     10.88.26.75   ip-172-31-27-125   <none>           <none>
foo         1pod   5994107185650809231   0/1     Pending   0          2m54s   <none>        <none>             <none>           <none>
root@ip-172-31-38-225:~/ARK#

Anything else we need to know?:

Environment:

pdgetrf commented 4 years ago

I am able to create a namespace and then create a pod in it, and it goes into running:

image

what was the reason of pending in your test?

vinaykul commented 4 years ago

It was resource constraint for scheduling. The describe command didn't show scheduling failed due to no suitable node available - out of resource. It was just empty - I was under the impression it should show some error in describe. Anyways. closing this as it works as expected.