Skip to content

[Bug] CKAD 1 Question 6: Sidecar container should be under initContainers #46

Description

@miriSch

Describe the bug

In the first CKAD exam, the solution and the second check is wrong according to kubernetes documentation.

Environment (please complete the following):

Report in Depth

In the first CKAD exam, the solution places the sidecar container in spec.containers (https://github.com/sailor-sh/CK-X/blob/master/facilitator/assets/exams/ckad/001/answers.md#question-6-create-a-multi-container-pod-with-sidecar-logging-pattern) and also the check for the second subtask expects it there (

MOUNT_IN_CONTAINER2=$(kubectl get pod sidecar-pod -n troubleshooting -o jsonpath="{.spec.containers[1].volumeMounts[?(@.name==\"$VOLUME\")].mountPath}" 2>/dev/null)
).

According to the documentation https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/#pod-sidecar-containers sidecar containers should be placed in spec.initContainers, so the solution and the checks are wrong.

Steps to reproduce

Expected Behavior

Checks passing, correct solution documented.

Actual Behaviour

The check "Pod has shared volume mounted in both containers" fails and the solution places the sidecar container under spec.containers

Screenshots / Logs

Workaround

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions