Free CKA Exam Braindumps

Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.

  1. Solution:

    kubectl create namespace development
    kubectl run nginx --image=nginx --restart=Never -n development

Answer(s): A



Create a redis pod and mount "redis-config" as "redis.conf" inside redis container, name the config volume as "redis-volume" redis-config path - /opt/redis-config

  1. 1
  2. 2
  3. Pending

Answer(s): C



Create an nginx pod and load environment values from the above configmap "keyvalcfgmap" and exec into the pod and verify the environment variables and delete the pod

  1. Solution:

    // first run this command to save the pod yaml
    kubectl run nginx --image=nginx --restart=Always --dry-run -o yaml > nginx-pod.yml
    // edit the yml to below file and create
    vim nginx-pod.yml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: nginx
    name: nginx
    spec:
    containers:
    - image: nginx
    name: nginx
    envFrom:
    - configMapRef:
    name: keyvalcfgmap
    restartPolicy: Always
    kubectl apply -f nginx-pod.yml
    // verify
    kubectl exec -it nginx -- env
    kubectl delete po nginx

Answer(s): A



Create a file called "config.txt" with two values key1=value1 and key2=value2. Then create a configmap named "keyvalcfgmap" andread data from the file "config.txt" and verify that configmap is
created correctly

  1. Solution:

    cat >> config.txt << EOF
    key1=value1
    key2=value2
    EOF
    cat config.txt


    // Create configmap from "config.txt" file
    kubectl create cm keyvalcfgmap --from-file=config.txt //Verify
    kubectl get cm keyvalcfgmap -o yaml

Answer(s): A



Create a configmap called myconfigmap with literal value appname=myapp

  1. Solution:

    kubectl create cm myconfigmap --from-literal=appname=myapp // Verify
    kubectl get cm -o yaml
    (or)
    kubectl describe cm

Answer(s): A