New 2026 Guaranteed Success with DumpsReview CKA Dumps Linux Foundation PDF Questions
Exceptional Practice To Certified Kubernetes Administrator (CKA) Program Exam Pass the First Time
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 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:
solution
You must use the kubeadm configuration file located at /etc/kubeadm.conf when initializing your 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
Change the label for one of the pod to env=uat and list all the pods to verify
Answer:
Explanation:
kubectl label pod/nginx-dev3 env=uat --overwrite kubectl get pods --show-labels
NEW QUESTION # 46
You must connect to the correct host.
Failure to do so may result in a zero score.
[candidate@base] $ ssh Cka000058
Context
You manage a WordPress application. Some Pods
are not starting because resource requests are
too high.
Task
A WordPress application in the relative-fawn
namespace consists of:
. A WordPress Deployment with 3 replicas.
Adjust all Pod resource requests as follows:
. Divide node resources evenly across all 3 Pods.
. Give each Pod a fair share of CPU and memory.
Answer:
Explanation:
Task Summary
You are managing a WordPress Deployment in namespace relative-fawn.
* Deployment has 3 replicas.
* Pods are not starting due to high resource requests.
* Your job:# Adjust CPU and memory requests so that all 3 pods evenly split the node's capacity.
Step-by-Step Solution
1## SSH into the correct host
bash
CopyEdit
ssh cka000058
# Skipping this will result in a zero score.
2## Check node resource capacity
You need to know the node's CPU and memory resources.
bash
CopyEdit
kubectl describe node | grep -A5 "Capacity"
Example output:
yaml
CopyEdit
Capacity:
cpu: 3
memory: 3Gi
Let's assume the node has:
* 3 CPUs
* 3Gi memory
So for 3 pods, divide evenly:
* CPU request per pod: 1
* Memory request per pod: 1Gi
## In the actual exam, check real values and divide accordingly. If the node has 4 CPUs and 8Gi, you'd allocate ~1.33 CPUs and ~2.66Gi RAM per pod (rounded reasonably).
3## Edit the Deployment
Edit the WordPress deployment in the relative-fawn namespace:
kubectl edit deployment wordpress -n relative-fawn
Look for the resources section under spec.template.spec.containers like this:
resources:
requests:
cpu: "1"
memory: "1Gi"
If the section doesn't exist, add it manually.
Save and exit the editor (:wq if using vi).
4## Confirm changes
Wait a few seconds, then check:
kubectl get pods -n relative-fawn
Ensure all 3 pods are in Running state.
You can also describe a pod to confirm resource requests are set:
kubectl describe pod <pod-name> -n relative-fawn | grep -A5 "Containers" ssh cka000058 kubectl describe node | grep -A5 "Capacity" kubectl edit deployment wordpress -n relative-fawn
# Set CPU: 1, Memory: 1Gi (or according to node capacity)
kubectl get pods -n relative-fawn
NEW QUESTION # 47
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:



