apiVersion: v1
kind: Pod
metadata:
  labels:
    run: busybox-sidecar
  name: busybox-sidecar
spec:
  volumes:
  - name: var-logs
    emptyDir: {}
  containers:
  - name: sidecar-container
    image: nginx
    ports:
      - containerPort: 80
    volumeMounts:
    - name: var-logs
      mountPath: /usr/share/nginx/html
  - name: main-container
    image: busybox
    args:
    - bin/sh
    - -c
    - >
      while true;
      do
        echo 'Hi I am from Main Container' >> /var/log/index.html;
        sleep 5;
      done
    volumeMounts:
    - name: var-logs
      mountPath: /var/logs
  dnsPolicy: ClusterFirst
  restartPolicy: Never
status: {}
