apiVersion: apps/v1
kind: Deployment
metadata: # kpt-merge: /workflow-controller
  name: workflow-controller
  annotations:
    internal.kpt.dev/upstream-identifier: 'apps|Deployment|default|workflow-controller'
spec:
  selector:
    matchLabels:
      app: workflow-controller
  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:
            - --configmap
            - workflow-controller-configmap
            - --executor-image
            - quay.io/argoproj/argoexec:latest
          env:
            - name: LEADER_ELECTION_IDENTITY
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
          ports:
            - name: metrics
              containerPort: 9090
            - containerPort: 6060
          livenessProbe:
            httpGet:
              port: 6060
              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
