Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.51 KB

03-Practice-Test-Manual-Scheduling.md

File metadata and controls

69 lines (51 loc) · 1.51 KB

Practice Test - Manual Scheduling

Solutions to Practice Test - Manual Scheduling

  1. A pod definition file nginx.yaml is given. Create a pod using the file.
    kubectl create -f nginx.yaml
    
  2. What is the status of the created POD?
    kubectl get pods
    

    Examine the STATUS column

  3. Why is the POD in a pending state?
    Inspect the environment for various kubernetes control plane components.
    kubectl get pods --namespace kube-system
    

    There is a key pod missing here!

  4. Manually schedule the pod on node01.

    We will have to delete and recereate the pod, as the only property that may be edited on a running container is image

    vi nginx.yaml
    

    Make the following edit

    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: nginx
    spec:
      nodeName: node01    # add this line
      containers:
      -  image: nginx
         name: nginx
    kubectl delete -f nginx.yaml
    kubectl create -f nginx.yaml
    
  5. Now schedule the same pod on the controlplane node.

    Repeat the steps as per the previous question. Edit nodeName to be controlplane