apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: argocd-image-updater
    app.kubernetes.io/part-of: argocd-image-updater
    app.kubernetes.io/component: controller
  name: argocd-image-updater
spec:
  selector:
   matchLabels:
    app.kubernetes.io/name: argocd-image-updater
  template:
    metadata:
      labels:
        app.kubernetes.io/name: argocd-image-updater
    spec:
      containers:
      - command:
        - /usr/local/bin/argocd-image-updater
        - run
        image: quay.io/argoprojlabs/argocd-image-updater:latest
        imagePullPolicy: Always
        env:
        - name: APPLICATIONS_API
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: applications_api
              optional: true
        - name: ARGOCD_GRPC_WEB
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: argocd.grpc_web
              optional: true
        - name: ARGOCD_SERVER
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: argocd.server_addr
              optional: true
        - name: ARGOCD_INSECURE
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: argocd.insecure
              optional: true
        - name: ARGOCD_PLAINTEXT
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: argocd.plaintext
              optional: true
        - name: ARGOCD_TOKEN
          valueFrom:
            secretKeyRef:
              name: argocd-image-updater-secret
              key: argocd.token
              optional: true
        - name: IMAGE_UPDATER_LOGLEVEL
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: log.level
              optional: true
        - name: GIT_COMMIT_USER
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: git.user
              optional: true
        - name: GIT_COMMIT_EMAIL
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: git.email
              optional: true
        - name: IMAGE_UPDATER_KUBE_EVENTS
          valueFrom:
            configMapKeyRef:
              name: argocd-image-updater-config
              key: kube.events
              optional: true
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 30
        name: argocd-image-updater
        ports:
        - containerPort: 8080
        readinessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 30
        volumeMounts:
        - mountPath: /app/config
          name: image-updater-conf
        - mountPath: /app/config/ssh
          name: ssh-known-hosts
      serviceAccountName: argocd-image-updater
      volumes:
      - configMap:
          items:
          - key: registries.conf
            path: registries.conf
          - key: git.commit-message-template
            path: commit.template
          name: argocd-image-updater-config
          optional: true
        name: image-updater-conf
      - configMap:
          name: argocd-ssh-known-hosts-cm
          optional: true
        name: ssh-known-hosts
