Free CKA Exam Braindumps (page: 2)

Page 2 of 31

Create a busybox pod that runs the command "env" and save the output to "envpod" file

  1. Solution:

    kubectl run busybox --image=busybox --restart=Never ­-rm -it -- env > envpod.yaml

Answer(s): A



List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error- logs"

  1. Solution:
    Kubectl logs frontend | grep -i "started" > /opt/error-logs

Answer(s): A



Create a pod that echo "hello world" and then exists. Have the pod deleted automatically when it's completed

  1. Solution:

    kubectl run busybox --image=busybox -it --rm --restart=Never -- /bin/sh -c 'echo hello world'
    kubectl get po # You shouldn't see pod with the name "busybox"

Answer(s): A



Create a pod with environment variables as var1=value1.Check the environment variable in pod

  1. Solution:

    kubectl run nginx --image=nginx --restart=Never --env=var1=value1 # then
    kubectl exec -it nginx -- env
    # or
    kubectl exec -it nginx -- sh -c 'echo $var1'
    # or
    kubectl describe po nginx | grep value1

Answer(s): A



Page 2 of 31



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

Atsushi commented on January 13, 2024
That's good!!
Anonymous
upvote