CKA Practice Dumps - Verified By PrepPDF Updated 63 Questions
Updated CKA Exam Dumps - PDF Questions and Testing Engine
Linux Foundation-CKA: Certified Kubernetes Administrator Exam Experience
- Kubernetes documentation is extremely vast. It is very important to traverse through the documentation couple of times to get hold of it as you have access to Kubernetes documentation during the exam.
- CNCF CKA practice test is a very refined and detailed test. This dump has all the minute details about Kubernetes if you are learning from scratch about the orchestrator.
- CNCF CKA dumps pdf has a lot of mock exams which will help you and give you a very clear understanding of Kubernetes. We recommend 2-3 practice attempts of each mock exam.
- You must have good hands-on Linux command line environment,since you will be dealing with files to edit, delete, save and so on.
NEW QUESTION 11
Create the service as type NodePort with the port 32767 for the nginx pod with the pod selector app: my-nginx
Answer:
Explanation:
kubectl run nginx --image=nginx --restart=Never -- labels=app=nginx --port=80 --dry-run -o yaml > nginx-pod.yaml
NEW QUESTION 12
Create a Cronjob with busybox image that prints date and hello from kubernetes cluster message for every minute
- A. CronJob Syntax:
* --> Minute
* --> Hours
* --> Day of The Month
* --> Month
* --> Day of the Week
*/1 * * * * --> Execute a command every one minutes.
vim date-job.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: date-job
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
kubectl apply -f date-job.yaml
//Verify
kubectl get cj date-job -o yaml - B. CronJob Syntax:
* --> Minute
* --> Hours
* --> Day of The Month
* --> Month
* --> Day of the Week
*/1 * * * * --> Execute a command every one minutes.
vim date-job.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: date-job
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
args:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
kubectl apply -f date-job.yaml
//Verify
kubectl get cj date-job -o yaml
Answer: B
NEW QUESTION 13
Create PersistentVolume named task-pv-volume with storage 10Gi, access modes ReadWriteMany, storageClassName manual, and volume at /mnt/data and Create a PersistentVolumeClaim of at least 3Gi storage and access mode ReadWriteOnce and verify
- A. vim task-pv-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/data"
kubectl apply -f task-pv-volume.yaml
//Verify
kubectl get pv
vim task-pvc-volume.yaml
apiVersion: v1
- ReadWriteMany
resources:
requests:
storage: 3Gi
kubectl apply -f task-pvc-volume.yaml
//Verify
Kuk kubectl get pvc - B. vim task-pv-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/data"
kubectl apply -f task-pv-volume.yaml
//Verify
kubectl get pv
vim task-pvc-volume.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: task-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 3Gi
kubectl apply -f task-pvc-volume.yaml
//Verify
Kuk kubectl get pvc
Answer: B
NEW QUESTION 14
Get list of all the nodes with labels
Answer:
Explanation:
kubectl get nodes --show-labels
NEW QUESTION 15
Score: 4%
Task
Create a persistent volume with name app-data , of capacity 1Gi and access mode ReadOnlyMany. The type of volume is hostPath and its location is /srv/app-data .
Answer:
Explanation:
See the solution below.
Explanation
Solution:
#vi pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-config
spec:
capacity:
storage: 1Gi
accessModes:
- ReadOnlyMany
hostPath:
path: /srv/app-config
#
kubectl create -f pv.yaml
NEW QUESTION 16
Evict all existing pods from a node-1 and make the node unschedulable for new pods.
- A. kubectl get nodes
kubectl drain node-1 #It will evict pods running on node-1 to
other nodes in the cluster
kubectl cordon node-1 # New pods cannot be scheduled to the
node
// Verify
kubectl get no
When you cordon a node, the status shows "SchedulingDisabled" - B. kubectl get nodes
kubectl drain node-1 #It will evict pods running on node-1 to
other nodes in the cluster
// Verify
kubectl get no
When you cordon a node, the status shows "SchedulingDisabled"
Answer: A
NEW QUESTION 17
Create a Pod nginx and specify a CPU request and a CPU limit of 0.5 and 1 respectively.
- A. // create a yml file
kubectl run nginx-pod --image=nginx --restart=Never --dry-run -
o yaml > nginx-pod.yml
// add the resources section and create
vim nginx-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
resources:
requests:
cpu: "0.5"
limits:
cpu: "1"
restartPolicy: Always
kubectl apply -f nginx-pod.yaml
// verify
kubectl top pod - B. // create a yml file
kubectl run nginx-pod --image=nginx --restart=Never --dry-run -
o yaml > nginx-pod.yml
// add the resources section and create
vim nginx-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
resources:
requests:
cpu: "0.4"
limits:
cpu: "1"
restartPolicy: Always
kubectl apply -f nginx-pod.yaml
// verify
kubectl top pod
Answer: A
NEW QUESTION 18
Create an nginx pod and load environment values from the above configmap "keyvalcfgmap" and exec into the pod and verify the environment variables and delete the pod
- A. // first run this command to save the pod yaml
kubectl run nginx --image=nginx --restart=Always --dry-run -o
yaml > nginx-pod.yml
// edit the yml to below file and create
vim nginx-pod.yml
apiVersion: v1
name: nginx
envFrom:
- configMapRef:
name: keyvalcfgmap
restartPolicy: Always
kubectl apply -f nginx-pod.yml
// verify
kubectl exec -it nginx -- env
kubectl delete po nginx - B. // first run this command to save the pod yaml
kubectl run nginx --image=nginx --restart=Always --dry-run -o
yaml > nginx-pod.yml
// edit the yml to below file and create
vim nginx-pod.yml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
envFrom:
- configMapRef:
name: keyvalcfgmap
restartPolicy: Always
kubectl apply -f nginx-pod.yml
// verify
kubectl exec -it nginx -- env
kubectl delete po nginx
Answer: B
NEW QUESTION 19
Print all pod name and all image name and write it to a file
name "/opt/pod-details.txt"
Answer:
Explanation:
kubectl get pods -o=custom-columns='Pod Name:metadata.name','Image:spec.containers[*].image' > /opt/pod-details.txt
NEW QUESTION 20
Score: 5%
Task
From the pod label name=cpu-utilizer, find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /opt/KUTR00401/KUTR00401.txt (which already exists).
Answer:
Explanation:
See the solution below.
Explanation
Solution:
kubectl top -l name=cpu-user -A
echo 'pod name' >> /opt/KUT00401/KUT00401.txt
NEW QUESTION 21
Create a configmap called cfgvolume with values var1=val1,
var2=val2 and create an nginx pod with volume nginx-volume which
reads data from this configmap cfgvolume and put it on the path
/etc/cfg
- A. // first create a configmap cfgvolume
kubectl create cm cfgvolume --from-literal=var1=val1 --fromliteral=var2=val2
// verify the configmap
kubectl describe cm cfgvolume
// create the config map
kubectl create -f nginx-volume.yml
vim nginx-configmap-pod.yaml
apiVersion: v1
kind: Pod
- name: nginx-volume
configMap:
name: cfgvolume
containers:
- image: nginx
name: nginx
volumeMounts:
- name: nginx-volume
mountPath: /etc/cfg
restartPolicy: Always
k kubectl apply -f nginx-configmap-pod.yaml
/ // Verify
// exec into the pod
kubectl exec -it nginx -- /bin/sh
// check the path
cd /etc/cfg - B. // first create a configmap cfgvolume
kubectl create cm cfgvolume --from-literal=var1=val1 --fromliteral=var2=val2
// verify the configmap
kubectl describe cm cfgvolume
// create the config map
kubectl create -f nginx-volume.yml
vim nginx-configmap-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
volumes:
- name: nginx-volume
configMap:
name: cfgvolume
containers:
- image: nginx
name: nginx
volumeMounts:
- name: nginx-volume
mountPath: /etc/cfg
restartPolicy: Always
k kubectl apply -f nginx-configmap-pod.yaml
/ // Verify
// exec into the pod
kubectl exec -it nginx -- /bin/sh
// check the path
cd /etc/cfg
Answer: B
NEW QUESTION 22
Get list of all the pods showing name and namespace with a jsonpath expression.
Answer:
Explanation:
kubectl get pods -o=jsonpath="{.items[*]['metadata.name' , 'metadata.namespace']}"
NEW QUESTION 23
Undo the deployment to the previous version 1.17.1 and verify Image has the previous version
Answer:
Explanation:
kubectl rollout undo deploy webapp kubectl describe deploy webapp | grep Image
NEW QUESTION 24
Scale the deployment webserver to
Answer:
Explanation:
See the solution below.
Explanation
solution
NEW QUESTION 25
A bootstrap USB flash drive has been prepared using a Windows workstation to load the initial configuration of a Palo Alto Networks firewall that was previously being used in a lab. The USB flash drive was formatted using file system FAT32 and the initial configuration is stored in a file named init-cfg.txt. The firewall is currently running PAN-OS 10.0 and using a lab config. The contents of init-cgf.txt in the USB flash drive are as follows:
type=dhcp-client
Ip-address=
default-gateway=
netmask=
Ipv6-address=
Ipv6-default-gateway=
hostname=Ca-FW-DC1
panorama-server=10.5.107.20
panorama-server-2=10.5.107.21
tplname=FINANCE_TG4
dgname=finance_dg
dns-primary=10.5.6.6
dns-secondary=10.5.6.7
op-command-modes-multi-vsys.jumbo-frame
dhcp-send-hostname=yes
dhcp-send-client-id=yes
dhcp-accept-server-hostname=yes
dhcp-accept-server-domain=yes
The USB flash drive has been inserted in the firewalls' USB port, and the firewall has been restarted using command> request restart system Upon restart, the firewall fails to begin the bootstrapping process. The failure is caused because:
- A. Firewall must be in factory default state or have all private data deleted for bootstrapping
- B. The bootstrap xml file is a required file, but it is missing
- C. The USB must be formatted using the exi3 file system, FAT32 is
- D. PAN-OS version must be 9.1 x at a minimum, but the firewall is running 10.0x
- E. The hostname is a required parameter, but it is missing in init-cfg.txt
Answer: C
NEW QUESTION 26
Create a deployment spec file that will:
* Launch 7 replicas of the nginx Image with the labelapp_runtime_stage=dev
* deployment name: kual00201
Save a copy of this spec file to /opt/KUAL00201/spec_deployment.yaml
(or /opt/KUAL00201/spec_deployment.json).
When you are done, clean up (delete) any new Kubernetes API object that you produced during this task.
Answer:
Explanation:
See the solution below.
Explanation
solution

