2024 Updated Verified CKA Q&As - Pass Guarantee or Full Refund [Q24-Q48]

Share

2024 Updated Verified CKA Q&As - Pass Guarantee or Full Refund

[Jan-2024] CKA Certification with Actual Questions from TestkingPass


The CKA exam is a hands-on, performance-based exam that requires candidates to complete a set of practical tasks within a given time frame. CKA exam is conducted on a live Kubernetes cluster, and candidates are evaluated based on their ability to perform tasks such as creating and managing pods, configuring networking, and troubleshooting common issues. CKA exam is designed to test the skills of candidates in a real-world scenario, and it is considered one of the most challenging and prestigious certifications in the field of Kubernetes.

 

NEW QUESTION # 24
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 # 25
List "nginx-dev" and "nginx-prod" pod and delete those pods

Answer:

Explanation:
See the solution below.
Explanation
kubect1 get pods -o wide
kubectl delete po "nginx-dev"kubectl delete po "nginx-prod"


NEW QUESTION # 26
Create an nginx pod with containerPort 80 and it should check the pod running at endpoint / healthz on port 80 and verify and delete the pod.

  • A. kubectl run nginx --image=nginx --restart=Always --port=80 --
    dry-run -o yaml > nginx-pod.yaml
    // add the livenessProbe section and create
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    containers:
    - image: nginx
    name: nginx
    ports:
    - containerPort: 60
    livenessProbe:
    httpGet:
    path: /healthz
    port: 60
    restartPolicy: Always
    kubectl create -f nginx-pod.yaml
    // verify
    kubectl describe pod nginx | grep -i readiness
    kubectl delete po nginx
  • B. kubectl run nginx --image=nginx --restart=Always --port=80 --
    dry-run -o yaml > nginx-pod.yaml
    // add the livenessProbe section and create
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: nginx
    name: nginx
    spec:
    containers:
    - image: nginx
    name: nginx
    ports:
    - containerPort: 80
    livenessProbe:
    httpGet:
    path: /healthz
    port: 80
    restartPolicy: Always
    kubectl create -f nginx-pod.yaml
    // verify
    kubectl describe pod nginx | grep -i readiness
    kubectl delete po nginx

Answer: B


NEW QUESTION # 27
Get list of all pods in all namespaces and write it to file "/opt/pods-list.yaml"

Answer:

Explanation:
See the solution below.
Explanation
kubectl get po -all-namespaces > /opt/pods-list.yaml


NEW QUESTION # 28
Score: 4%

Task
Create a pod named kucc8 with a single app container for each of the following images running inside (there may be between 1 and 4 images specified): nginx + redis + memcached .

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl run kucc8 --image=nginx --dry-run -o yaml > kucc8.yaml
# vi kucc8.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
name: kucc8
spec:
containers:
- image: nginx
name: nginx
- image: redis
name: redis
- image: memcached
name: memcached
- image: consul
name: consul
#
kubectl create -f kucc8.yaml
#12.07


NEW QUESTION # 29
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 # 30
Create a pod as follows:
Name: mongo
Using Image: mongo
In a new Kubernetes namespace named: my-website

Answer:

Explanation:
solution


NEW QUESTION # 31
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 # 32
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.
You can ssh to the failed node using:
[student@node-1] $ | ssh Wk8s-node-0
You can assume elevated privileges on the node with the following command:
[student@w8ks-node-0] $ | sudo -i

Answer:

Explanation:
solution



