[Q35-Q55] Try 100% Updated CKA Exam Questions [2024]

Share

Try 100% Updated CKA Exam Questions [2024]

Pass CKA Exam - Real Questions and Answers


Linux Foundation Certified Kubernetes Administrator (CKA) program is a certification exam designed to test the knowledge of individuals in administering Kubernetes clusters. Kubernetes is an open-source container orchestration system that is used to automate the deployment, scaling, and management of containerized applications. The CKA program is an industry-recognized certification that validates the skills and knowledge of administrators, developers, and architects in working with Kubernetes.

 

NEW QUESTION # 35
Set CPU and memory requests and limits for existing pod name
"nginx-prod".
Set requests for CPU and Memory as 100m and 256Mi respectively
Set limits for CPU and Memory as 200m and 512Mi respectively

  • A. kubectl get po
    kubectl set resources po nginx-prod --
    limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
    //Verify
    kubectl describe po nginx-prod
  • B. kubectl get po
    kubectl set resources po nginx-prod --
    limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
    //Verify
    kubectl top po
    kubectl describe po nginx-prod

Answer: B


NEW QUESTION # 36
List the nginx pod with custom columns POD_NAME and POD_STATUS

Answer:

Explanation:
kubectl get po -o=custom-columns="POD_NAME:.metadata.name, POD_STATUS:.status.containerStatuses[].state"


NEW QUESTION # 37
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. PBP (Protocol Based Protection)
  • C. BGP (Border Gateway Protocol)
  • D. PBP (Packet Buffer Protection)

Answer: B


NEW QUESTION # 38
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 # 39
Get list of all pods in all namespaces and write it to file "/opt/pods-list.yaml"

Answer:

Explanation:
kubectl get po -all-namespaces > /opt/pods-list.yaml


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

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 41
Delete the pod without any delay (force delete)

Answer:

Explanation:
Kubect1 delete po "POD-NAME" --grace-period=0 --force


NEW QUESTION # 42
Resume the rollout of the deployment

Answer:

Explanation:
kubectl rollout resume deploy webapp


NEW QUESTION # 43
Change the Image version to 1.15-alpine for the pod you just created and verify the image version is updated.

  • A. Kubect1 set image pod/nginx nginx=nginx:1.15-alpine
    kubect1 describe po nginx
    // another way it will open vi editor and change the version
    kubeclt edit po nginx
    kubect1 describe po nginx
  • B. Kubect1 set image pod/nginx nginx=nginx:1.15-alpine
    kubect1 describe po nginx
    // another way it will open vi editor and change the version
    kubect1 describe po nginx

Answer: A


NEW QUESTION # 44
Create a ETCD backup of kubernetes cluster
Note : You don't need to memorize command, refer -
https://kubernetes.io/docs/tasks/administer-cluster/configureupgrade-etcd/ during exam

  • A. ETCDCTL_API=3 etcdctl --endpoints=[ENDPOINT] --cacert=[CA CERT]
    --cert=[ETCD SERVER CERT] --key=[ETCD SERVER KEY] snapshot save
    [BACKUP FILE NAME]
    In exam, cluster setup is done with kubeadm , this means ETCD
    used by the kubernetes cluster is coming from static pod.
    kubectl get pod -n kube-system
    kubectl describe pod etcd-master -n kube-system
    You can locate the information on
    endpoint: - advertise-client-urls=https://172.17.0.15:2379
    ca certificate: - trusted-cafile=/etc/kubernetes/pki/etcd/ca.crt
    server certificate : - certfile=/etc/kubernetes/pki/etcd/server.crt
    key: - key-file=/etc/kubernetes/pki/etcd/server.key
    To Create backup
    export ETCDCTL_API=3
    (or)
    ETCDCTL_API=3 etcdctl ETCDCTL_API=3 etcdctl --
    endpoints=https://172.17.0.15:2379 --
    cacert=/etc/kubernetes/pki/etcd/ca.crt --
    cert=/etc/kubernetes/pki/etcd/server.crt --
    key=/etc/kubernetes/pki/etcd/server.key snapshot save etcdsnapshot.db
    //Verify
    ETCDCTL_API=3 etcdctl --write-out=table snapshot status
    snapshot.db
  • B. ETCDCTL_API=3 etcdctl --endpoints=[ENDPOINT] --cacert=[CA CERT]
    --cert=[ETCD SERVER CERT] --key=[ETCD SERVER KEY] snapshot save
    [BACKUP FILE NAME]
    In exam, cluster setup is done with kubeadm , this means ETCD
    used by the kubernetes cluster is coming from static pod.
    kubectl get pod -n kube-system
    kubectl describe pod etcd-master -n kube-system
    You can locate the information on
    endpoint: - advertise-client-urls=https://172.16.0.18:2379
    ca certificate: - trusted-cafile=/etc/kubernetes/pki/etcd/ca.crt
    server certificate : - certfile=/etc/kubernetes/pki/etcd/server.crt
    key: - key-file=/etc/kubernetes/pki/etcd/server.key
    To Create backup
    export ETCDCTL_API=3
    (or)
    ETCDCTL_API=3 etcdctl ETCDCTL_API=3 etcdctl --
    endpoints=https://172.17.0.15:2379 --
    key=/etc/kubernetes/pki/etcd/server.key snapshot save etcdsnapshot.db
    //Verify
    ETCDCTL_API=3 etcdctl --write-out=table snapshot status
    snapshot.db

