---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tiny-tools-dep
  namespace: default
  labels:
    app: tiny-tools-dep
spec:
  selector:
    matchLabels:
      app: tiny-tools-dep
  # for Deployment
  replicas: 1
  template:
    metadata:
      labels:
        app: tiny-tools-dep
      # avoid istio envy project if being auto-injected
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
# for Deployment, so scaling is forced to happen on different nodes
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - tiny-tools
            topologyKey: "kubernetes.io/hostname"
      containers:
      - name: tiny-tools
        image: giantswarm/tiny-tools:3.12
        args:
        - /bin/sh
        - -c
        - touch /tmp/healthy; date; echo "starting..."; sleep 30d
        livenessProbe:
          exec:
            command:
            - cat
            - /tmp/healthy
          initialDelaySeconds: 5
          periodSeconds: 5
        readinessProbe:
          exec:
            command:
            - cat
            - /tmp/healthy
          initialDelaySeconds: 5
          periodSeconds: 5
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
