CKA Certification - Valid Exam Dumps Questions Study Guide! (Updated 63 Questions) [Q24-Q48]

Share

CKA Certification – Valid Exam Dumps Questions Study Guide! (Updated 63 Questions)

CKA Dumps are Available for Instant Access using  ActualTestsQuiz 


How to book the Linux Foundation-CKA: Certified Kubernetes Administrator Exam

To register for the CKA exam, go to CNCF Website.


Difficulty in Attempting Linux Foundation-CKA: Certified Kubernetes Administrator Exam

CKA is a tough exam. Mainly because it focuses on your ability to perform on a practical level rather than just asking a bunch of MCQ questions that would test your knowledge. If the user has successfully passed the CNCF CKA practice exam and has been through CNCF CKA exam dumps then the certification exam will not be too much difficult as the user has shown aptitude for understanding complicated processes.

 

NEW QUESTION 24
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 the staging be persistent.

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\13 B.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\13 C.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\13 D.JPG

 

NEW QUESTION 25
Create a deployment as follows:
Name: nginx-app
Using container nginx with version 1.11.10-alpine
The deployment should contain
Next, deploy the application with new version , by performing a rolling update.
Finally, rollback that update to the previous version

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\7 B.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\7 C.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\7 D.JPG

 

NEW QUESTION 26
Create a job named "hello-job" with the image busybox which echos "Hello I'm running job"

  • A. kubectl create job hello-job --image=busybox --dry-run -o yaml
    -- echo "Hello I'm running job" > hello-job.yaml
    kubectl create -f hello-job.yaml
    //Verify Job
    kubectl get po
    kubectl logs hello-job-*
  • B. kubectl create job hello-job --image=busybox --dry-run -o yaml
    -- echo "Hello I'm running job" > hello-job.yaml
    kubectl create -f hello-job.yaml
    //Verify Job
    kubectl get job
    kubectl get po
    kubectl logs hello-job-*

Answer: B

 

NEW QUESTION 27
Create a Pod nginx and specify both CPU, memory requests and limits together and verify.

  • A. kubectl run nginx-request --image=nginx --restart=Always --dryrun -o yaml > nginx-request.yml
    // add the resources section and create
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: nginx
    name: nginx
    resources:
    requests:
    memory: "100Mi"
    cpu: "0.4"
    limits:
    memory: "200Mi"
    cpu: "7"
    restartPolicy: Always
    k kubectl apply -f nginx-request.yaml
    // Verify
    Kubectl top po
  • B. kubectl run nginx-request --image=nginx --restart=Always --dryrun -o yaml > nginx-request.yml
    // add the resources section and create
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: nginx
    name: nginx-request
    spec:
    containers:
    - image: nginx
    name: nginx
    resources:
    requests:
    memory: "100Mi"
    cpu: "0.5"
    limits:
    memory: "200Mi"
    cpu: "1"
    restartPolicy: Always
    k kubectl apply -f nginx-request.yaml
    // Verify
    Kubectl top po

Answer: B

 

NEW QUESTION 28
Change the label for one of the pod to env=uat and list all the pods to verify

Answer:

Explanation:
kubectl label pod/nginx-dev3 env=uat --overwrite kubectl get pods --show-labels

 

NEW QUESTION 29
Get the memory and CPU usage of all the pods and find out top 3 pods which have the highest usage and put them into the cpuusage.txt file

  • A. // Get the top 3 pods
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -8
    // putting into file
    kubectl top pod --all-namespaces | sort --reverse --key 6 --
    numeric | head -6 > cpu-usage.txt
    // verify
    cat cpu-usage.txt
  • B. // Get the top 3 pods
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -3
    // putting into file
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -3 > cpu-usage.txt
    // verify
    cat cpu-usage.txt

Answer: B

 

NEW QUESTION 30
Pause the rollout of the deployment

Answer:

Explanation:
kubectl rollout pause deploy webapp

 

NEW QUESTION 31
List all the pods sorted by created timestamp

Answer:

Explanation:
See the solution below.
Explanation
kubect1 get pods--sort-by=.metadata.creationTimestamp

 

NEW QUESTION 32
Undo the deployment with the previous version and verify
everything is Ok

Answer:

Explanation:
kubectl rollout undo deploy webapp kubectl rollout status deploy webapp kubectl get pods

 

NEW QUESTION 33
Check logs of each container that "busyboxpod-{1,2,3}"

  • A. kubectl logs busybox -c busybox-container-1
    kubectl logs busybox -c busybox-container-3
    kubectl logs busybox -c busybox-container-3
  • B. kubectl logs busybox -c busybox-container-1
    kubectl logs busybox -c busybox-container-2
    kubectl logs busybox -c busybox-container-3

