Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.06 KB

File metadata and controls

52 lines (37 loc) · 1.06 KB

Commands and Args

In this training, we will learn to create a customized Pod.

Navigate to the folder 03_cmd-and-args from CLI, before you get started.

Inspect and create the pod

cat pod.yaml
kubectl create -f pod.yaml

Take a look at the Pods

kubectl get pods

Why is the Pod not in RUNNING state?

Get more info about the Pod

Pay attention to the structure Last State:.

kubectl describe pod my-pod | grep -A4 "Last State:"

Add the following command and arguments to the container

...
- name: busybox
  image: busybox:1.32.0
  command: [ "sleep" ]
  args: [ "600" ]

Re-create the Pod

kubectl replace --force -f pod.yaml

Verify the pod state if running or not using kubectl get pods command. You will observe that issue is resolved and pod is in running state.

Cleanup

  • Delete the created resource - pod.
    kubectl delete pod my-pod

Jump to Home | Previous Training | Next Training