ExamGecko
Home / Linux Foundation / CKA / List of questions
Ask Question

Linux Foundation CKA Practice Test - Questions Answers, Page 5

List of questions

Question 41

Report
Export
Collapse

Check the Image version of nginx-dev pod using jsonpath

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubect1 get po nginx-dev -o

jsonpath='{.spec.containers[].image}{"\n"}'

asked 18/09/2024
Alan Coutinho
42 questions

Question 42

Report
Export
Collapse

Create a busybox pod and add "sleep 3600" command

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubectl run busybox --image=busybox --restart=Never -- /bin/sh -c

"sleep 3600"

asked 18/09/2024
Dennis Spring
45 questions

Question 43

Report
Export
Collapse

Create an nginx pod and list the pod with different levels of verbosity

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

// create a pod

kubectl run nginx --image=nginx --restart=Never --port=80

// List the pod with different verbosity

kubectl get po nginx --v=7

kubectl get po nginx --v=8

kubectl get po nginx --v=9

asked 18/09/2024
Michael Ulrich
41 questions

Question 44

Report
Export
Collapse

List the nginx pod with custom columns POD_NAME and POD_STATUS

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubectl get po -o=custom-columns="POD_NAME:.metadata.name,

POD_STATUS:.status.containerStatuses[].state"

asked 18/09/2024
SERGIO MELOSEVICH
45 questions

Question 45

Report
Export
Collapse

List all the pods sorted by name

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubectl get pods --sort-by=.metadata.name

asked 18/09/2024
Hany Mohammed
35 questions

Question 46

Report
Export
Collapse

List all the pods sorted by created timestamp

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubect1 get pods--sort-by=.metadata.creationTimestamp

asked 18/09/2024
janet phillips
36 questions

Question 47

Report
Export
Collapse

List all the pods showing name and namespace with a json path expression

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubectl get pods -o=jsonpath="{.items[*]['metadata.name',

'metadata.namespace']}"

asked 18/09/2024
EDDIE LIN
43 questions

Question 48

Report
Export
Collapse

List "nginx-dev" and "nginx-prod" pod and delete those pods

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

kubect1 get pods -o wide

kubectl delete po "nginx-dev"

kubectl delete po "nginx-prod"

asked 18/09/2024
Yassin Benjajji
37 questions

Question 49

Report
Export
Collapse

Score: 4%

Linux Foundation CKA image Question 49 51428 09182024211423000000

Context

You have been asked to create a new ClusterRole for a deployment pipeline and bind it to a specific

ServiceAccount scoped to a specific namespace.

Task

Create a new ClusterRole named deployment-clusterrole, which only allows to create the following resource types:

• Deployment

• StatefulSet

• DaemonSet

Create a new ServiceAccount named cicd-token in the existing namespace app-team1.

Bind the new ClusterRole deployment-clusterrole lo the new ServiceAccount cicd-token , limited to the namespace app-team1.

See the solution below.
See the solution below.
Suggested answer: A

Explanation:

Solution:

Task should be complete on node k8s -1 master, 2 worker for this connect use command

[student@node-1] > ssh k8s

kubectl create clusterrole deployment-clusterrole --verb=create --

resource=deployments,statefulsets,daemonsets

kubectl create serviceaccount cicd-token --namespace=app-team1

kubectl create rolebinding deployment-clusterrole --clusterrole=deployment-clusterrole --

serviceaccount=default:cicd-token --namespace=app-team1

asked 18/09/2024
Mohamed Hany
42 questions

Question 50

Report
Export
Collapse

Score: 4%

Linux Foundation CKA image Question 50 51429 09182024211423000000

Task

Set the node named ek8s-node-1 as unavailable and reschedule all the pods running on it.

Become a Premium Member for full access
  Unlock Premium Member
Total 67 questions
Go to page: of 7