Answer: B

 

NEW QUESTION 34
Check the image version in pod without the describe command

Answer:

Explanation:
kubectl get po nginx -o jsonpath='{.spec.containers[].image}{"\n"}'

 

NEW QUESTION 35
Create a pod with init container which waits for a service called "myservice" to be created. Once init container completes, the myapp-container should start and print a message "The app is running" and sleep for 3600 seconds.

  • A. vim multi-container-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: myapp-pod
    labels:
    app: myapp
    spec:
    containers:
    - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep
    3600']
    initContainers:
    - name: init-myservice
    image: busybox:1.28
    command: ['sh', '-c', "until nslookup myservice.$(cat
    /var/run/secrets/kubernetes.io/serviceaccount/namespace).s
    vc.cluster.local; do echo waiting for myservice; sleep 2;
    done"]
    // Check whether service called "myservice" exists
    kubectl get svc
    Note: Pod will not start if service called "myservice" doesn't
    exist.
    // Now, Create the pod
    kubectl apply -f multi-container-pod.yaml
  • B. vim multi-container-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: myapp-pod
    labels:
    app: myapp
    spec:
    containers:
    - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep
    3600']
    initContainers:
    - name: init-myservice
    done"]
    // Check whether service called "myservice" exists
    kubectl get svc
    Note: Pod will not start if service called "myservice" doesn't
    exist.
    // Now, Create the pod
    kubectl apply -f multi-container-pod.yaml

Answer: A

 

NEW QUESTION 36
Create a persistent volume with name app-data, of capacity 2Gi and access mode ReadWriteMany. The type of volume is hostPath and its location is /srv/app-data.

Answer:

Explanation:
See the solution below.
Explanation
solution
Persistent Volume
A persistent volume is a piece of storage in a Kubernetes cluster. PersistentVolumes are a cluster-level resource like nodes, which don't belong to any namespace. It is provisioned by the administrator and has a particular file size. This way, a developer deploying their app on Kubernetes need not know the underlying infrastructure. When the developer needs a certain amount of persistent storage for their application, the system administrator configures the cluster so that they consume the PersistentVolume provisioned in an easy way.
Creating Persistent Volume
kind: PersistentVolumeapiVersion: v1metadata: name:app-dataspec: capacity: # defines the capacity of PV we are creating storage: 2Gi #the amount of storage we are tying to claim accessModes: # defines the rights of the volume we are creating - ReadWriteMany hostPath: path: "/srv/app-data" # path to which we are creating the volume Challenge
* Create a Persistent Volume named ReadWriteMany, storage classname
shared, 2Gi of storage capacity and the host path

2. Save the file and create the persistent volume.
Image for post

3. View the persistent volume.

* Our persistent volume status is available meaning it is available and it has not been mounted yet. This status will change when we mount the persistentVolume to a persistentVolumeClaim.
PersistentVolumeClaim
In a real ecosystem, a system admin will create the PersistentVolume then a developer will create a PersistentVolumeClaim which will be referenced in a pod. A PersistentVolumeClaim is created by specifying the minimum size and the access mode they require from the persistentVolume.
Challenge
* Create a Persistent Volume Claim that requests the Persistent Volume we had created above. The claim should request 2Gi. Ensure that the Persistent Volume Claim has the same storageClassName as the persistentVolume you had previously created.
kind: PersistentVolumeapiVersion: v1metadata: name:
spec:
accessModes: - ReadWriteMany
requests: storage: 2Gi
storageClassName: shared
2. Save and create the pvc
njerry191@cloudshell:~ (extreme-clone-2654111)$ kubect1 create -f app-data.yaml persistentvolumeclaim/app-data created
3. View the pvc
Image for post

4. Let's see what has changed in the pv we had initially created.
Image for post

Our status has now changed from available to bound.
5. Create a new pod named myapp with image nginx that will be used to Mount the Persistent Volume Claim with the path /var/app/config.
Mounting a Claim
apiVersion: v1kind: Podmetadata: creationTimestamp: null name: app-dataspec: volumes: - name:congigpvc persistenVolumeClaim: claimName: app-data containers: - image: nginx name: app volumeMounts: - mountPath: "/srv/app-data " name: configpvc

 

NEW QUESTION 37
List all the pods sorted by created timestamp

Answer:

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

 

NEW QUESTION 38
For this item, you will have to ssh to the nodes ik8s-master-0 and ik8s-node-0 and complete all tasks on these nodes. Ensure that you return to the base node (hostname: node-1) when you have completed this item.
Context
As an administrator of a small development team, you have been asked to set up a Kubernetes cluster to test the viability of a new application.
Task
You must use kubeadm to perform this task. Any kubeadm invocations will require the use of the
--ignore-preflight-errors=all option.
* Configure the node ik8s-master-O as a master node. .
* Join the node ik8s-node-o to the cluster.