NEW QUESTION # 48
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 # 49
Create a pod as follows:
* Name: mongo
* Using Image: mongo
* In a new Kubernetes namespace named
Answer:
Explanation:
See the solution below.
Explanation
solution
NEW QUESTION # 50
Score: 4%
Task
Scale the deployment presentation to 6 pods.
Answer:
Explanation:
Solution:
kubectl get deployment
kubectl scale deployment.apps/presentation --replicas=6
NEW QUESTION # 51
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==11 {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==1 {print $0}' > /opt/schedulable-nodes.txt
// Verify
cat /opt/schedulable-nodes.txt
Answer: B
NEW QUESTION # 52
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 # 53
Create an nginx pod which loads the secret as environment variables
- A. // create a yml file
kubectl run nginx --image=nginx --restart=Never --dry-run -o
yaml > nginx.yml
// add env section below and create
vim nginx.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
envFrom:
- secretRef:
name: my-secret
restartPolicy: Never
kubectl apply -f nginx.yaml
//verify
kubectl exec -it nginx - env - B. // create a yml file
kubectl run nginx --image=nginx --restart=Never --dry-run -o
yaml > nginx.yml
// add env section below and create
vim nginx.yaml
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
envFrom:
- secretRef:
name: my-secret
restartPolicy: Never
kubectl apply -f nginx.yaml
//verify
kubectl exec -it nginx - env
Answer: A
NEW QUESTION # 54
Schedule a pod as follows:
Name: nginx-kusc00101
Image: nginx
Node selector: disk=ssd
Answer:
Explanation:
solution


NEW QUESTION # 55
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 top po
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 describe po nginx-prod
Answer: A
NEW QUESTION # 56
You are setting up a Kubernetes cluster and you need to configure a NetworkPolicy to allow all traffic from pods in a specific namespace to other namespaces, but block all traffic from other namespaces to this specific namespace. How can you achieve this using NetworkPolicies?
Answer:
Explanation:
See the solution below with Step by Step Explanation.
Explanation:
Solution (Step by Step) :
1 . Create a NetworkPolicy:
- Create a NetworkPolicy in the specific namespace where you want to restrict incoming traffic.
- Code:
2. Apply the NetworkPolicy: - Apply the NetworkPolicy using 'kubectl apply -f networkpolicy.yaml'
NEW QUESTION # 57
Fix a node that shows as non-ready
- A. Kubectl get nodes
// Check which node shows a not ready
kubectl describe nodes "node-name"
// Login to the node which shows as not ready and check the
process for kubelet, docker , kube-proxy.
// systemctl status kubelet (or) ps -aux | grep -i "processname"
// If the process is not started, then start using
systemctl start kubelet / docker
// Verify
ps -auxxww | grep -i "process-name"
kubectl get nodes - B. Kubectl get nodes
// Check which node shows a not ready
kubectl describe nodes "node-name"
// Login to the node which shows as not ready and check the
systemctl start kubelet / docker
// Verify
ps -auxxww | grep -i "process-name"
kubectl get nodes
Answer: A
NEW QUESTION # 58
You are managing a Kubernetes cluster with a team of developers. You need to ensure that each developer only has access to the resources they need. For example, Developer A can only access the 'frontend' namespace and deploy applications there.
Developer B can access the 'backend' namespace and manage deployments and services.
Developer C can access the 'monitoring' namespace and access only read-only access to pods and services.
Define the RBAC rules and create the necessary Role, RoleBinding, and ServiceAccount resources to achieve this access control policy.
Answer:
Explanation:
See the solution below with Step by Step Explanation.
Explanation:
Solution (Step by Step) :
1 . Create ServiceAccounts for each Developer:
kubectl create serviceaccount dev-a -n frontend
kubectl create serviceaccount dev-b -n backend
kubectl create serviceaccount dev-c -n monitoring
2. Create Roles for each Developer:
For Developer A:
For Developer B:
For Developer C:
3. Create RoleBindings: For Developer A:
For Developer B:
For Developer C:
NEW QUESTION # 59
Create a pod namedkucc8with asingle app container for each of the
following images running inside(there may be between 1 and 4images specified):
nginx + redis + memcached.
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 60
You have a Kubernetes cluster with a Deployment named 'web-app' that runs a web application. You need to set up a mechanism to automatically scale the deployment based on the CPU utilization of the pods. The scaling should be triggered when the average CPU utilization across all pods reaches 70%. You should set the minimum and maximum replicas to 2 and 5 respectively.
Answer:
Explanation:
See the solution below with Step by Step Explanation.
Explanation:
Solution (Step by Step) :
1. Create a Horizontal Pod Autoscaler (HPA):
- Use "kubectl create hpa' command to create an HPA resource.
- Specify the name of the HPA, the Deployment to scale, the target CPU utilization (70%), and the minimum and maximum replicas.
kubectl create hpa web-app-hpa --min=2 --max=5 --cpu-utilization-percentage=70 --target- ref=Deployment/web-app
2. Verify the HPA Creation:
- Use 'kubectl get hpa' command to check if the HPA was created successfully. You should see an HPA named 'web-app-hpa' with the configured settings.
3. Monitor the Scaling Behavior:
- You can use the 'kubectl get pods -l command to monitor the number of pods running as the CPU utilization changes.
- When the average CPU utilization across the pods reaches 70%, the HPA will automatically scale up the Deployment to add more pods.
- Conversely, when the CPU utilization falls below the threshold, the HPA will scale down the Deployment to reduce the number of pods.
Ensure that the 'metrics-server' is installed in your cluster to enable CPU utilization monitoring.,
NEW QUESTION # 61
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:
See the solution below.
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: PersistentVolumeapiVersion: v1metadata: name: 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 " # path to which we are creating the volume Challenge Create a Persistent Volume named ReadWriteMany, storage classname shared, 2Gi of storage capacity and the host path
2. Save the file and create the persistent volume.
Image for post
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: PersistentVolumeapiVersion: v1metadata: name:
spec:
accessModes: - ReadWriteMany
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
Image for post
4. Let's see what has changed in the pv we had initially created.
Image for post
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: v1kind: Podmetadata: creationTimestamp: null name: app-dataspec: volumes: - name:congigpvc persistenVolumeClaim: claimName: app-data containers: - image: nginx name: app volumeMounts: - mountPath: "/srv/app-data " name: configpvc
NEW QUESTION # 62
You have a Kubernetes cluster running several applications. You want to implement a network policy that allows traffic only between pods within the same deployment and denies all other traffic. How can you achieve this using NetworkPolicies?
Answer:
Explanation:
See the solution below with Step by Step Explanation.
Explanation:
Solution (Step by Step) :
1. Create a NetworkPolicy:
- Create a NetworkPolicy in the namespace where the deployments are located.
- Code:
2. Apply the NetworkPolicy: - Apply the NetworkPolicy using 'kubectl apply -f networkpolicy.yaml'
NEW QUESTION # 63
......
CKA EXAM DUMPS WITH GUARANTEED SUCCESS: https://quizmaterials.dumpsreview.com/CKA-exam-dumps-review.html

