[Q19-Q40] Pass CKA Exam in First Attempt Guaranteed 100% Cover Real Exam Questions [Apr-2024]

Share

Pass CKA Exam in First Attempt Guaranteed 100% Cover Real Exam Questions [Apr-2024]

Valid CKA test answers & Linux Foundation CKA exam pdf


The CKA exam is designed to evaluate the candidate's ability to perform tasks related to Kubernetes administration. It is a performance-based exam that requires the candidate to complete tasks using Kubernetes command-line tools. CKA exam consists of 24 tasks that are divided into eight categories, including Application Lifecycle Management, Cluster Maintenance, Installation and Configuration, Networking, Storage, Security, Scheduling, and Logging and Monitoring.

 

NEW QUESTION # 19
Monitor the logs of pod foo and:
* Extract log lines corresponding unable-to-access-website
* Write them to/opt/KULM00201/foo

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 20
Check to see how many worker nodes are ready (not including nodes tainted NoSchedule) and write the number to /opt/KUCC00104/kucc00104.txt.

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 21
Undo/Rollback deployment to specific revision "1"

  • A. // Check Deployment History
    kubectl rollout history deployment webapp
    //Rollback to particular revision
    kubectl rollout undo deploymet webapp --to-revision=1
  • B. // Check Deployment History
    kubectl rollout history deployment webapp
    kubectl rollout undo deploymet webapp --to-revision=1

Answer: A


NEW QUESTION # 22
List all service account and create a service account called "admin"

  • A. kubectl get sa
    kubectl get sa --all-namespaces
    //Verify
    kubectl get sa admin -o yaml
  • B. kubectl get sa
    kubectl get sa --all-namespaces
    kubectl create sa admin
    //Verify
    kubectl get sa admin -o yaml

Answer: B


NEW QUESTION # 23
Modify "hello-job" and make it run 10 times one after one and 5 times parallelism: 5

  • A. kubectl create job hello-job --image=busybox --dry-run -o yaml
    -- echo "Hello I am from job" > hello-job.yaml
    // edit the yaml file to add completions: 16 and
    kubectl create -f hello-job.yaml
    YAML File:
    apiVersion: batch/v1
    kind: Job
    metadata:
    name: hello-job
    spec:
    completions: 16
    parallelism: 5
    template:
    metadata:
    spec:
    containers:
    - command:
    - echo
    - Hello I am from job
    image: busybox
    name: hello-job
    restartPolicy: Never
  • B. kubectl create job hello-job --image=busybox --dry-run -o yaml
    -- echo "Hello I am from job" > hello-job.yaml
    // edit the yaml file to add completions: 10 and
    kubectl create -f hello-job.yaml
    YAML File:
    apiVersion: batch/v1
    kind: Job
    metadata:
    name: hello-job
    spec:
    completions: 10
    parallelism: 5
    template:
    metadata:
    spec:
    containers:
    - command:
    - echo
    - Hello I am from job
    image: busybox
    name: hello-job
    restartPolicy: Never

Answer: B


NEW QUESTION # 24
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 # 25
What file type upload is supported as part of the basic WildFire service?

  • A. ELF
  • B. VBS
  • C. PE
  • D. BAT

Answer: C


NEW QUESTION # 26
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 # 27
Score: 4%

Task
Schedule a pod as follows:
* Name: nginx-kusc00401
* Image: nginx
* Node selector: disk=ssd

Answer:

Explanation:
See the solution below.
Explanation
Solution:
#yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-kusc00401
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
nodeSelector:
disk: spinning
#
kubectl create -f node-select.yaml


NEW QUESTION # 28
Create a deployment as follows:
* Name: nginx-random
* Exposed via a service nginx-random
* Ensure that the service & pod are accessible via their respective DNS records
* The container(s) within any pod(s) running as a part of this deployment should use the nginx Image Next, use the utility nslookup to look up the DNS records of the service & pod and write the output to
/opt/KUNW00601/service.dns and /opt/KUNW00601/pod.dns respectively.

Answer:

Explanation:
See the solution below.
Explanation
Solution:



NEW QUESTION # 29
Create a deployment as follows:
Name: nginx-random
Exposed via a service nginx-random
Ensure that the service & pod are accessible via their respective DNS records The container(s) within any pod(s) running as a part of this deployment should use the nginx Image Next, use the utility nslookup to look up the DNS records of the service & pod and write the output to /opt/KUNW00601/service.dns and /opt/KUNW00601/pod.dns respectively.

Answer:

Explanation:
Solution:



NEW QUESTION # 30
List all the pods showing name and namespace with a json path expression

Answer:

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


NEW QUESTION # 31
Create a busybox pod that runs the command "env" and save the output to "envpod" file

Answer:

Explanation:
kubectl run busybox --image=busybox --restart=Never --rm -it -- env > envpod.yaml


NEW QUESTION # 32
Create a daemonset named "Prometheus-monitoring" using image=prom/Prometheus which runs in all the nodes in the cluster. Verify the pod running in all the nodes

  • A. vim promo-ds.yaml
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
    name: prometheus-monitoring
    spec:
    selector:
    matchLabels:
    name: prometheus
    template:
    metadata:
    labels:
    name: prometheus
    spec:
    tolerations:
    # remove it if your masters can't run pods
    - key: node-role.kubernetes.io/master
    effect: NoSchedule
    containers:
    - name: prometheus-container
    image: prom/prometheus
    volumeMounts:
    - name: varlog
    mountPath: /var/log
    - name: varlibdockercontainers
    mountPath: /var/lib/docker/containers
    readOnly: true
    volumes:
    - name: varlog
    emptyDir: {}
    - name: varlibdockercontainers
    emptyDir: {}
    kubectl apply -f promo-ds.yaml
    NOTE: Deamonset will get scheduled to "default" namespace, to
    schedule deamonset in specific namespace, then add
    "namespace" field in metadata
    //Verify
    kubectl get ds
    NAME DESIRED CURRENT READY UP-TO-DATE
    AVAILABLE NODE SELECTOR AGE
    prometheus-monitoring 6 6 0 6
    0 <none> 7s
    kubectl get no # To get list of nodes in the cluster
    // There are 6 nodes in the cluster, so a pod gets scheduled to
    each node in the cluster
  • B. vim promo-ds.yaml
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
    name: prometheus-monitoring
    spec:
    selector:
    matchLabels:
    name: prometheus
    template:
    metadata:
    labels:
    name: prometheus
    spec:
    tolerations:
    # remove it if your masters can't run pods
    - key: node-role.kubernetes.io/master
    effect: NoSchedule
    containers:
    - name: prometheus-container
    - name: varlibdockercontainers
    mountPath: /var/lib/docker/containers
    readOnly: true
    volumes:
    - name: varlog
    emptyDir: {}
    - name: varlibdockercontainers
    emptyDir: {}
    kubectl apply -f promo-ds.yaml
    NOTE: Deamonset will get scheduled to "default" namespace, to
    schedule deamonset in specific namespace, then add
    "namespace" field in metadata
    //Verify
    kubectl get ds
    NAME DESIRED CURRENT READY UP-TO-DATE
    AVAILABLE NODE SELECTOR AGE
    prometheus-monitoring 8 8 0 6
    0 <none> 7s
    kubectl get no # To get list of nodes in the cluster
    // There are 6 nodes in the cluster, so a pod gets scheduled to
    each node in the cluster

Answer: A


NEW QUESTION # 33
Change the Image version back to 1.17.1 for the pod you just updated and observe the changes

Answer:

Explanation:
kubectl set image pod/nginx nginx=nginx:1.17.1 kubectl describe po nginx kubectl get po nginx -w # watch it


NEW QUESTION # 34
Score: 7%

Task
Given an existing Kubernetes cluster running version 1.20.0, upgrade all of the Kubernetes control plane and node components on the master node only to version 1.20.1.
Be sure to drain the master node before upgrading it and uncordon it after the upgrade.

You are also expected to upgrade kubelet and kubectl on the master node.

Answer:

Explanation:
SOLUTION:
[student@node-1] > ssh ek8s
kubectl cordon k8s-master
kubectl drain k8s-master --delete-local-data --ignore-daemonsets --force apt-get install kubeadm=1.20.1-00 kubelet=1.20.1-00 kubectl=1.20.1-00 --disableexcludes=kubernetes kubeadm upgrade apply 1.20.1 --etcd-upgrade=false systemctl daemon-reload systemctl restart kubelet kubectl uncordon k8s-master


NEW QUESTION # 35
Check the Image version of nginx-dev pod using jsonpath

Answer:

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


NEW QUESTION # 36
List all configmap and secrets in the cluster in all namespace and write it to a file /opt/configmap-secret

Answer:

Explanation:
kubectl get configmap,secrets --all-namespaces > /opt/configmap-secret // Verify Cat /opt/configmap-secret


NEW QUESTION # 37
Create a pod that echo "hello world" and then exists. Have the pod deleted automatically when it's completed

Answer:

Explanation:
kubectl run busybox --image=busybox -it --rm --restart=Never --
/bin/sh -c 'echo hello world'
kubectl get po # You shouldn't see pod with the name "busybox"


NEW QUESTION # 38
Create a snapshot of the etcd instance running at https://127.0.0.1:2379, saving the snapshot to the file path
/srv/data/etcd-snapshot.db.
The following TLS certificates/key are supplied for connecting to the server with etcdctl:
CA certificate: /opt/KUCM00302/ca.crt
Client certificate: /opt/KUCM00302/etcd-client.crt
Client key: Topt/KUCM00302/etcd-client.key

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\18 C.JPG


NEW QUESTION # 39
List all persistent volumes sorted by capacity, saving the full kubectl output to
/opt/KUCC00102/volume_list. Use kubectl 's own functionality for sorting the output, and do not manipulate it any further.

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\2 C.JPG


NEW QUESTION # 40
......

CKA Exam Questions – Valid CKA Dumps Pdf: https://www.freecram.com/Linux-Foundation-certification/CKA-exam-dumps.html

Verified CKA dumps Q&As - Pass Guarantee: https://drive.google.com/open?id=1gFnls3DoHUu8iyqakcTpuNKEDyMsCvCY

0
0
0
10