apiVersion: v1
kind: Namespace
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: cdi-operator
  namespace: cdi
  labels:
    operator.cdi.kubevirt.io: ""
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cdi-operator
  labels:
    operator.cdi.kubevirt.io: ""
subjects:
- kind: ServiceAccount
  name: cdi-operator
  namespace: cdi
roleRef:
  kind: ClusterRole
  name: cluster-admin
  apiGroup: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: "cdi-operator-leader-election-helper"
  namespace: cdi
  labels:
    operator.cdi.kubevirt.io: ""
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cdi-operator
  namespace: cdi
  labels:
    operator.cdi.kubevirt.io: ""
spec:
  replicas: 1
  selector:
    matchLabels:
      name: cdi-operator
  template:
    metadata:
      labels:
        name: cdi-operator
    spec:
      serviceAccountName: cdi-operator
      containers:
        - name: cdi-operator
          image: kubevirt/cdi-operator:v1.5.2
          ports:
          - containerPort: 60000
            name: metrics
          imagePullPolicy: Always
          env:
          - name: DEPLOY_CLUSTER_RESOURCES
            value: 'true'
          - name: DOCKER_REPO
            value: kubevirt
          - name: DOCKER_TAG
            value: latest
          - name: CONTROLLER_IMAGE
            value: cdi-controller
          - name: IMPORTER_IMAGE
            value: cdi-importer
          - name: CLONER_IMAGE
            value: cdi-cloner
          - name: APISERVER_IMAGE
            value: cdi-apiserver
          - name: UPLOAD_PROXY_IMAGE
            value: cdi-uploadproxy
          - name: UPLOAD_SERVER_IMAGE
            value: cdi-uploadserver
          - name: VERBOSITY
            value: '1'
          - name: PULL_POLICY
            value: IfNotPresent
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: cdis.cdi.kubevirt.io
  labels:
    operator.cdi.kubevirt.io: ""
spec:
  group: cdi.kubevirt.io
  names:
    kind: CDI
    listKind: CDIList
    plural: cdis
    singular: cdi
  scope: Cluster
  version: v1alpha1
