apiVersion: v1
kind: Pod
metadata:
  labels:
    app: ubuntu
  name: server
spec:
  initContainers:
  - name: init-myservice
    image: busybox:1.28
    env:
    - name: DEMO_VAR
      value: "HELLO"
    command: ["/bin/sh","-c"]
    args: ["echo $DEMO_VAR"]
  containers:
  - image: singharunk/dev:latest
    name: container-x
    command: ['sh', '-c', 'echo I am $DEMO_VAR ! > /opt/share1/dummy1.txt && sleep 3600']
    env:
    - name: DEMO_VAR
      value: "Harry Potter"
    volumeMounts:
    - name: shared-data
      mountPath: /opt/share1
  - name: container-y
    image: singharunk/dev:latest
    command: ['sh', '-c', 'echo The app is running! > /opt/share/dummy.txt && sleep 3600']
    volumeMounts:
    - name: shared-data
      mountPath: /opt/share 
  volumes:
  - name: shared-data
    emptyDir: {}