Answer: A


NEW QUESTION # 45
Create the deployment redis with image=redis and expose it with "NodePort" service redis-service

  • A. kubectl create deploy redis --image=redis --dry-run -o yaml >
    redis-deploy.yaml
    Edit redis-deploy.yaml file
    vim redis-deploy.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: redis
    name: redis
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: redis
    template:
    metadata:
    labels:
    app: redis
    spec:
    containers:
    - image: redis
    name: redis
    //Creating Service
    kubectl expose deploy redis --type=NodePort --port=6379 --
    target-port=6379 --name redis-service
    // Verify
    kubectl get deploy,svc
  • B. kubectl create deploy redis --image=redis --dry-run -o yaml >
    redis-deploy.yaml
    Edit redis-deploy.yaml file
    name: redis
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: redis
    template:
    metadata:
    labels:
    app: redis
    spec:
    containers:
    - image: redis
    name: redis
    //Creating Service
    kubectl expose deploy redis --type=NodePort --port=6379 --
    target-port=6379 --name redis-service
    // Verify
    kubectl get deploy,svc

Answer: A


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

Answer:

Explanation:
See the solution below.
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 # 47
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 # 48
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 # 49
Configure the kubelet systemd- managed service, on the node labelled with name=wk8s-node-1, to launch a pod containing a single container of Image httpd named webtool automatically. Any spec files required should be placed in the /etc/kubernetes/manifests directory on the node.
You can ssh to the appropriate node using:
[student@node-1] $ ssh wk8s-node-1
You can assume elevated privileges on the node with the following command:
[student@wk8s-node-1] $ | sudo -i

Answer:

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

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

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 E.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 F.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 G.JPG


NEW QUESTION # 50
For this item, you will havetosshto the nodesik8s-master-0andik8s-node-0and complete all tasks on thesenodes. Ensure that you return tothe base node (hostname:node-1) when you havecompleted this item.
Context
As an administrator of a smalldevelopment team, you have beenasked to set up a Kubernetes clusterto test the viability of a newapplication.
Task
You must usekubeadmto performthis task. Anykubeadminvocationswill require the use of the
--ignore-preflight-errors=alloption.
* Configure thenodeik8s-master-Oas a masternode. .
* Join the nodeik8s-node-otothe cluster.

Answer:

Explanation:
See the solution below.
Explanation
solution
You must use thekubeadmconfiguration file located at when initializingyour cluster.
You may use any CNI pluginto complete this task, but ifyou don't have your favouriteCNI plugin's manifest URL athand, Calico is one popularoption:https://docs.projectcalico.org/v3.14/manifests/calico.yaml Docker is already installedon both nodes and hasbeen configured so that you caninstall the required tools.


NEW QUESTION # 51
Check the history of deployment

Answer:

Explanation:
kubectl rollout history deployment webapp


NEW QUESTION # 52
Ensure a single instance of pod nginx is running on each node of the Kubernetes cluster where nginx also represents the Image name which has to be used. Do not override any taints currently in place.
Use DaemonSet to complete this task and use ds-kusc00201 as DaemonSet name.

Answer:

Explanation:
See the solution below.
Explanation
solution




NEW QUESTION # 53
Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.

Answer:

Explanation:
kubectl create namespace development kubectl run nginx --image=nginx --restart=Never -n development


NEW QUESTION # 54
Create a pod with image nginx called nginx and allow traffic on port 80

Answer:

Explanation:
kubectl run nginx --image=nginx --restart=Never --port=80


NEW QUESTION # 55
......


The CKA exam is a hands-on, performance-based exam that requires candidates to demonstrate their knowledge of Kubernetes administration through the use of practical tasks and challenges. CKA exam is designed to test an individual's ability to configure and manage Kubernetes clusters, troubleshoot common issues, and deploy applications using Kubernetes. CKA exam is administered online and can be taken from anywhere in the world.

 

CKA Exam Questions Get Updated [2024] with Correct Answers: https://actualtests.test4engine.com/CKA-real-exam-questions.html