You were asked to create a command that will display a status of a pod pod1 in namespace ns1. What will you do?

Experience Level: Junior
Tags: Kubernetes

Answer

Option 1:

Run the following command:

echo "kubectl describe pod busybox -n default|grep -i Status:" > get-status.sh

Option 2:

Run the following command:

echo "kubectl get pod busybox -n default --no-headers|awk '{print $3}'" > get-status.sh

Option 3:

Run the following command:

echo "kubectl get pod busybox -n default -o jsonpath='{.status.phase}'" > get-status.sh

To run the Shell file, run the following:

sh get-status.sh

Kubernetes Certified Application Developer (CKAD) preparation
Kubernetes Certified Application Developer (CKAD) preparation

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes
Kubernetes

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes Certified Administrator (CKA) preparation
Kubernetes Certified Administrator (CKA) preparation

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself