[2023] Valid CKA test answers & Linux Foundation CKA exam pdf [Q16-Q39]

Share

[2023] Valid CKA test answers & Linux Foundation CKA exam pdf

Verified CKA dumps Q&As - Pass Guarantee or Full Refund


Objective of CNCF CKA Certification Exam

The CNCF Certified Kubernetes Administrator exam tests knowledge on deploying, managing, and troubleshooting applications on Kubernetes clusters. Software engineers will need to understand key concepts of Kubernetes in order to pass the CNCF Certified Kubernetes Administrator exam. Files and containers running on the cluster will be managed by Kubernetes using its object-store. Understand key features of Kubernetes and how it is a paradigm shift in the way software engineers manage containerized applications. Learning about Kubernetes will be crucial for passing the CNCF Certified Kubernetes Administrator exam. Highly recommended to check out the official study guide. Technical manuals and practice questions can be found on the website. Functional knowledge of Kubernetes is crucial for passing the CNCF Certified Kubernetes Administrator exam.

 

NEW QUESTION 16
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

 

NEW QUESTION 17
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 namespace and the volume must not be persistent.

Answer:

Explanation:
See the solution below.
Explanation
solution


 

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

 

NEW QUESTION 19
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 20
create a pod in a specific node (node1) by placing the pod definition file in a particular folder "/etc/kubernetes/manifests".

  • A. Generate YAML before we SSH to the specific node, then copy the YAML into the exam notepad to use it after SSH into worker node.
    SSH to the node: "ssh node1"
    Gain admin privileges to the node: "sudo -i"
    Move to the manifest-path "cd /etc/kubernetes/manifests"
    kubelet config file -- /var/lib/kubelet/config.yaml
    Edit the config file "vi /var/lib/kubelet/config.yaml" to add
    staticPodPath
    staticPodPath: /etc/kubernetes/manifests
    Restart the kubelet "systemctl restart kubelet"
  • B. Generate YAML before we SSH to the specific node, then copy the YAML into the exam notepad to use it after SSH into worker node.
    SSH to the node: "ssh node1"
    Gain admin privileges to the node: "sudo -i"
    Move to the manifest-path "cd /etc/kubernetes/manifests"
    Place the generated YAML into the folder "vi nginx.yaml"
    Find the kubelet config file path "ps -aux | grep kubelet" . This
    will output information on kubelet process. Locate the kubelet config
    file location.
    kubelet config file -- /var/lib/kubelet/config.yaml
    Edit the config file "vi /var/lib/kubelet/config.yaml" to add
    staticPodPath
    staticPodPath: /etc/kubernetes/manifests
    Restart the kubelet "systemctl restart kubelet"

Answer: B

 

NEW QUESTION 21
Create a pod as follows:
Name: mongo
Using Image: mongo
In a new Kubernetes namespace named: my-website

Answer:

Explanation:
solution

 

NEW QUESTION 22
Score: 5%

Task
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/KUTR00401/KUTR00401.txt (which already exists).

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl top -l name=cpu-user -A
echo 'pod name' >> /opt/KUT00401/KUT00401.txt

 

NEW QUESTION 23
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 24
Allow traffic from all the pods in "web" namespace and from pods
with label "type=monitoring" to the pods matching label "app: db"

  • A. kubectl create namespace web
    kubectl label namespace/web app=web
    vim web-allow-all-ns-monitoring.yaml
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: web-allow-all-ns-monitoring
    namespace: default
    spec:
    podSelector:
    matchLabels:
    app: db
    ingress:
    - from:
    - namespaceSelector:
    matchLabels:
    app: web
    podSelector:
    matchLabels:
    type: monitoring
    k kubectl apply -f web-allow-all-ns-monitoring.yaml
  • B. kubectl create namespace web
    kubectl label namespace/web app=web
    vim web-allow-all-ns-monitoring.yaml
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: web-allow-all-ns-monitoring
    namespace: default
    spec:
    podSelector:
    podSelector:
    matchLabels:
    type: monitoring
    k kubectl apply -f web-allow-all-ns-monitoring.yaml

Answer: A

 

