apiVersion: apps/v1
kind: Deployment
metadata:
  name: thor-deployment
spec:
  selector:
    # Only select pods based on the 'app' label
    matchLabels:
      app: thor
  revisionHistoryLimit: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: thor
        public: "yes"
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app
                  operator: In
                  values:
                  - thor
              topologyKey: "kubernetes.io/hostname"
      automountServiceAccountToken: false
      containers:
      - name: thor
        image: quay.io/cdis/thor:master
        imagePullPolicy: Always
        volumeMounts:
          - name: config-volume-g3auto
            readOnly: true
            mountPath: /src/.env
            subPath: metadata.env
      volumes:
        - name: config-volume-g3auto
          secret:
            secretName: thor-g3auto
