apiVersion: v1
kind: Pod
metadata:
  name: webserver
  labels:
    run: webserver
    type: front-end
spec:
  volumes:
    - name: shared-logs
      emptyDir: {}
  containers:
  - name: nginx-container
    image: nginx:latest
    volumeMounts:
    - mountPath: /var/log/nginx
      name: shared-logs
  - name: sidecar-container
    image: ubuntu:latest
    command: ["/bin/sh"]
    args: ["-c","while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done"]
    volumeMounts:
    - mountPath: /var/log/nginx
      name: shared-logs

