Courseiva

CKAD Application Design and Build Practice Question

A pod named 'app' has a container that logs to stdout. You want to add a sidecar container that streams these logs to a centralized logging service. Which pattern does this represent?

⚠ Common exam trap

It's easy for candidates to confuse the Sidecar pattern with the Ambassador pattern because both involve adding a helper container, but the Ambassador pattern specifically handles network proxying, not log streaming.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Sidecar pattern

The sidecar pattern involves adding a secondary container (the sidecar) to the same pod as the primary container to extend or enhance its functionality without altering the primary container itself. In this scenario, the sidecar container reads the logs from the primary container's stdout (typically via a shared volume or by tailing the container's log file) and forwards them to a centralized logging service, such as Elasticsearch, Fluentd, or a cloud logging endpoint. This pattern is a core Kubernetes design pattern for modular, non-invasive extensions.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Ambassador pattern

    Why it's wrong here

    An ambassador sidecar proxies the container's outbound network connections, handling routing, retries, or TLS on its behalf. It does not read stdout or forward log streams. Ambassador suits abstracting external service access, such as connecting a legacy app to a database through a local proxy.

  • ✗

    Adapter pattern

    Why it's wrong here

    An adapter sidecar transforms or normalises a container's output format, such as exposing custom metrics in a standard schema, rather than shipping raw stdout elsewhere. Streaming logs to a central service is the logging sidecar's job. Adapter suits reformatting data for a monitoring system expecting a specific interface.

  • ✓

    Sidecar pattern

    Why this is correct

    A sidecar container runs alongside the primary application container in the same pod, sharing its lifecycle, network namespace and volumes. Here it reads the app container's stdout log stream and forwards it to the centralised logging service, which is the defining sidecar pattern.

  • ✗

    Init container pattern

    Why it's wrong here

    Init containers run to completion before the main container starts, so they cannot concurrently tail a running container's stdout stream. Log shipping requires a process alive alongside the app. Init containers suit one-off setup tasks like fetching configuration, running migrations, or waiting for a dependency.

About these practice questions

Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.