What is the error and why not passed day 55 of 100 Days of DevOps


apiVersion: v1
kind: Pod
metadata:
name: webserver
spec:
volumes:
- name: shared-logs
emptyDir: {}
containers:

  • image: nginx:latest
    name: nginx-container
    volumeMounts:
    • name: shared-logs
      mountPath: /var/log/nginx
  • image: ubuntu:latest
    name: sidecar-container
    command: [“sh”,“-c”,“while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done”]
    volumeMounts:
    • name: shared-logs
      mountPath: /var/log/nginx
      status: {}

This requires placing the sidecar-container in the initContainers with restartPolicy set to Always.

Refer to the official docs for more on sidecar containers.

check this if it helps
kodekloud-eng-100-days-devops/DAY55/Task-55-WebserverSidecarPod.md at main · MiqdadProjects/kodekloud-eng-100-days-devops · GitHub