Hello, any person have idea why my submission on 100 days devops challenge Day 55: Kubernetes Sidecar Containers? I think i already do it correctly. Here’s some screenshot
That’s because you have placed the sidecar-container in the regular containers block.
Whenever you see keywords like sidecar or sidecar-pattern, it means the container needs to be placed inside the initContainers block with restartPolicy: Always set.
Please refer to the official docs for more info on this.
containers:
- name: nginx-container
image: nginx:latest
volumeMounts:
- name: shared-logs
mountPath: /var/log/nginx
initContainers:
- name: sidecar-container #<-- This is a sidecar
image: ubuntu:latest
restartPolicy: Always # <-- This makes it run along with main container
thank you very much sir
