CKA Dumps

CKA Free Practice Test

Linux-Foundation CKA: Certified Kubernetes Administrator (CKA) Program

QUESTION 1

Score:7%
CKA dumps exhibit
Task
Create a new PersistentVolumeClaim
• Name: pv-volume
• Class: csi-hostpath-sc
• Capacity: 10Mi
Create a new Pod which mounts the PersistentVolumeClaim as a volume:
• Name: web-server
• Image: nginx
• Mount path: /usr/share/nginx/html
Configure the new Pod to have ReadWriteOnce access on the volume.
Finally, using kubectl edit or kubectl patch expand the PersistentVolumeClaim to a capacity of 70Mi and record that change.
Solution:
Solution:
vi pvc.yaml storageclass pvc apiVersion: v1
kind: PersistentVolumeClaim metadata:
name: pv-volume spec: accessModes:
- ReadWriteOnce volumeMode: Filesystem resources:
requests: storage: 10Mi
storageClassName: csi-hostpath-sc
# vi pod-pvc.yaml apiVersion: v1 kind: Pod metadata:
name: web-server spec:
containers:
- name: web-server image: nginx volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: my-volume volumes:
- name: my-volume persistentVolumeClaim: claimName: pv-volume
# craete
kubectl create -f pod-pvc.yaml
#edit
kubectl edit pvc pv-volume --record

Does this meet the goal?

Correct Answer: A

QUESTION 2

Score:7%
CKA dumps exhibit
Context
An existing Pod needs to be integrated into the Kubernetes built-in logging architecture (e. g. kubectl logs). Adding a streaming sidecar container is a good and common way to accomplish this requirement.
Task
Add a sidecar container named sidecar, using the busybox Image, to the existing Pod big-corp-app. The new sidecar container has to run the following command:
/bin/sh -c tail -n+1 -f /va r/log/big-corp-app.log
Use a Volume, mounted at /var/log, to make the log file big-corp-app.log available to the sidecar container.
CKA dumps exhibit
Solution:

Solution:
#
kubectl get pod big-corp-app -o yaml
#
apiVersion: v1 kind: Pod metadata:
name: big-corp-app spec:
containers:
- name: big-corp-app image: busybox
args:
- /bin/sh
- -c
- > i=0;
while true; do
echo "$(date) INFO $i" >> /var/log/big-corp-app.log; i=$((i+1));
sleep 1; done
volumeMounts:
- name: logs mountPath: /var/log
- name: count-log-1 image: busybox
args: [/bin/sh, -c, 'tail -n+1 -f /var/log/big-corp-app.log'] volumeMounts:
- name: logs mountPath: /var/log volumes:
- name: logs emptyDir: {
}
#
kubectl logs big-corp-app -c count-log-1

Does this meet the goal?

Correct Answer: A

QUESTION 3

Create a nginx pod with label env=test in engineering namespace
Solution:
kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --dry-run -o yaml > nginx-pod.yaml
kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --dry-run -o yaml | kubectl create -n engineering -f –
YAML File: apiVersion: v1 kind: Pod metadata: name: nginx
namespace: engineering labels:
env: test spec: containers:
- name: nginx image: nginx
imagePullPolicy: IfNotPresent restartPolicy: Never
kubectl create -f nginx-pod.yaml

Does this meet the goal?

Correct Answer: A

QUESTION 4

Perform the following tasks:
CKA dumps exhibit Add an init container to hungry-bear (which has been defined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
CKA dumps exhibit The init container should create an empty file named/workdir/calm.txt
CKA dumps exhibit If /workdir/calm.txt is not detected, the pod should exit
CKA dumps exhibit Once the spec file has been updated with the init container definition, the pod should be created
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA4 B.JPG
CKA dumps exhibit
F:WorkData Entry WorkData Entry20200827CKA4 C.JPG
CKA dumps exhibit
F:WorkData Entry WorkData Entry20200827CKA4 D.JPG
CKA dumps exhibit

Does this meet the goal?

Correct Answer: A

QUESTION 5

Task Weight: 4%
CKA dumps exhibit
Task
Scale the deployment webserver to 3 pods.
Solution:
Solution:
CKA dumps exhibit

Does this meet the goal?

Correct Answer: A