Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

CKAD Practice Exam - Part 2

This lab is designed to help prepare for the kinds of tasks and scenarios encountered during the Certified Kubernetes Application Developer (CKAD) exam. In this lab, we will practice working with multi-container pods by creating a pod that implements an adapter design pattern. We will create a pod that generates some log output and uses an adapter pod to format the output.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 22, 2025
Duration
1h 30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create a ConfigMap to Store the fluentd Configuration
    1. Switch to root so you can read the config file:

      sudo -i
      
    2. Get the contents of the config file:

      cat /usr/ckad/fluent.conf
      
    3. Create a descriptor for the ConfigMap with vi fluentd-config.yml:

      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: fluentd-config
      data:
        fluent.conf: |
          <source>
            type tail
            format none
            path /var/log/1.log
            pos_file /var/log/1.log.pos
            tag count.format1
          </source>
      
          <source>
            type tail
            format none
            path /var/log/2.log
            pos_file /var/log/2.log.pos
            tag count.format2
          </source>
      
          <match **>
            @type file
            path /var/logout/count
            time_slice_format %Y%m%d%H%M%S
            flush_interval 5s
            log_level trace
          </match>
      
    4. Create the ConfigMap in the cluster:

      kubectl apply -f fluentd-config.yml
      
  2. Challenge

    Create the Pod Descriptor
    1. Switch to root so you can work with the descriptor file:

      sudo -i
      
    2. Edit the descriptor file with vi /usr/ckad/adapter-pod.yml:

      apiVersion: v1
      kind: Pod
      metadata:
        name: counter
      spec:
        containers:
        - name: count
          image: busybox
          args:
          - /bin/sh
          - -c
          - >
            i=0;
            while true;
            do
              echo "$i: $(date)" >> /var/log/1.log;
              echo "$(date) INFO $i" >> /var/log/2.log;
              i=$((i+1));
              sleep 1;
            done
          volumeMounts:
          - name: varlog
            mountPath: /var/log
        - name: adapter
          image: k8s.gcr.io/fluentd-gcp:1.30
          env:
          - name: FLUENTD_ARGS
            value: -c /fluentd/etc/fluent.conf
          volumeMounts:
          - name: varlog
            mountPath: /var/log
          - name: config-volume
            mountPath: /fluentd/etc
          - name: logout
            mountPath: /var/logout
        volumes:
        - name: varlog
          emptyDir: {}
        - name: config-volume
          configMap:
            name: fluentd-config
        - name: logout
          hostPath:
            path: /usr/ckad/log_output
      
  3. Challenge

    Create the Pod in the Cluster and Make Sure It Is Working
    1. Create the pod:

      kubectl apply -f /usr/ckad/adapter-pod.yml
      
    2. Verify that the pod starts up:

      kubectl get pod counter
      
    3. You can also verify that everything is working by checking the output directory on the worker node. Log in to the worker from the master:

      ssh [email protected]
      
    4. Look for the fluentd output files in the output directory:

      ls /usr/ckad/log_output
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight