apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: hello-rootless-with-policy
  name: hello-rootless-with-policy
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-rootless-with-policy
  template:
    metadata:
      labels:
        app: hello-rootless-with-policy
    spec:
      serviceAccountName: no-root-policy-serviceaccount
      automountServiceAccountToken: false
      containers:
        - image: andifalk/hello-rootless-jib:latest
          name: hello-rootless-with-policy
          resources:
            limits:
              cpu: "1"
              memory: "512Mi"
            requests:
              cpu: "0.5"
              memory: "256Mi"
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 5  
          volumeMounts:
            - name: tmp-volume
              mountPath: /tmp
      restartPolicy: Always
      volumes:
        - name: tmp-volume
          emptyDir: {}
