apiVersion: apps/v1
kind: Deployment
metadata:
  name: empty-dir-ex
spec:
  selector:
    matchLabels:
      app: empty-dir-ex
  template:
    metadata:
      labels:
        app: empty-dir-ex
    spec:
      volumes:
        - name: empty-dir-html
          emptyDir: {}
      containers:
        - name: nginx
          image: nginx:alpine
          volumeMounts:
            - name: empty-dir-html
              mountPath: /usr/share/nginx/html
              readOnly: true
          resources:
            limits:
              memory: "64Mi"
              cpu: "200m"
          ports:
            - containerPort: 80
        - name: html-updater
          image: alpine
          volumeMounts:
            - name: empty-dir-html
              mountPath: /html
          command: ["/bin/sh", "-c"]
          args:
            - while true; do date >> /html/index.html; sleep 10; done
