apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: notifications-controller
    app.kubernetes.io/name: argocd-notifications-controller
    app.kubernetes.io/part-of: argocd
  name: argocd-notifications-controller
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: argocd-notifications-controller
  template:
    metadata:
      labels:
        app.kubernetes.io/name: argocd-notifications-controller
    spec:
      volumes:
        - name: tls-certs
          configMap:
            name: argocd-tls-certs-cm
        - name: argocd-repo-server-tls
          secret:
            secretName: argocd-repo-server-tls
            optional: true
            items:
            - key: tls.crt
              path: tls.crt
            - key: tls.key
              path: tls.key
            - key: ca.crt
              path: ca.crt
      containers:
        - args:
            - /usr/local/bin/argocd-notifications
          env:
            - name: ARGOCD_NOTIFICATIONS_CONTROLLER_LOGFORMAT
              valueFrom:
                configMapKeyRef:
                  key: notificationscontroller.log.format
                  name: argocd-cmd-params-cm
                  optional: true
            - name: ARGOCD_NOTIFICATIONS_CONTROLLER_LOGLEVEL
              valueFrom:
                configMapKeyRef:
                  key: notificationscontroller.log.level
                  name: argocd-cmd-params-cm
                  optional: true
            - name: ARGOCD_LOG_FORMAT_TIMESTAMP
              valueFrom:
                configMapKeyRef:
                  name: argocd-cmd-params-cm
                  key: log.format.timestamp
                  optional: true
            - name: ARGOCD_APPLICATION_NAMESPACES
              valueFrom:
                configMapKeyRef:
                  key: application.namespaces
                  name: argocd-cmd-params-cm
                  optional: true
            - name: ARGOCD_NOTIFICATION_CONTROLLER_SELF_SERVICE_NOTIFICATION_ENABLED
              valueFrom:
                configMapKeyRef:
                  key: notificationscontroller.selfservice.enabled
                  name: argocd-cmd-params-cm
                  optional: true
            - name: ARGOCD_NOTIFICATION_CONTROLLER_REPO_SERVER_PLAINTEXT
              valueFrom:
                configMapKeyRef:
                  key: notificationscontroller.repo.server.plaintext
                  name: argocd-cmd-params-cm
                  optional: true
          workingDir: /app
          livenessProbe:
            tcpSocket:
              port: 9001
          image: quay.io/argoproj/argocd:latest
          imagePullPolicy: Always
          name: argocd-notifications-controller
          volumeMounts:
            - name: tls-certs
              mountPath: /app/config/tls
            - name: argocd-repo-server-tls
              mountPath: /app/config/reposerver/tls
          securityContext:
            capabilities:
              drop:
              - ALL
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
      serviceAccountName: argocd-notifications-controller
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      nodeSelector:
        kubernetes.io/os: linux