Practice Free CKA Exam Online Questions
SIMULATION
Check the image version in pod without the describe command
jsonpath='{.spec.containers[].image}{"n"}’
SIMULATION
Create and configure the service front-end-service so it’s accessible through NodePort and routes to the existing pod named front-end.

SIMULATION
Task Weight: 4%

Task
Scale the deployment webserver to 3 pods.
![]()
SIMULATION
Score: 4%

Task
Scale the deployment presentation to 6 pods.
kubectl get deployment
kubectl scale deployment.apps/presentation –replicas=6
SIMULATION
Score: 7%

Task
Create a new nginx Ingress resource as follows:
• Name: ping
• Namespace: ing-internal
• Exposing service hi on path /hi using service port 5678

vi ingress.yaml
#
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ping
namespace: ing-internal
spec:
rules:
– http:
paths:
– path: /hi pathType: Prefix backend: service: name: hi port: number: 5678
#
kubectl create -f ingress.yaml
SIMULATION
List all the pods showing name and namespace with a json path expression
SIMULATION
List all the pods showing name and namespace with a json path expression
SIMULATION
Get list of all pods in all namespaces and write it to file “/opt/pods-list.yaml”
SIMULATION
Create a pod with environment variables as var1=value1.Check the environment variable in pod
# then
kubectl exec -it nginx — env
# or
kubectl exec -it nginx — sh -c ‘echo $var1’
# or
kubectl describe po nginx | grep value1
SIMULATION
You must connect to the correct host.
Failure to do so may result in a zero score.
[candidate@base] $ ssh Cka000049
Task
Perform the following tasks:
Create a new PriorityClass named high-priority for user-workloads with a value that is one less than the highest existing user-defined priority class value.
Patch the existing Deployment busybox-logger running in the priority namespace to use the high-priority priority class.
SSH into the correct node: cka000049
Find the highest existing user-defined PriorityClass
Create a new PriorityClass high-priority with a value one less
Patch Deployment busybox-logger (in namespace priority) to use this new PriorityClass
Step-by-Step Solution
1️ ⃣ SSH into the correct node
bash
CopyEdit
ssh cka000049
⚠️ Skipping this = zero score
2️ ⃣ Find the highest existing user-defined PriorityClass
Run:
bash
CopyEdit
kubectl get priorityclasses.scheduling.k8s.io
Example output:
vbnet
CopyEdit
NAME VALUE GLOBALDEFAULT AGE
default-low 1000 false 10d
mid-tier 2000 false 7d
critical-pods 1000000 true 30d
Exclude system-defined classes like system-* and the default global one (e.g., critical-pods).
Let’s assume the highest user-defined value is 2000.
So your new class should be:
Value = 1999
3️ ⃣ Create the high-priority PriorityClass
Create a file called high-priority.yaml:
cat <<EOF > high-priority.yaml
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 1999
globalDefault: false
description: "High priority class for user workloads"
EOF
Apply it:
kubectl apply -f high-priority.yaml
4️ ⃣ Patch the busybox-logger deployment
Now 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 work
Confirm the patch was applied:
kubectl get deployment busybox-logger -n priority -o
jsonpath='{.spec.template.spec.priorityClassName}’
✅ You should see:
high-priority
Also, confirm the class exists:
kubectl get priorityclass high-priority
Final Command Summary
ssh cka000049
kubectl get priorityclass
# Create the new PriorityClass cat <<EOF > high-priority.yaml apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata:
name: high-priority
value: 1999
globalDefault: false
description: "High priority class for user workloads"
EOF
kubectl apply -f high-priority.yaml
# Patch the deployment
kubectl patch deployment busybox-logger -n priority
–type=’merge’
-p ‘{"spec": {"template": {"spec": {"priorityClassName": "high-priority"}}}}’
# Verify
kubectl get deployment busybox-logger -n priority -o
jsonpath='{.spec.template.spec.priorityClassName}’
kubectl get priorityclass high-priority
