CKA with practice tests - #111 Multiple container pods

Task 8
Edit the pod to add a sidecar container to send logs to Elastic Search. Mount the log volume to the sidecar container.
Only add a new container. Do not modify anything else. Use the spec provided below.

The 2nd container sidecar is added successfully using below snippets and running well, but it just fails checks. Can someone pls validate the lab provisioned?

  - name: sidecar
    image: kodekloud/filebeat-configured
    volumeMounts:
    - mountPath: /var/log/event-simulator/
      name: log-volume

controlplane ~ ➜ k get pod
NAME READY STATUS RESTARTS AGE
app 2/2 Running 0 84s

The results of running checks:
v Name: app

× Container Name: sidecar

× Container Image: kodekloud/filebeat-configured

× Volume Mount: log-volume

× Mount Path: /var/log/event-simulator/

v Existing Container Name: app

Existing Container Image: kodekloud/event-simulator

This particular lab has a trick to it: there are two distinct pods called app:

controlplane ~ ✖ k get po -A | grep app
default         app                                    1/1     Running   0          3m33s
elastic-stack   app                                    1/1     Running   0          3m35s

Odds are you modified the one in default. But the app we’re operating on here is in the elastic-stack namespace. It’s a common error in this lab :slight_smile:

1 Like

indeed, i was in the default namespace. thanks Rob for the tips, so that i could get out of it