NEW QUESTION # 33
Get the number of schedulable nodes and write to a file
/opt/schedulable-nodes.txt

  • A. kubectl get nodes -o jsonpath="{range
    .items[*]}{.metadata.name}
    {.spec.taints[?(@.effect=='NoSchedule')].effect}{\"\n\"}{end}"
    | awk 'NF==1 {print $0}' > /opt/schedulable-nodes.txt
    // Verify
    cat /opt/schedulable-nodes.txt
  • B. kubectl get nodes -o jsonpath="{range
    .items[*]}{.metadata.name}
    {.spec.taints[?(@.effect=='NoSchedule')].effect}{\"\n\"}{end}"
    | awk 'NF==11 {print $0}' > /opt/schedulable-nodes.txt
    // Verify
    cat /opt/schedulable-nodes.txt

Answer: A


NEW QUESTION # 34
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 # 35
Get IP address of the pod - "nginx-dev"

Answer:

Explanation:
Kubect1 get po -o wide
Using JsonPath
kubect1 get pods -o=jsonpath='{range
.items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'


NEW QUESTION # 36
Updates to dynamic user group membership are automatic therefore using dynamic user groups instead of static group objects allows you to:

  • A. respond to changes in user behavior or potential threats without automatic policy changes
  • B. respond to changes in user behavior or potential threats without manual policy changes
  • C. respond to changes in user behavior or potential threats using manual policy changes
  • D. respond to changes in user behavior and confirmed threats with manual policy changes

Answer: B


NEW QUESTION # 37
Score: 4%

Context
You have been asked to create a new ClusterRole for a deployment pipeline and bind it to a specific ServiceAccount scoped to a specific namespace.
Task
Create a new ClusterRole named deployment-clusterrole, which only allows to create the following resource types:
* Deployment
* StatefulSet
* DaemonSet
Create a new ServiceAccount named cicd-token in the existing namespace app-team1.
Bind the new ClusterRole deployment-clusterrole lo the new ServiceAccount cicd-token , limited to the namespace app-team1.

Answer:

Explanation:
Solution:
Task should be complete on node k8s -1 master, 2 worker for this connect use command
[student@node-1] > ssh k8s
kubectl create clusterrole deployment-clusterrole --verb=create --resource=deployments,statefulsets,daemonsets kubectl create serviceaccount cicd-token --namespace=app-team1 kubectl create rolebinding deployment-clusterrole --clusterrole=deployment-clusterrole --serviceaccount=default:cicd-token --namespace=app-team1


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 a Kubernetes secret as follows:
Name: super-secret
password: bob
Create a pod named pod-secrets-via-file, using the redis Image, which mounts a secret named super-secret at
/secrets.
Create a second pod named pod-secrets-via-env, using the redis Image, which exports password as CONFIDENTIAL

Answer:

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

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

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


NEW QUESTION # 40
Scale the deployment from 5 replicas to 20 replicas and verify

Answer:

Explanation:
kubectl scale deploy webapp --replicas=20 kubectl get deploy webapp kubectl get po -l app=webapp


NEW QUESTION # 41
Perform the following tasks:
* Add an init container to hungry-bear (which has been defined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
* The init container should create an empty file named/workdir/calm.txt
* If /workdir/calm.txt is not detected, the pod should exit

Answer:

Explanation:
* Once the spec file has been updated with the init container definition, the pod should be created See the solution below.
Explanation
solution



NEW QUESTION # 42
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/KUTR00102/KUTR00102.txt (which already exists).

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 43
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


NEW QUESTION # 44
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
    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
  • 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
    yaml
    //Verify
    kubectl get no -show-labels
    kubectl get po
    kubectl describe po nginx | grep Node-Selectors

Answer: A


NEW QUESTION # 45
Score: 4%

Task
Set the node named ek8s-node-1 as unavailable and reschedule all the pods running on it.

Answer:

Explanation:
See the solution below.
Explanation
SOLUTION:
[student@node-1] > ssh ek8s
kubectl cordon ek8s-node-1
kubectl drain ek8s-node-1 --delete-local-data --ignore-daemonsets --force


NEW QUESTION # 46
Task Weight: 4%

Task
Schedule a Pod as follows:
* Name: kucc1
* App Containers: 2
* Container Name/Images:
o nginx
o consul

Answer:

Explanation:
Solution:



NEW QUESTION # 47
Set the node namedek8s-node-1asunavailable and reschedule all thepods running on it.

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 48
......


The CKA exam is designed to test an individual's ability to perform real-world tasks in a Kubernetes environment. CKA exam is conducted online and consists of a set of performance-based tasks that need to be completed within a given time frame. CKA exam covers a range of topics such as Kubernetes architecture, installation and configuration, networking, storage, security, and troubleshooting. CKA exam is challenging and requires a high level of expertise in Kubernetes administration. However, passing the exam is a testament to an individual's skills and knowledge in Kubernetes and can lead to better job opportunities and career growth in the industry.

 

CKA Real Valid Brain Dumps With 68 Questions: https://prepaway.testkingpass.com/CKA-testking-dumps.html