apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: devworkspace-controller
    app.kubernetes.io/part-of: devworkspace-operator
  name: devworkspace-controller-manager
  namespace: devworkspace-controller
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: devworkspace-controller
      app.kubernetes.io/part-of: devworkspace-operator
  template:
    metadata:
      labels:
        app.kubernetes.io/name: devworkspace-controller
        app.kubernetes.io/part-of: devworkspace-operator
    spec:
      containers:
      - args:
        - /usr/local/bin/devworkspace-controller
        - --enable-leader-election
        - --metrics-addr=127.0.0.1:8080
        env:
        - name: WEBHOOK_SECRET_NAME
          value: devworkspace-operator-webhook-cert
        - name: RELATED_IMAGE_devworkspace_webhook_server
          value: quay.io/devfile/devworkspace-controller:next
        - name: RELATED_IMAGE_kube_rbac_proxy
          value: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
        - name: RELATED_IMAGE_project_clone
          value: quay.io/devfile/project-clone:next
        - 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_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
        image: quay.io/devfile/devworkspace-controller:next
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /healthz
            port: liveness-port
            scheme: HTTP
          initialDelaySeconds: 15
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        name: devworkspace-controller
        ports:
        - containerPort: 9443
          name: conversion
          protocol: TCP
        - containerPort: 6789
          name: liveness-port
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /readyz
            port: liveness-port
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        resources:
          limits:
            cpu: 1000m
            memory: 1Gi
          requests:
            cpu: 250m
            memory: 100Mi
        volumeMounts:
        - mountPath: /tmp/k8s-webhook-server/serving-certs
          name: webhook-tls-certs
          readOnly: true
      - args:
        - --secure-listen-address=0.0.0.0:8443
        - --upstream=http://127.0.0.1:8080/
        - --logtostderr=true
        - --v=10
        image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
        name: kube-rbac-proxy
        ports:
        - containerPort: 8443
          name: metrics
      serviceAccountName: devworkspace-controller-serviceaccount
      terminationGracePeriodSeconds: 10
      volumes:
      - name: webhook-tls-certs
        secret:
          defaultMode: 420
          secretName: devworkspace-operator-webhook-cert
