Free CKA Exam Braindumps (page: 8)

Page 8 of 31

Change the Image version back to 1.17.1 for the pod you just updated and observe the changes

  1. Solution:

    kubectl set image pod/nginx nginx=nginx:1.17.1
    kubectl describe po nginx
    kubectl get po nginx -w # watch it

Answer(s): A



Create a redis pod, and have it use a non-persistent storage Note: In exam, you will have access to kubernetes.io site, Refer : https://kubernetes.io/docs/tasks/configure-pod-container/configurevolume-storage/

  1. Solution:

    apiVersion: v1
    kind: Pod
    metadata:
    name: redis
    spec:
    containers:
    - name: redis
    image: redis
    volumeMounts:
    - name: redis-storage
    mountPath: /data/redis
    ports:
    - containerPort: 6379
    volumes:
    - name: redis-storage
    emptyDir: {}

Answer(s): A



Create a Pod with three busy box containers with commands "ls; sleep 3600;", "echo Hello World; sleep 3600;" and "echo this is the third container; sleep 3600" respectively and check the status

  1. Solution:

    // first create single container pod with dry run flag kubectl run busybox --image=busybox --restart=Always --dry-run -o yaml -- bin/sh -c "sleep 3600; ls" > multi-container.yaml // edit the pod to following yaml and create it
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: busybox
    name: busybox
    spec:
    containers:
    - args:
    - bin/sh
    - -c
    - ls; sleep 3600
    image: busybox
    name: busybox-container-1
    - args:
    - bin/sh
    - -c
    - echo Hello world; sleep 3600
    image: busybox
    name: busybox-container-2
    - args:
    - bin/sh
    - -c
    - echo this is third container; sleep 3600
    image: busybox
    name: busybox-container-3
    restartPolicy: Always
    // Verify
    Kubectl get pods

Answer(s): A



Check logs of each container that "busyboxpod-{1,2,3}"

  1. Solution:


    kubectl logs busybox -c busybox-container-1
    kubectl logs busybox -c busybox-container-2
    kubectl logs busybox -c busybox-container-3

Answer(s): A



Page 8 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