NEW QUESTION 25
On the NGFW, how can you generate and block a private key from export and thus harden your security posture and prevent rogue administrators or other bad actors from misusing keys?

  • A. 1) Select Device > Certificate Management > Certificates Device > Certificates
    2) Generate the certificate.
    3) Select Block Private Key Export.
    4) Click Generate to generate the new certificate.
  • B. 1) Select Device > Certificates
    2) Select Certificate Profile.
    3) Generate the certificate
    4) Select Block Private Key Export.
  • C. 1) Select Device > Certificate Management > Certificates >Device > Certificates
    2) Import the certificate.
    3) Select Import Private Key
    4) Click Generate to generate the new certificate.
  • D. 1) Select Device > Certificates
    2) Select Certificate Profile
    3) Generate the certificate
    4) Select Block Private Key Export

Answer: D

 

NEW QUESTION 26
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 27
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:
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: PersistentVolume apiVersion: v1 metadata: name:app-data spec: 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 app-data, with access mode ReadWriteMany, storage classname shared, 2Gi of storage capacity and the host path /srv/app-data.

2. Save the file and create the persistent volume.

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: PersistentVolume apiVersion: v1 metadata: name:app-data
spec:
accessModes: - ReadWriteMany resources:
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

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

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: v1 kind: Pod metadata: creationTimestamp: null name: app-data spec: volumes: - name:congigpvc persistenVolumeClaim: claimName: app-data containers: - image: nginx name: app volumeMounts: - mountPath: "/srv/app-data " name: configpvc

 

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

Answer:

Explanation:
See the solution below.
Explanation
kubectl create namespace development
kubectl run nginx --image=nginx --restart=Never -n development

 

NEW QUESTION 29
Score: 4%

Task
Create a persistent volume with name app-data , of capacity 1Gi and access mode ReadOnlyMany. The type of volume is hostPath and its location is /srv/app-data .

Answer:

Explanation:
See the solution below.
Explanation
Solution:
#vi pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-config
spec:
capacity:
storage: 1Gi
accessModes:
- ReadOnlyMany
hostPath:
path: /srv/app-config
#
kubectl create -f pv.yaml

 

NEW QUESTION 30
List all the pods sorted by created timestamp

Answer:

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

 

NEW QUESTION 31
Make the node schedulable by uncordon the node

Answer:

Explanation:
kubectl uncordon node-1 //verify kubectl get no

 

NEW QUESTION 32
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 33
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 34
Create a deployment as follows:
Name: nginx-app
Using container nginx with version 1.11.10-alpine
The deployment should contain 3 replicas
Next, deploy the application with new version 1.11.13-alpine, by performing a rolling update.
Finally, rollback that update to the previous version 1.11.10-alpine.

Answer:

Explanation:
solution


 

NEW QUESTION 35
Add a taint to node "worker-2" with effect as "NoSchedule" and
list the node with taint effect as "NoSchedule"

  • A. // Add taint to node "worker-2"
    kubectl taint nodes worker-2 key=value:NoSchedule
    .items[*]}{.metadata.name} {.spec.taints[?(
    @.effect=='NoSchedule' )].effect}{\"\n\"}{end}" | awk 'NF==2
    {print $0}'
  • B. // Add taint to node "worker-2"
    kubectl taint nodes worker-2 key=value:NoSchedule
    // Verify
    // Using "custom-coloumns" , you can customize which coloumn to
    be printed
    kubectl get nodes -o customcolumns=NAME:.metadata.name,TAINTS:.spec.taints --no-headers
    // Using jsonpath
    kubectl get nodes -o jsonpath="{range
    .items[*]}{.metadata.name} {.spec.taints[?(
    @.effect=='NoSchedule' )].effect}{\"\n\"}{end}" | awk 'NF==2
    {print $0}'

Answer: B

 

NEW QUESTION 36
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 37
Get list of PVs and order by size and write to file "/opt/pvstorage.txt"

Answer:

Explanation:
kubectl get pv --sort-by=.spec.capacity.storage > /opt/pv storage.txt

 

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

 

NEW QUESTION 39
......

CKA Exam Questions – Valid CKA Dumps Pdf: https://gocertify.actual4labs.com/Linux-Foundation/CKA-actual-exam-dumps.html

Contact Us

If you have any question please leave me your email address, we will reply and send email to you in 12 hours.

Our Working Time: ( GMT 0:00-15:00 )
From Monday to Saturday

Support: Contact now