---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tiny-tools
  # allow for override: kubectl -n <ns> apply ...
  #namespace: default
  labels:
    app: tiny-tools
spec:
  selector:
    matchLabels:
      app: tiny-tools
  # kubectl scale --replicas=x deployment/tiny-tools
  replicas: 1
  template:
    metadata:
      labels:
        app: tiny-tools
      # avoid istio envy project if being auto-injected
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      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

