Why Dumpsforsure is the best choice for Linux-Foundation CKA exam preparation?
Secure your position in Highly Competitive IT Industry:
Linux-Foundation CKA exam certification is the best way to demonstrate your understanding, capability and talent. DumpsforSure is here to provide you with best knowledge on CKA certification. By using our CKA questions & answers you can not only secure your current position but also expedite your growth process.
Verified by IT and Industry Experts:
We are devoted and dedicated to providing you with real and updated CKA exam dumps, along with explanations. Keeping in view the value of your money and time, all the questions and answers on Dumpsforsure has been verified by Linux-Foundation experts. They are highly qualified individuals having many years of professional experience.
Ultimate preparation Source:
Dumpsforsure is a central tool to help you prepare your Linux-Foundation CKA exam. We have collected real exam questions & answers which are updated and reviewed by professional experts regularly. In order to assist you understanding the logic and pass the Linux-Foundation exams, our experts added explanation to the questions.
Instant Access to the Real and Updated Linux-Foundation CKA Questions & Answers:
Dumpsforsure is committed to update the exam databases on regular basis to add the latest questions & answers. For your convenience we have added the date on the exam page showing the most latest update. Getting latest exam questions you'll be able to pass your Linux-Foundation CKA exam in first attempt easily.
Free CKA Dumps DEMO before Purchase:
Dumpsforsure is offering free Demo facility for our valued customers. You can view Dumpsforsure's content by downloading CKA free Demo before buying. It'll help you getting the pattern of the exam and form of CKA dumps questions and answers.
Three Months Free Updates:
Our professional expert's team is constantly checking for the updates. You are eligible to get 90 days free updates after purchasing CKA exam. If there will be any update found our team will notify you at earliest and provide you with the latest PDF file.
SAMPLE QUESTIONS
Question # 1
List the nginx pod with custom columns POD_NAME and POD_STATUS
Answer: See the solution below. Explanation:
kubectl get po -o=custom-columns="POD_NAME:.metadata.name,POD_STATUS:.status.containerStatuses[].state"
Question # 2
You must connect to the correct host.Failure to do so may result in a zero score.[candidate@base] $ ssh Cka000049TaskPerform the following tasks:Create a new PriorityClass named high-priority for user-workloads with a value that is onelessthan the highest existing user-defined priority class value.Patch the existing Deployment busybox-logger running in the priority namespace to use thehigh-priority priority class.
Answer: See the solution below. Explanation:
Task SummarySSH into the correct node: cka000049Find the highest existing user-defined PriorityClassCreate a new PriorityClass high-priority with a value one lessPatch Deployment busybox-logger (in namespace priority) to use this newPriorityClassStep-by-Step Solution1 SSH into the correct nodebashCopyEditssh cka000049 Skipping this = zero score2 Find the highest existing user-defined PriorityClassRun:bashCopyEditkubectl get priorityclasses.scheduling.k8s.ioExample output:vbnetCopyEditNAME VALUE GLOBALDEFAULT AGEdefault-low 1000 false 10dmid-tier 2000 false 7dcritical-pods 1000000 true 30dExclude system-defined classes like system-* and the default global one (e.g., criticalpods).Let's assume the highest user-defined value is 2000.So your new class should be:Value = 19993 Create the high-priority PriorityClassCreate a file called high-priority.yaml:Linux Foundation CKA : Practice Test
cat <<EOF > high-priority.yamlapiVersion: scheduling.k8s.io/v1kind: PriorityClassmetadata:name: high-priorityvalue: 1999globalDefault: falsedescription: "High priority class for user workloads"EOFApply it:kubectl apply -f high-priority.yaml4 Patch the busybox-logger deploymentNow patch the existing Deployment in the priority namespace:kubectl patch deployment busybox-logger -n priority \--type='merge' \-p '{"spec": {"template": {"spec": {"priorityClassName": "high-priority"}}}}'5 Verify your workConfirm the patch was applied:kubectl get deployment busybox-logger -n priority -ojsonpath='{.spec.template.spec.priorityClassName}' You should see:high-priorityAlso, confirm the class exists:kubectl get priorityclass high-priorityFinal Command Summaryssh cka000049kubectl get priorityclass# Create the new PriorityClasscat <<EOF > high-priority.yamlapiVersion: scheduling.k8s.io/v1kind: PriorityClassmetadata:name: high-priorityvalue: 1999globalDefault: falsedescription: "High priority class for user workloads"EOFLinux Foundation CKA : Practice Test kubectl apply -f high-priority.yaml# Patch the deploymentkubectl patch deployment busybox-logger -n priority \--type='merge' \-p '{"spec": {"template": {"spec": {"priorityClassName": "high-priority"}}}}'# Verifykubectl get deployment busybox-logger -n priority -ojsonpath='{.spec.template.spec.priorityClassName}'kubectl get priorityclass high-priority
Question # 3
List all the pods sorted by name
Answer: See the solution below. Explanation:
kubectl get pods --sort-by=.metadata.name
Question # 4
List all the pods sorted by created timestamp
Answer: See the solution below. Explanation:
kubect1 get pods--sort-by=.metadata.creationTimestamp
Question # 5
Create 2 nginx image pods in which one of them is labelled with env=prod and another onelabelled with env=dev and verify the same
Answer: See the solution below. Explanation:
kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run-o yaml > nginx-prodpod.yaml Now, edit nginx-prod-pod.yaml file and remove entries like“creationTimestamp: null” “dnsPolicy: ClusterFirst”vim nginx-prod-pod.yamlapiVersion: v1kind: Podmetadata:labels:env: prodname: nginx-prodspec:containers:- image: nginxname: nginx-prodrestartPolicy: Always# kubectl create -f nginx-prod-pod.yamlkubectl run --generator=run-pod/v1 --image=nginx --labels=env=dev nginx-dev --dry-run -o yaml > nginx-dev-pod.yamlapiVersion: v1kind: Podmetadata:labels:env: devname: nginx-devspec:containers:- image: nginxname: nginx-devrestartPolicy: Always# kubectl create -f nginx-prod-dev.yamlVerify :kubectl get po --show-labelskubectl get po -l env=prodkubectl get po -l env=dev
Question # 6
Create an nginx pod and list the pod with different levels of verbosity
Answer: See the solution below. Explanation:
// create a podkubectl run nginx --image=nginx --restart=Never --port=80// List the pod with different verbositykubectl get po nginx --v=7kubectl get po nginx --v=8kubectl get po nginx --v=9
Question # 7
Get IP address of the pod – “nginx-dev”
Answer: See the solution below. Explanation:
Kubect1 get po -o wideQuestion No : 65 SIMULATIONLinux Foundation CKA : Practice TestUsing JsonPathkubect1 get pods -o=jsonpath='{rangeitems[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
Question # 8
ou must connect to the correct host.Failure to do so may result in a zero score.[candidate@base] $ ssh Cka000056TaskReview and apply the appropriate NetworkPolicy from the provided YAML samples.Ensure that the chosen NetworkPolicy is not overly permissive, but allows communicationbetween the frontend and backend Deployments, which run in the frontend and backendnamespaces respectively.First, analyze the frontend and backend Deployments to determine the specificrequirements for the NetworkPolicy that needs to be applied.Next, examine the NetworkPolicy YAML samples located in the ~/netpol folder.Failure to comply may result in a reduced score.Do not delete or modify the provided samples. Only apply one of them.Finally, apply the NetworkPolicy that enables communication between the frontend andbackend Deployments, without being overly permissive.
Answer: See the solution below. Explanation:
Task SummaryConnect to host cka000056Review existing frontend and backend DeploymentsQuestion No : 64 SIMULATIONLinux Foundation CKA : Practice Test
Choose one correct NetworkPolicy from the ~/netpol directoryThe policy must:Apply the correct NetworkPolicy without modifying any sample filesStep-by-Step InstructionsStep 1: SSH into the correct nodessh cka000056Step 2: Inspect the frontend DeploymentCheck the labels used in the frontend Deployment:kubectl get deployment -n frontend -o yamlLook under metadata.labels or spec.template.metadata.labels. Note the app or similar label(e.g., app: frontend).Step 3: Inspect the backend Deploymentkubectl get deployment -n backend -o yamlAgain, find the labels assigned to the pods (e.g., app: backend).Step 4: List and review the provided NetworkPoliciesList the available files:ls ~/netpolCheck the contents of each policy file:cat ~/netpol/<file-name>.yamlLook for a policy that:Has kind: NetworkPolicyApplies to the backend namespaceUses a podSelector that matches the backend podsIncludes an ingress.from rule that references the frontend namespace using anamespaceSelector (and optionally a podSelector)Does not allow traffic from all namespaces or all podsHere’s what to look for in a good match:apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: allow-frontend-to-backendnamespace: backendspec:podSelector:matchLabels:app: backendingress:- from:- namespaceSelector:matchLabels:name: frontendEven better if the policy includes:Linux Foundation CKA : Practice Test- namespaceSelector:matchLabels:name: frontendpodSelector:matchLabels:app: frontendThis limits access to pods in the frontend namespace with a specific label.Step 5: Apply the correct NetworkPolicyOnce you’ve identified the best match, apply it:kubectl apply -f ~/netpol/<chosen-file>.yamlApply only one file. Do not alter or delete any existing sample.ssh cka000056kubectl get deployment -n frontend -o yamlkubectl get deployment -n backend -o yamlls ~/netpolcat ~/netpol/*.yaml # Review carefullykubectl apply -f ~/netpol/<chosen-file>.yamlCommand Summaryssh cka000056kubectl get deployment -n frontend -o yamlkubectl get deployment -n backend -o yamlls ~/netpolcat ~/netpol/*.yaml # Review carefullykubectl apply -f ~/netpol/<chosen-file>.yaml
Question # 9
You must connect to the correct host.Failure to do so may result in a zero score.[candidate@base] $ ssh Cka000059ContextA kubeadm provisioned cluster was migrated to a new machine. It needs configurationchanges torun successfully.TaskFix a single-node cluster that got broken during machine migration.First, identify the broken cluster components and investigate what breaks them.The decommissioned cluster used an external etcd server.Next, fix the configuration of all broken cluster
Answer: See the solution below. Explanation:
Question No : 63 SIMULATIONLinux Foundation CKA : Practice Test Task SummarySSH into node: cka000059Cluster was migrated to a new machineIt uses an external etcd serverIdentify and fix misconfigured componentsBring the cluster back to a healthy stateStep-by-Step SolutionStep 1: SSH into the correct hostssh cka000059Step 2: Check the cluster statusRun:kubectl get nodesIf it fails, the kubelet or kube-apiserver is likely broken.Check kubelet status:sudo systemctl status kubeletAlso, check pod statuses in the control plane:sudo crictl ps -a | grep kubeor:docker ps -a | grep kubeLook especially for failures in kube-apiserver or kube-controller-manager.Step 3: Inspect the kube-apiserver manifestSince this is a kubeadm-based cluster, manifests are in:ls /etc/kubernetes/manifestsOpen kube-apiserver.yaml:bashCopyEditsudo nano /etc/kubernetes/manifests/kube-apiserver.yamlLook for the --etcd-servers= flag. If the external etcd endpoint has changed (likely, due tomigration), this needs to be fixed.Example of incorrect configuration:--etcd-servers=https://192.168.1.100:2379If the IP has changed, update it to the correct IP or hostname of the external etcd server.Linux Foundation CKA : Practice Test Also ensure the correct client certificate and key paths are still valid:--etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt--etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt--etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.keyIf the files are missing or the path is wrong due to migration, correct those as well.Step 4: Save and exit, and let static pod restartStatic pod changes will be picked up automatically by the kubelet (watch for/etc/kubernetes/manifests changes).Check again:docker ps | grep kube-apiserver# orcrictl ps | grep kube-apiserverStep 5: Confirm API is healthyOnce kube-apiserver is up, try:kubectl get componentstatuseskubectl get nodesIf these commands work and return valid statuses, the control plane is functional again.Step 6: Check controller-manager and scheduler (optional)If still broken, check the other static pods in /etc/kubernetes/manifests/ and correct paths ifnecessary.Also verify that /etc/kubernetes/kubelet.conf and /etc/kubernetes/admin.conf are presentand valid.Command Summaryssh cka000059# Check system and kubeletsudo systemctl status kubeletdocker ps -a | grep kube # or crictl ps -a | grep kube# Check manifestsls /etc/kubernetes/manifestssudo nano /etc/kubernetes/manifests/kube-apiserver.yaml# Fix --etcd-servers and certificate paths if needed# Watch pods restart and confirm:kubectl get nodesLinux Foundation CKA : Practice Test kubectl get componentstatuses
Question # 10
You must connect to the correct host.Failure to do so may result in a zero score.[candidate@base] $ ssh Cka000046TaskFirst, create a new StorageClass named local-path for an existing provisioner namedrancher.io/local-path .Set the volume binding mode to WaitForFirstConsumer .Not setting the volume binding mode or setting it to anything other thanWaitForFirstConsumer may result in a reduced score.Next, configure the StorageClass local-path as the default StorageClass .
Answer: See the solution below. Explanation:
Task SummaryYou need to:SSH into cka000046Create a StorageClass named local-path using the provisioner rancher.io/localpathSet the volume binding mode to WaitForFirstConsumerMake this StorageClass the defaultStep-by-Step SolutionQuestion No : 62 SIMULATIONLinux Foundation CKA : Practice Test 1 SSH into the correct hostssh cka000046 Required. Skipping this = zero score2 Create a StorageClass YAML fileCreate a file named local-path-sc.yaml:cat <<EOF > local-path-sc.yamlapiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: local-pathannotations:storageclass.kubernetes.io/is-default-class: "true"provisioner: rancher.io/local-pathvolumeBindingMode: WaitForFirstConsumerEOF This:Sets WaitForFirstConsumer (as required)Marks the class as default using the correct annotation3 Apply the StorageClasskubectl apply -f local-path-sc.yaml4 Verify it’s the default StorageClasskubectl get storageclassYou should see local-path with a (default) marker:NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODEALLOWVOLUMEEXPANSION AGElocal-path rancher.io/local-path Delete WaitForFirstConsumer false 10sFinal Command Summaryssh cka000046cat <<EOF > local-path-sc.yamlapiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: local-pathannotations:storageclass.kubernetes.io/is-default-class: "true"provisioner: rancher.io/local-pathvolumeBindingMode: WaitForFirstConsumerLinux Foundation CKA : Practice Test EOFkubectl apply -f local-path-sc.yamlkubectl get storageclass