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:
-
Add a sidecar container to the existing Deployment named
logshipper
. -
This container must:
-
Use the image
alpine:latest
-
Run the following command:
-
-
Both containers must share a volume at path
/opt
using anemptyDir
volume nameddata
. -
Do not delete or modify the original
myapp
container. -
Make sure the
logshipper
runs as a sidecar container, not as aninitContainer
.
Comments
Post a Comment