Professional Documents
Culture Documents
Linux-Foundation
Exam Questions CKA
Certified Kubernetes Administrator (CKA) Program
NEW QUESTION 1
Create a pod with environment variables as var1=value1.Check the environment variable in pod
A. Mastered
B. Not Mastered
Answer: A
Explanation:
kubectl run nginx --image=nginx --restart=Never --env=var1=value1
# then
kubectl exec -it nginx -- env
# or
kubectl exec -it nginx -- sh -c 'echo $var1'
# or
kubectl describe po nginx | grep value1
NEW QUESTION 2
Create a deployment as follows:
Name:nginx-random
Exposed via a servicenginx-random
Ensure that the service & podare accessible via theirrespective DNS records
The container(s) within anypod(s) running as a part of thisdeployment should use thenginxImage
Next, use the utilitynslookupto lookup the DNS records of the service &pod and write the output to
/opt/KUNW00601/service.dnsand/opt/KUNW00601/pod.dnsrespectively.
A. Mastered
B. Not Mastered
Answer: A
Explanation:
Solution:
F:\Work\Data Entry Work\Data Entry\20200827\CKA\17 C.JPG
NEW QUESTION 3
List ??nginx-dev?? and ??nginx-prod?? pod and delete those pods
A. Mastered
B. Not Mastered
Answer: A
Explanation:
kubect1 get pods -o wide
kubectl delete po ??nginx-dev??kubectl delete po ??nginx-prod??
NEW QUESTION 4
List all the pods sorted by name
A. Mastered
B. Not Mastered
Answer: A
Explanation:
kubect1 get pods --sort-by=.metadata.name
NEW QUESTION 5
Ensure a single instance of podnginxis running on each node of theKubernetes cluster wherenginxalso represents the Image name whichhas to be used. Do not
override anytaints currently in place.
UseDaemonSetto complete thistask and useds-kusc00201asDaemonSet name.
A. Mastered
B. Not Mastered
Answer: A
Explanation:
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\3 B.JPG
NEW QUESTION 6
Get list of all pods in all namespaces and write it to file ??/opt/pods-list.yaml??
A. Mastered
B. Not Mastered
Answer: A
Explanation:
kubectl get po ?Call-namespaces > /opt/pods-list.yaml
NEW QUESTION 7
Create a file:
/opt/KUCC00302/kucc00302.txtthatlists all pods that implement servicebazin namespacedevelopment.
The format of the file should be onepod name per line.
A. Mastered
B. Not Mastered
Answer: A
Explanation:
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 B.JPG
NEW QUESTION 8
Check the Image version of nginx-dev pod using jsonpath
A. Mastered
B. Not Mastered
Answer: A
Explanation:
kubect1 get po nginx-dev -o jsonpath='{.spec.containers[].image}{"\n"}'
NEW QUESTION 9
Create and configure the servicefront-end-serviceso it's accessiblethroughNodePortand routes to theexisting pod namedfront-end.
A. Mastered
B. Not Mastered
Answer: A
Explanation:
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\8 B.JPG
NEW QUESTION 10
Get IP address of the pod ?C ??nginx-dev??
A. Mastered
B. Not Mastered
Answer: A
Explanation:
Kubect1 get po -o wide Using JsonPath
kubect1 get pods -o=jsonpath='{range items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
NEW QUESTION 10
Create a pod that having 3 containers in it? (Multi-Container)
A. Mastered
B. Not Mastered
Answer: A
Explanation:
image=nginx, image=redis, image=consul Name nginx container as ??nginx-container?? Name redis container as ??redis-container?? Name consul container as
??consul-container??
Create a pod manifest file for a container and append container section for rest of the images
kubectl run multi-container --generator=run-pod/v1 --image=nginx -- dry-run -o yaml > multi-container.yaml
# then
vim multi-container.yaml apiVersion: v1
NEW QUESTION 12
Schedule a pod as follows:
Name: nginx-kusc00101
Image: nginx
Node selector: disk=ssd
A. Mastered
B. Not Mastered
Answer: A
Explanation:
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\6 B.JPG
NEW QUESTION 14
Print pod name and start time to ??/opt/pod-status?? file
A. Mastered
B. Not Mastered
Answer: A
Explanation:
kubect1 get pods -o=jsonpath='{range items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
NEW QUESTION 16
Check to see how many worker nodes are ready (not including nodes taintedNoSchedule) and write the number to/opt/KUCC00104/kucc00104.txt.
A. Mastered
B. Not Mastered
Answer: A
Explanation:
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\15 B.JPG
NEW QUESTION 19
......
* CKA Most Realistic Questions that Guarantee you a Pass on Your FirstTry
* CKA Practice Test Questions in Multiple Choice Formats and Updatesfor 1 Year