Skip to content

Latest commit

 

History

History
125 lines (82 loc) · 2.35 KB

File metadata and controls

125 lines (82 loc) · 2.35 KB

Practice Test - PODs

Here are the solutions to the practice test

  1. Run the command kubectl get pods and count the number of pods.

    $ kubectl get pods
    
  2. Run the command kubectl run nginx --image=nginx

    $ kubectl run nginx --image=nginx
    
  3. Run the command kubectl get pods and count the number of pods.

    $ kubectl get pods
    
  4. Run the command **kubectl describe pod newpods**' look under the containers section.

    $ kubectl describe pod newpods
    
  5. Run the command kubectl describe pod newpods or kubectl get pods -o wide look under the containers section.

    $ kubectl describe pod newpods
    
  6. Run the command kubectl describe pod webapp and look under the Containers section (or) Run kubectl get pods and look under the READY section

    $ kubectl describe pod webapp
    
  7. Run the command kubectl describe pod webapp and look under the containers section.

    $ kubectl describe pod webapp
    
  8. Run the command kubectl describe pod webapp and look under the containers section.

    $ kubectl describe pod webapp
    
  9. Run the command kubectl describe pod webapp and look under the events section.

    $ kubectl describe pod webapp
    
  10. Run the command kubectl get pods

    $ kubectl get pods
    
  11. Run the command kubectl delete pod webapp

    $ kubectl delete pod webapp
    
  12. Create a pod definition YAML file and use it to create a POD or use the command kubectl run redis --image=redis123

    $ kubectl run redis --image=redis123
    
  13. Now fix the image on the pod to redis. Update the pod-definition file and use kubectl apply command or use kubectl edit pod redis command.

    $ kubectl apply
    $ kubectl edit pod redis