Answer:

Explanation:
See the solution below.
Explanation
solution
You must use the kubeadm configuration file located at /etc/kubeadm.conf when initializingyour cluster.
You may use any CNI plugin to complete this task, but if you don't have your favourite CNI plugin's manifest URL at hand, Calico is one popular option: https://docs.projectcalico.org/v3.14/manifests/calico.yaml Docker is already installed on both nodes and has been configured so that you can install the required tools.

 

NEW QUESTION 39
Create and configure the service front-end-service so it's accessible through NodePort and routes to the existing pod named front-end.

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\8 B.JPG

 

NEW QUESTION 40
// Create a configmap
kubectl create configmap redis-config --from-file=/opt/redisconfig
// Verify
kubectl get configmap redis-config -o yaml
// first run this command to save the pod yml
kubectl run redis-pod --image=redis --restart=Always --dry-run
-o yaml > redis-pod.yml
// edit the yml to below file and create
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
env:
- name: MASTER
value: "true"
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /redis-master-data
name: data
- mountPath: /redis-master
name: config
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: example-redis-config

  • A. items:
    - key: redis-config
    path: redis.conf
    cf
    kk kubectl apply -f redis-pod.yml
    // // Verify
    K kubectl exec -it redis - cat /redis-master-data/redis.conf
  • B. items:
    - key: redis-config
    path: redis.conf
    cf
    // // Verify
    K kubectl exec -it redis - cat /redis-master-data/redis.conf

Answer: A

 

NEW QUESTION 41
Verify certificate expiry date for ca certificate in /etc/kubernetes/pki

Answer:

Explanation:
openssl x509 -in ca.crt -noout -text | grep -i validity -A 4

 

NEW QUESTION 42
Create a redis pod, and have it use a non-persistent storage
(volume that lasts for the lifetime of the Pod)

  • A. vim redis-pod-vol.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: redis
    spec:
    containers:
    - name: redis
    image: redis
    ports:
    - containerPort: 6679
    volumeMounts:
    - mountPath: /data
    name: redis-storage
    volumes:
    - name: redis-storage
    emptyDir: {}
    kubectl apply -f redis-pod-vol.yaml
  • B. vim redis-pod-vol.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: redis
    spec:
    containers:
    - name: redis
    image: redis
    ports:
    - containerPort: 6379
    volumeMounts:
    - mountPath: /data
    name: redis-storage
    volumes:
    - name: redis-storage
    emptyDir: {}
    kubectl apply -f redis-pod-vol.yaml

Answer: B

 

NEW QUESTION 43
Score: 13%

Task
A Kubernetes worker node, named wk8s-node-0 is in state NotReady. Investigate why this is the case, and perform any appropriate steps to bring the node to a Ready state, ensuring that any changes are made permanent.

Answer:

Explanation:
See the solution below.
Explanation
Solution:
sudo -i
systemctl status kubelet
systemctl start kubelet
systemctl enable kubelet

 

NEW QUESTION 44
Create a busybox pod which executes this command sleep 3600 with the service account admin and verify

  • A. kubectl run busybox --image=busybox --restart=Always --dry-run
    -o yaml -- /bin/sh -c "sleep 3600" > busybox.yml
    // Edit busybox.yaml file
    apiVersion: v1
    kind: Pod
    metadata:
    creationTimestamp: null
    labels:
    run: busybox
    name: busybox
    spec:
    serviceAccountName: admin
    containers:
    - args:
    - /bin/sh
    - -c
    - sleep 3600
    image: busybox
    name: busybox
    restartPolicy: Always
    // verify
    K kubectl describe po busybox
  • B. kubectl run busybox --image=busybox --restart=Always --dry-run
    -o yaml -- /bin/sh -c "sleep 3600" > busybox.yml
    // Edit busybox.yaml file
    apiVersion: v1
    kind: Pod
    metadata:
    creationTimestamp: null
    labels:
    run: busybox
    name: busybox
    spec:
    serviceAccountName: admin
    containers:
    - args:
    - /bin/sh
    - -c
    - sleep 3800
    image: busybox
    name: busybox
    restartPolicy: Always
    // verify
    K kubectl describe po busybox

Answer: A

 

