apiVersion: v1
kind: Namespace
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  labels:
    operator.cdi.kubevirt.io: ""
  name: cdis.cdi.kubevirt.io
spec:
  additionalPrinterColumns:
  - JSONPath: .metadata.creationTimestamp
    name: Age
    type: date
  - JSONPath: .status.phase
    name: Phase
    type: string
  group: cdi.kubevirt.io
  names:
    categories:
    - all
    kind: CDI
    listKind: CDIList
    plural: cdis
    shortNames:
    - cdi
    - cdis
    singular: cdi
  scope: Cluster
  validation:
    openAPIV3Schema:
      properties:
        apiVersion:
          type: string
        kind:
          type: string
        metadata:
          type: object
        spec:
          properties:
            imagePullPolicy:
              enum:
              - Always
              - IfNotPresent
              - Never
              type: string
            uninstallStrategy:
              enum:
              - RemoveWorkloads
              - BlockUninstallIfWorkloadsExist
              type: string
          type: object
  version: v1alpha1
  versions:
  - name: v1alpha1
    served: true
    storage: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    operator.cdi.kubevirt.io: ""
  name: cdi-operator-cluster
rules:
- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - clusterrolebindings
  - clusterroles
  - rolebindings
  - roles
  verbs:
  - '*'
- apiGroups:
  - security.openshift.io
  resources:
  - securitycontextconstraints
  verbs:
  - get
  - list
  - watch
  - update
- apiGroups:
  - ""
  resources:
  - pods
  - services
  verbs:
  - get
  - list
  - watch
  - delete
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs:
  - get
  - list
  - watch
  - create
  - update
- apiGroups:
  - cdi.kubevirt.io
  - upload.cdi.kubevirt.io
  resources:
  - '*'
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - serviceaccounts
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - apps
  resources:
  - deployments
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - authorization.k8s.io
  resources:
  - subjectaccessreviews
  verbs:
  - create
- apiGroups:
  - admissionregistration.k8s.io
  resources:
  - validatingwebhookconfigurations
  - mutatingwebhookconfigurations
  verbs:
  - get
  - list
  - watch
  - create
  - update
- apiGroups:
  - apiregistration.k8s.io
  resources:
  - apiservices
  verbs:
  - get
  - list
  - watch
  - create
  - update
- apiGroups:
  - authorization.k8s.io
  resources:
  - subjectaccessreviews
  verbs:
  - create
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  verbs:
  - get
- apiGroups:
  - cdi.kubevirt.io
  resources:
  - datavolumes
  verbs:
  - list
- apiGroups:
  - cdi.kubevirt.io
  resources:
  - cdis
  verbs:
  - get
- apiGroups:
  - cdi.kubevirt.io
  resources:
  - cdis/finalizers
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  - volumesnapshots
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - delete
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims/finalizers
  - pods/finalizers
  - volumesnapshots/finalizers
  verbs:
  - update
- apiGroups:
  - ""
  resources:
  - pods
  - services
  verbs:
  - get
  - list
  - watch
  - create
  - delete
- apiGroups:
  - extensions
  resources:
  - ingresses
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
- apiGroups:
  - storage.k8s.io
  resources:
  - storageclasses
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - route.openshift.io
  resources:
  - routes
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - cdi.kubevirt.io
  resources:
  - '*'
  verbs:
  - '*'
- apiGroups:
  - snapshot.storage.k8s.io
  resources:
  - '*'
  verbs:
  - '*'
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  verbs:
  - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    operator.cdi.kubevirt.io: ""
  name: cdi-operator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cdi-operator-cluster
subjects:
- kind: ServiceAccount
  name: cdi-operator
  namespace: cdi
---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    operator.cdi.kubevirt.io: ""
  name: cdi-operator
  namespace: cdi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-operator
  namespace: cdi
rules:
- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - rolebindings
  - roles
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - serviceaccounts
  - configmaps
  - events
  - secrets
  verbs:
  - '*'
- apiGroups:
  - apps
  resources:
  - deployments
  - deployments/finalizers
  verbs:
  - '*'
- apiGroups:
  - route.openshift.io
  resources:
  - routes
  - routes/custom-host
  verbs:
  - '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-operator
  namespace: cdi
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: cdi-operator
subjects:
- kind: ServiceAccount
  name: cdi-operator
  namespace: cdi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cdi-operator
  namespace: cdi
spec:
  replicas: 1
  selector:
    matchLabels:
      name: cdi-operator
      operator.cdi.kubevirt.io: ""
  strategy: {}
  template:
    metadata:
      labels:
        name: cdi-operator
        operator.cdi.kubevirt.io: ""
    spec:
      containers:
      - env:
        - name: DEPLOY_CLUSTER_RESOURCES
          value: "true"
        - name: OPERATOR_VERSION
          value: v1.13.1
        - name: CONTROLLER_IMAGE
          value: kubevirt/cdi-controller:v1.13.1
        - name: IMPORTER_IMAGE
          value: kubevirt/cdi-importer:v1.13.1
        - name: CLONER_IMAGE
          value: kubevirt/cdi-cloner:v1.13.1
        - name: APISERVER_IMAGE
          value: kubevirt/cdi-apiserver:v1.13.1
        - name: UPLOAD_SERVER_IMAGE
          value: kubevirt/cdi-uploadserver:v1.13.1
        - name: UPLOAD_PROXY_IMAGE
          value: kubevirt/cdi-uploadproxy:v1.13.1
        - name: VERBOSITY
          value: "1"
        - name: PULL_POLICY
          value: IfNotPresent
        image: kubevirt/cdi-operator:v1.13.1
        imagePullPolicy: IfNotPresent
        name: cdi-operator
        ports:
        - containerPort: 60000
          name: metrics
          protocol: TCP
        resources: {}
      securityContext:
        runAsNonRoot: true
      serviceAccountName: cdi-operator
---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    operator.cdi.kubevirt.io: ""
  name: cdi-operator-leader-election-helper
  namespace: cdi
