apiVersion: apps/v1
kind: Deployment
metadata:
  name: manager
  namespace: system
spec:
  replicas: 1
  template:
    spec:
      terminationGracePeriodSeconds: 10
      serviceAccountName: $(CONTROLLER_SERVICE_ACCOUNT)
      containers:
        - name: kube-rbac-proxy
          image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
          args:
          - "--secure-listen-address=0.0.0.0:8443"
          - "--upstream=http://127.0.0.1:8080/"
          - "--logtostderr=true"
          - "--v=10"
          ports:
          - name: metrics
            containerPort: 8443
        - name: devworkspace-controller
          image: quay.io/devfile/devworkspace-controller:next
          ports:
            - name: liveness-port
              containerPort: 6789
            - name: conversion
              protocol: TCP
              containerPort: 9443
          livenessProbe:
            failureThreshold: 5
            httpGet:
              path: /healthz
              port: liveness-port
              scheme: HTTP
            initialDelaySeconds: 15
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 5
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /readyz
              port: liveness-port
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 5
          args:
            - /usr/local/bin/devworkspace-controller
            - --enable-leader-election
            - "--metrics-addr=127.0.0.1:8080"
          resources:
            limits:
              cpu: 1000m
              memory: 1Gi
            requests:
              cpu: 250m
              memory: 100Mi
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "devworkspace-operator"
            - name: CONTROLLER_SERVICE_ACCOUNT_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
            - name: MAX_CONCURRENT_RECONCILES
              value: "5"
            - name: WEBHOOKS_SERVER_MEMORY_LIMIT
              value: 300Mi
            - name: WEBHOOKS_SERVER_MEMORY_REQUEST
              value: 20Mi
            - name: WEBHOOKS_SERVER_CPU_LIMIT
              value: 200m
            - name: WEBHOOKS_SERVER_CPU_REQUEST
              value: 100m
            - name: RELATED_IMAGE_plugin_redhat_developer_web_terminal_4_5_0
              value: "quay.io/eclipse/che-machine-exec:nightly"
            - name: RELATED_IMAGE_web_terminal_tooling
              value: "quay.io/wto/web-terminal-tooling:latest"
            - name: RELATED_IMAGE_devworkspace_webhook_server
              value: "quay.io/devfile/devworkspace-controller:next"
            - name: RELATED_IMAGE_pvc_cleanup_job
              value: "registry.access.redhat.com/ubi8-micro:8.4-81"
            - name: RELATED_IMAGE_async_storage_server
              value: "quay.io/eclipse/che-workspace-data-sync-storage:0.0.1"
            - name: RELATED_IMAGE_async_storage_sidecar
              value: "quay.io/eclipse/che-sidecar-workspace-data-sync:0.0.1"
            - name: RELATED_IMAGE_project_clone
              value: "quay.io/devfile/project-clone:next"
            - name: RELATED_IMAGE_kube_rbac_proxy
              value: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