NEW QUESTION 45
Create a Pod with main container busybox and which executes this
"while true; do echo 'Hi I am from Main container' >>
/var/log/index.html; sleep 5; done" and with sidecar container
with nginx image which exposes on port 80. Use emptyDir Volume
and mount this volume on path /var/log for busybox and on path
/usr/share/nginx/html for nginx container. Verify both containers
are running.

  • A. // create an initial yaml file with this
    kubectl run multi-cont-pod --image=busbox --restart=Never --
    dry-run -o yaml > multi-container.yaml
    // edit the yml as below and create it
    kubectl create -f multi-container.yaml
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-cont-pod
    name: multi-cont-pod
    spec:
    volumes:
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo 'Hi I am from Main
    container' >> /var/log/index.html; sleep 5;done"]
    name: main-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log
    - image: nginx
    name: sidecar-container
    ports:
    mountPath: /usr/share/nginx/html
    restartPolicy: Never
    // Create Pod
    kubectl apply -f multi-container.yaml
    //Verify
    kubectl get pods
  • B. // create an initial yaml file with this
    kubectl run multi-cont-pod --image=busbox --restart=Never --
    dry-run -o yaml > multi-container.yaml
    // edit the yml as below and create it
    kubectl create -f multi-container.yaml
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-cont-pod
    name: multi-cont-pod
    spec:
    volumes:
    - name: var-logs
    emptyDir: {}
    containers:
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo 'Hi I am from Main
    container' >> /var/log/index.html; sleep 5;done"]
    name: main-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log
    - image: nginx
    name: sidecar-container
    ports:
    - containerPort: 80
    volumeMounts:
    - name: var-logs
    mountPath: /usr/share/nginx/html
    restartPolicy: Never
    // Create Pod
    kubectl apply -f multi-container.yaml
    //Verify
    kubectl get pods

Answer: B

 

NEW QUESTION 46
Create a nginx pod that will be deployed to node with the label
"gpu=true"

  • A. kubectl run nginx --image=nginx --restart=Always --dry-run -o
    yaml > nodeselector-pod.yaml
    // add the nodeSelector like below and create the pod
    kubectl apply -f nodeselector-pod.yaml
    vim nodeselector-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: nginx
    spec:
    nodeSelector:
    gpu: true
    yaml
    //Verify
    kubectl get no -show-labels
    kubectl get po
    kubectl describe po nginx | grep Node-Selectors
  • B. kubectl run nginx --image=nginx --restart=Always --dry-run -o
    yaml > nodeselector-pod.yaml
    // add the nodeSelector like below and create the pod
    kubectl apply -f nodeselector-pod.yaml
    vim nodeselector-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: nginx
    spec:
    nodeSelector:
    gpu: true
    containers:
    - image: nginx
    name: nginx
    restartPolicy: Always
    kubectl apply -f nodeselector-pod.yaml
    //Verify
    kubectl get no -show-labels
    kubectl get po
    kubectl describe po nginx | grep Node-Selectors

Answer: B

 

NEW QUESTION 47
To protect your firewall and network from single source denial of service (DoS) attacks that can overwhelm its packet buffer and cause legitimate traffic to drop, you can configure:

  • A. PGP (Packet Gateway Protocol)
  • B. BGP (Border Gateway Protocol)
  • C. PBP (Packet Buffer Protection)
  • D. PBP (Protocol Based Protection)

Answer: D

 

NEW QUESTION 48
......


Understanding of functional and technical aspects of Services & Networking

The following will be discussed in CNCF CKA dumps:

  • Learn to be able to attract or repel pods from nodes or other pods. You can ensure pods run on nodes where they are intended to run and achieve other objectives such as high-availability by distributing pods across nodes.
  • Implement backups and restore methodologies
  • Analyze some pro tips on how to effectively use Kubectl. What you learn here will be useful for administering a cluster and using Kubernetes in general.
  • Learn to think about using Kubernetes for the long term when you need to consider how you’ll manage and update resources.
  • Learn how to control internal and external access to applications running in a Kubernetes cluster.
  • Install Kubernetes master and worker nodes including TLS bootstrapping
  • Understand host networking configuration of the cluster nodes
  • Know how to use Ingress controllers and Ingress resources
  • Understand ClusterIP, NodePort, LoadBalancer service types and endpoints
  • Understand connectivity between Pods
  • Test Kubernetes clusters
  • Perform Kubernetes cluster upgrades
  • Know how to configure and use CoreDNS
  • Choose an appropriate container network interface plugin
  • Evaluate different Kubernetes cluster configurations

 

Linux Foundation CKA Exam Practice Test Questions: https://www.actualtestsquiz.com/CKA-test-torrent.html

CKA Dumps 2022 - New Linux Foundation CKA Exam Questions: https://drive.google.com/open?id=11b-WNVDoBDizn1iJnayflydFgMq7eMLP