2024 The Most Effective CKA with 68 Questions Answers [Q32-Q52]

Share

2024 The Most Effective CKA with 68 Questions Answers

Try Free and Start Using Realistic Verified CKA Dumps Instantly.


The CKA certification is ideal for IT professionals who work with Kubernetes and want to demonstrate their proficiency in the field. CKA exam is vendor-neutral, meaning it is not tied to any particular cloud provider or Kubernetes distribution. As a result, the certification is widely recognized by employers and can help candidates stand out in a competitive job market. Additionally, the CKA certification can help organizations identify qualified Kubernetes administrators who can help them deploy and manage their containerized applications effectively.

 

NEW QUESTION # 32
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 # 33
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





NEW QUESTION # 34
Score: 4%

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

Answer:

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 # 35
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 thestagingnamespace and the volumemust notbe persistent.

Answer:

Explanation:
See the solution below.
Explanation
solution



NEW QUESTION # 36
Score: 7%

Task
Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.
Create a new service named front-end-svc exposing the container port http.
Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled.

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl get deploy front-end
kubectl edit deploy front-end -o yaml
#port specification named http
#service.yaml
apiVersion: v1
kind: Service
metadata:
name: front-end-svc
labels:
app: nginx
spec:
ports:
- port: 80
protocol: tcp
name: http
selector:
app: nginx
type: NodePort
# kubectl create -f service.yaml
# kubectl get svc
# port specification named http
kubectl expose deployment front-end --name=front-end-svc --port=80 --tarport=80 --type=NodePort


NEW QUESTION # 37
Create a pod with environment variables as var1=value1.Check the environment variable in pod

  • A. kubectl run nginx --image=nginx --restart=Never --env=var1=value1
    # then
    kubectl exec -it nginx -- env
    # or
    kubectl exec -it nginx -- sh -c 'echo $var1'
    # or
    kubectl describe po nginx | grep value1
  • B. kubectl run nginx --image=nginx --restart=Never --env=var1=value1
    # then
    kubectl exec -it nginx -- env
    # or
    kubectl describe po nginx | grep value1

Answer: A


NEW QUESTION # 38
Create a hostPath PersistentVolume named task-pv-volume with storage 10Gi, access modes ReadWriteOnce, storageClassName manual, and volume at /mnt/data and verify

  • A. vim task-pv-volume.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: task-pv-volume
    labels:
    type: local
    spec:
    storageClassName: ""
    capacity:
    storage: 5Gi
    accessModes:
    - ReadWriteOnce
    hostPath:
    path: "/mnt/data"
    kubectl apply -f task-pv-volume.yaml
    //Verify
    kubectl get pv
    NAME CAPACITY ACCESS
    MODES RECLAIM POLICY STATUS CLAIM
    STORAGECLASS REASON AGE
    task-pv-volume 5Gi RWO
    Retain Available
    3s
  • B. vim task-pv-volume.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: task-pv-volume
    labels:
    type: local
    spec:
    storageClassName: ""
    capacity:
    storage: 5Gi
    accessModes:
    - ReadWriteOnce
    hostPath:
    path: "/mnt/data"
    kubectl apply -f task-pv-volume.yaml
    //Verify
    kubectl get pv
    NAME CAPACITY ACCESS
    MODES RECLAIM POLICY STATUS CLAIM
    STORAGECLASS REASON AGE
    task-pv-volume 4Gi RWO
    Retain Available
    8s

Answer: A


NEW QUESTION # 39
Print pod name and start time to "/opt/pod-status" file

Answer:

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


NEW QUESTION # 40
Install a kubernetes cluster with one master and one worker using kubeadm

  • A. This is a straightforward question, you need to install kubernetes cluster using kubeadm with one master and one worker.
    Refer : https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/
  • B. This is a straightforward question, you need to install kubernetes cluster using kubeadm with one master and one worker.
    Installation is considered success once both master and worker
    nodes become available.
    Refer : https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/

Answer: B


NEW QUESTION # 41
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:
solution





NEW QUESTION # 42
Create the nginx pod with version 1.17.4 and expose it on port 80

Answer:

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


NEW QUESTION # 43
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
F:\Work\Data Entry Work\Data Entry\20200827\CKA\15 B.JPG

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


NEW QUESTION # 44
For this item, you will have to ssh and complete all tasks on these
nodes. Ensure that you return to the base node (hostname: ) 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 apt has been configured so that you can install the required tools.


NEW QUESTION # 45
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:
solution



NEW QUESTION # 46
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: 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
  • 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: 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

Answer: A


NEW QUESTION # 47
Get list of all the pods showing name and namespace with a jsonpath expression.

Answer:

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


NEW QUESTION # 48
Create a Cronjob with busybox image that prints date and hello from kubernetes cluster message for every minute

  • A. CronJob Syntax:
    * --> Minute
    * --> Hours
    * --> Day of The Month
    * --> Month
    * --> Day of the Week
    */1 * * * * --> Execute a command every one minutes.
    vim date-job.yaml
    apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
    name: date-job
    spec:
    schedule: "*/1 * * * *"
    jobTemplate:
    spec:
    template:
    spec:
    containers:
    - name: hello
    image: busybox
    args:
    - /bin/sh
    - -c
    - date; echo Hello from the Kubernetes cluster
    restartPolicy: OnFailure
    kubectl apply -f date-job.yaml
    //Verify
    kubectl get cj date-job -o yaml
  • B. CronJob Syntax:
    * --> Minute
    * --> Hours
    * --> Day of The Month
    * --> Month
    * --> Day of the Week
    */1 * * * * --> Execute a command every one minutes.
    vim date-job.yaml
    apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
    name: date-job
    spec:
    schedule: "*/1 * * * *"
    jobTemplate:
    spec:
    template:
    - /bin/sh
    - -c
    - date; echo Hello from the Kubernetes cluster
    restartPolicy: OnFailure
    kubectl apply -f date-job.yaml
    //Verify
    kubectl get cj date-job -o yaml

Answer: A


NEW QUESTION # 49
Create a file called "config.txt" with two values key1=value1
and key2=value2. Then create a configmap named "keyvalcfgmap" andread data from the file "config.txt" and verify that configmap is created correctly

  • A. cat >> config.txt << EOF
    key1=value1
    key2=value2
    EOF
    kubectl create cm keyvalcfgmap --from-file=config.txt
    //Verify
    kubectl get cm keyvalcfgmap -o yaml
  • B. cat >> config.txt << EOF
    key1=value1
    key2=value2
    EOF
    cat config.txt
    // Create configmap from "config.txt" file
    kubectl create cm keyvalcfgmap --from-file=config.txt
    //Verify
    kubectl get cm keyvalcfgmap -o yaml

Answer: B


NEW QUESTION # 50
Create a deployment spec file that will:
Launch 7 replicas of the nginx Image with the label app_runtime_stage=dev deployment name: kual00201 Save a copy of this spec file to /opt/KUAL00201/spec_deployment.yaml (or /opt/KUAL00201/spec_deployment.json).
When you are done, clean up (delete) any new Kubernetes API object that you produced during this task.

Answer:

Explanation:
solution


NEW QUESTION # 51
Resume the rollout of the deployment

Answer:

Explanation:
kubectl rollout resume deploy webapp


NEW QUESTION # 52
......

Download Free Latest Exam CKA Certified Sample Questions: https://www.pass4leader.com/Linux-Foundation/CKA-exam.html

CKA Actual Questions - Instant Download 68 Questions: https://drive.google.com/open?id=1L9nmeT9aaNze9i_r-GYXsVkkOh4jgN2H