CKA 2025 MOCK Q-02 Side Car Conatiner

 

🔶 Mock Question: Add a Sidecar Container for Log Tailing

Task

You have a Deployment named myapp in the default namespace.

This Deployment has a single container named myapp which writes log messages to a file at /opt/logs.txt every second.

Currently, there is no mechanism to tail or view this log in real-time.


Your Task:

  1. Add a sidecar container to the existing Deployment named logshipper.

  2. This container must:

    • Use the image alpine:latest

    • Run the following command:

      tail -F /opt/logs.txt
  3. Both containers must share a volume at path /opt using an emptyDir volume named data.

  4. Do not delete or modify the original myapp container.

  5. Make sure the logshipper runs as a sidecar container, not as an initContainer.

Comments

Popular posts from this blog

CKA 2025 MOCK Q-05 HPA

CKA-2025 MOCK Q-06 PRIORITY

Cert-manager - Custom Resource Definitions