Linux Foundation CKA Exam
Certified Kubernetes Administrator (Page 8 )

Updated On: 1-Feb-2026

Get list of persistent volumes and persistent volume claim in the cluster

  1. Solution:

    kubectl get pv
    kubectl get pvc

Answer(s): A



Create a daemonset named "Prometheus-monitoring" using image=prom/Prometheus which runs in all the nodes in the cluster. Verify the pod running in all the nodes

  1. Solution:

    vim promo-ds.yaml
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
    name: prometheus-monitoring
    spec:
    selector:
    matchLabels:
    name: prometheus
    template:
    metadata:
    labels:
    name: prometheus
    spec:
    tolerations:
    # remove it if your masters can't run pods
    - key: node-role.kubernetes.io/master
    effect: NoSchedule
    containers:
    - name: prometheus-container
    image: prom/prometheus
    volumeMounts:
    - name: varlog
    mountPath: /var/log
    - name: varlibdockercontainers
    mountPath: /var/lib/docker/containers
    readOnly: true


    volumes:
    - name: varlog
    emptyDir: {}
    - name: varlibdockercontainers
    emptyDir: {}
    kubectl apply -f promo-ds.yaml
    NOTE: Deamonset will get scheduled to "default" namespace, to schedule deamonset in specific namespace, then add
    "namespace" field in metadata
    //Verify
    kubectl get ds
    NAME DESIRED CURRENT READY UP-TO-DATE
    AVAILABLE NODE SELECTOR AGE
    prometheus-monitoring 6 6 0 6
    0 <none> 7s
    kubectl get no # To get list of nodes in the cluster // There are 6 nodes in the cluster, so a pod gets scheduled to each node in the cluster

Answer(s): A



Create a Cronjob with busybox image that prints date and hello from kubernetes cluster message for every minute

  1. Solution:

    CronJob Syntax:
    * --> Minute
    * --> Hours
    * --> Day of The Month
    * --> Month
    * --> Day of the Week
    */1 * * * * --> Execute a command every one minutes.
    vim date-job.yaml
    apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
    name: date-job
    spec:
    schedule: "*/1 * * * *"
    jobTemplate:
    spec:
    template:


    spec:
    containers:
    - name: hello
    image: busybox
    args:
    - /bin/sh
    - -c
    - date; echo Hello from the Kubernetes cluster
    restartPolicy: OnFailure
    kubectl apply -f date-job.yaml
    //Verify
    kubectl get cj date-job -o yaml

Answer(s): A



Watch the job that runs 10 times one by one and verify 10 pods are created and delete those after it's completed

  1. Solution:

    kubectl get job -w
    kubectl get po
    kubectl delete job hello-job

Answer(s): A



Modify "hello-job" and make it run 10 times one after one and 5 times parallelism: 5

  1. Solution:

    kubectl create job hello-job --image=busybox --dry-run -o yaml -- echo "Hello I am from job" > hello-job.yaml
    // edit the yaml file to add completions: 10 and
    kubectl create -f hello-job.yaml
    YAML File:
    apiVersion: batch/v1
    kind: Job
    metadata:
    name: hello-job
    spec:
    completions: 10
    parallelism: 5
    template:
    metadata:


    spec:
    containers:
    - command:
    - echo
    - Hello I am from job
    image: busybox
    name: hello-job
    restartPolicy: Never

Answer(s): A



Viewing page 8 of 26
Viewing questions 36 - 40 out of 122 questions



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

Join the CKA Discussion