Skip to content
CKADApplication Design and BuildSingle nodeMedium

Sidecar container sharing an emptyDir

Scenario ckad-des-001 · about 7 minutes · 8 points · 8 grader checks

Build a two-container Pod where a log-shipping sidecar reads a file the main container writes into a shared volume.

  • multi-container
  • sidecar
  • emptydir
  • pod
  • volumes

What you will practise

  • Define a Pod with more than one container
  • Share data between containers with an emptyDir volume
  • Know the native sidecar form (restartPolicy: Always init container)
  • Read a file from a specific container with kubectl exec -c

Start this lab

With the CLI installed and signed in, this command provisions a single node cluster on your Mac, applies the scenario setup and prints the task below.

goldenkube start ckad-des-001

Task

The task text exactly as the CLI shows it. Solve it on the cluster, then run goldenkube submit.

In namespace "design" (create it if it does not exist) create a Pod named "log-pod" with two containers that share an emptyDir volume named "logs": 1. Container "app", image busybox:1.36, command: sh -c 'while true; do date >> /var/log/app/app.log; sleep 5; done' mounting "logs" at /var/log/app. 2. A sidecar container "sidecar", image busybox:1.36, command: sh -c 'touch /var/log/app/app.log; tail -F /var/log/app/app.log' mounting "logs" at /var/log/app. It may be a regular container or a native sidecar (init container with restartPolicy: Always). The Pod must be Running and Ready, and the sidecar must be able to read the log file written by "app".

Requirements and details

Certification
CKAD · Certified Kubernetes Application Developer
Domain
Application Design and Build
Difficulty
Medium
Cluster topology
Single node
Cluster features
None beyond the base cluster
Recommended time
7 minutes
Points
8
Grader checks
8
Kubernetes version
1.37
Minimum CLI version
0.1.0
Scenario version
1
Published

Grading runs locally: 8 state checks read your cluster when you submit; the scenario passes when every check passes. Hints, the reference solution and the check definitions are available only inside the CLI, not on this page.

CKADApplication Design and BuildEasy

Init container prepares content for nginx

Use an init container to write content into a shared volume before the main web container starts.

Single node · ~7 min · 9 points

  • init-container
  • multi-container
  • emptydir
  • pod

goldenkube start ckad-des-002

CKADApplication Design and BuildEasy

Job with completions, parallelism and limits

Create a batch Job that runs several completions in parallel with retry and deadline limits.

Single node · ~6 min · 8 points

  • job
  • batch
  • completions
  • parallelism

goldenkube start ckad-des-003

CKADApplication Design and BuildMedium

CronJob with history limits and a manual run

Create a CronJob with concurrency and history settings, then trigger an immediate run from it.

Single node · ~7 min · 9 points

  • cronjob
  • job
  • batch
  • schedule

goldenkube start ckad-des-004

Independent community project, not affiliated with or endorsed by CNCF or The Linux Foundation. Lab results are practice feedback, not an exam score.