apiVersion: apps/v1
kind: Deployment
metadata:
  name: workflow-controller
spec:
  selector:
    matchLabels:
      app: workflow-controller
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: workflow-controller
    spec:
      priorityClassName: workflow-controller
      serviceAccountName: argo
      containers:
        - name: workflow-controller
          image: quay.io/argoproj/workflow-controller:latest
          securityContext:
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
          command:
            - workflow-controller
          args: [ ]
          env:
            - name: LEADER_ELECTION_IDENTITY
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
          ports:
            - name: metrics
              containerPort: 9090
            - name: healthz
              containerPort: 6060
          readinessProbe:
            httpGet:
              port: metrics
              path: /metrics
          livenessProbe:
            httpGet:
              port: healthz
              path: /healthz
            # Require three failures to tolerate transient errors.
            failureThreshold: 3
            initialDelaySeconds: 90
            periodSeconds: 60
            timeoutSeconds: 30
      securityContext:
        runAsNonRoot: true
      nodeSelector:
        kubernetes.io/os: linux
