Free CKA Exam Braindumps
Certified Kubernetes Administrator Questions 41–45 (page: 10)

Updated On: 10-Feb-2026

Get all the pods with label "env"

  1. Solution:

    kubectl get pods -L env

Answer(s): A



Change the label for one of the pod to env=uat and list all the pods to verify

  1. Solution:


    kubectl label pod/nginx-dev3 env=uat --overwrite
    kubectl get pods --show-labels

Answer(s): A



Get list of all the nodes with labels

  1. Solution:

    kubectl get nodes --show-labels

Answer(s): A



Create a nginx pod that will be deployed to node with the label "gpu=true"

  1. Solution:

    kubectl run nginx --image=nginx --restart=Always --dry-run -o yaml > nodeselector-pod.yaml
    // add the nodeSelector like below and create the pod kubectl apply -f nodeselector-pod.yaml
    vim nodeselector-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: nginx
    spec:
    nodeSelector:
    gpu: true
    containers:
    - image: nginx
    name: nginx
    restartPolicy: Always
    kubectl apply -f nodeselector-pod.yaml
    //Verify
    kubectl get no ­show-labels
    kubectl get po
    kubectl describe po nginx | grep Node-Selectors

Answer(s): A



Annotate the pod with name=webapp

  1. Solution:

    kubectl annotate pod nginx-dev-pod name=webapp
    kubectl annotate pod nginx-prod-pod name=webapp
    // Verify
    kubectl describe po nginx-dev-pod | grep -i annotations kubectl describe po nginx-prod-pod | grep -i annotations

Answer(s): A



Viewing page 10 of 26
Viewing questions 46 - 50 out of 122 questions


Post your Comments and Discuss Linux Foundation CKA exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!