---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment-timer
spec:
  replicas: 1
  selector:
    matchLabels:
      lbl: myTime
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        lbl: myTime
    spec:
      volumes:
      - name: volume-1g
        persistentVolumeClaim:
          claimName: pvc-1g
      initContainers:
      - name: read-shared
        image: alpine:latest
        command: ['sh', '-c', 'sleep 22; cat /mnt/vol-1g/myDate.txt']
        volumeMounts:
            - mountPath: "/mnt/vol-1g"
              name: volume-1g
      containers:
        - image:  ups91/kube-test-pods:timer
          imagePullPolicy: Always
          name: timer
          ports:
            - containerPort: 8002
          resources:
            limits:
              cpu: "100m"
              memory: "32Mi"