NEW QUESTION 27
Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.
Answer:
Explanation:
See the solution below.
Explanation
kubectl create namespace development
kubectl run nginx --image=nginx --restart=Never -n development
NEW QUESTION 28
Create a pod as follows:
* Name:non-persistent-redis
* container Image:redis
* Volume with name:cache-control
* Mount path:/data/redis
The pod should launch in thestagingnamespace and the volumemust notbe persistent.
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION 29
Create a busybox pod and add "sleep 3600" command
Answer:
Explanation:
kubectl run busybox --image=busybox --restart=Never -- /bin/sh -c "sleep 3600"
NEW QUESTION 30
Print pod name and start time to "/opt/pod-status" file
Answer:
Explanation:
See the solution below.
Explanation
kubect1 get pods -o=jsonpath='{range
items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
NEW QUESTION 31
Create a redis pod named "test-redis" and exec into that pod and create a file named "test-file.txt" with the text 'This is called the test file' in the path /data/redis and open another tab and exec again with the same pod and verifies file exist in the same path.
- A. vim test-redis.yaml
apiVersion: v1
kind: Pod
metadata:
name: test-redis
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /data/redis
name: redis-storage
volumes:
kubectl exec -it test-redis /bin/sh
cd /data/redis
echo 'This is called the test file' > file.txt
//open another tab
kubectl exec -it test-redis /bin/sh
cat /data/redis/file.txt - B. vim test-redis.yaml
apiVersion: v1
kind: Pod
metadata:
name: test-redis
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /data/redis
name: redis-storage
volumes:
- name: redis-storage
emptyDir: {}
kubectl apply -f redis-pod-vol.yaml
// first terminal
kubectl exec -it test-redis /bin/sh
cd /data/redis
echo 'This is called the test file' > file.txt
//open another tab
kubectl exec -it test-redis /bin/sh
cat /data/redis/file.txt
Answer: B
NEW QUESTION 32
Perform the following tasks:
* Add an init container tohungry-bear(which has beendefined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
* The init container should createan empty file named/workdir/calm.txt
* If/workdir/calm.txtis notdetected, the pod should exit
* Once the spec file has beenupdatedwith the init containerdefinition, the pod should becreated
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION 33
Check the history of the specific revision of that deployment
Answer:
Explanation:
kubectl rollout history deploy webapp --revision=3
NEW QUESTION 34
Create a file:
/opt/KUCC00302/kucc00302.txt that lists all pods that implement service in namespace development.
The format of the file should be one pod name per line.
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION 35
......
Certification Path
There are no pre-requisites for Linux Foundation-CKA: Certified Kubernetes Administrator exam and the successful completion will give you the title of Certified Kubernetes Administrator
New (2022) Linux Foundation CKA Exam Dumps: https://www.preppdf.com/Linux-Foundation/CKA-prepaway-exam-dumps.html
Best Way To Study For Linux Foundation CKA Exam Brilliant CKA Exam Questions PDF: https://drive.google.com/open?id=1S6eI5kxMMybHisi67UClGOLdWhamnoBo