apiVersion: v1
kind: Namespace
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: datavolumes.cdi.kubevirt.io
spec:
  group: cdi.kubevirt.io
  names:
    kind: DataVolume
    plural: datavolumes
    shortNames:
    - dv
    - dvs
    singular: datavolume
  scope: Namespaced
  validation:
    openAPIV3Schema:
      properties:
        apiVersion:
          type: string
        kind:
          type: string
        metadata: {}
        spec:
          properties:
            pvc:
              properties:
                accessModes:
                  type: array
                resources:
                  properties:
                    requests:
                      properties:
                        storage:
                          type: string
                  required:
                  - requests
                storageClassName:
                  type: string
              required:
              - resources
            source:
              properties:
                blank: {}
                http:
                  properties:
                    secretRef:
                      type: string
                    url:
                      type: string
                  required:
                  - url
                pvc:
                  properties:
                    name:
                      type: string
                    namespace:
                      type: string
                  required:
                  - namespace
                  - name
                registry:
                  properties:
                    secretRef:
                      type: string
                    url:
                      type: string
                  required:
                  - url
                s3:
                  properties:
                    secretRef:
                      type: string
                    url:
                      type: string
                  required:
                  - url
                upload: {}
  version: v1alpha1
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdiconfigs.cdi.kubevirt.io
spec:
  group: cdi.kubevirt.io
  names:
    kind: CDIConfig
    plural: cdiconfigs
    singular: cdiconfig
  scope: Cluster
  version: v1alpha1
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi
rules:
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims/finalizers
  - pods/finalizers
  verbs:
  - update
- apiGroups:
  - ""
  resources:
  - pods
  - services
  verbs:
  - get
  - list
  - watch
  - create
  - delete
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - get
  - list
  - watch
  - create
- apiGroups:
  - ""
  resources:
  - namespaces
  verbs:
  - get
  - list
- apiGroups:
  - extensions
  resources:
  - ingresses
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
  - create
  - update
- apiGroups:
  - storage.k8s.io
  resources:
  - storageclasses
  verbs:
  - get
- apiGroups:
  - route.openshift.io
  resources:
  - routes
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - cdi.kubevirt.io
  resources:
  - '*'
  verbs:
  - '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-sa
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cdi
subjects:
- kind: ServiceAccount
  name: cdi-sa
  namespace: cdi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-apiserver
rules:
- apiGroups:
  - admissionregistration.k8s.io
  resources:
  - validatingwebhookconfigurations
  verbs:
  - get
  - create
  - update
- apiGroups:
  - apiregistration.k8s.io
  resources:
  - apiservices
  verbs:
  - get
  - create
  - update
- apiGroups:
  - ""
  resources:
  - pods
  - persistentvolumeclaims
  verbs:
  - get
  - list
- apiGroups:
  - cdi.kubevirt.io
  resources:
  - '*'
  verbs:
  - '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-apiserver
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cdi-apiserver
subjects:
- kind: ServiceAccount
  name: cdi-apiserver
  namespace: cdi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-apiserver-auth-delegator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:auth-delegator
subjects:
- kind: ServiceAccount
  name: cdi-apiserver
  namespace: cdi
---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-apiserver
  namespace: cdi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-apiserver
  namespace: cdi
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: cdi-apiserver
subjects:
- kind: ServiceAccount
  name: cdi-apiserver
  namespace: cdi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-apiserver
  namespace: cdi
rules:
- apiGroups:
  - ""
  resources:
  - secrets
  - configmaps
  verbs:
  - get
  - create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-extension-apiserver-authentication
  namespace: kube-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: cdi-extension-apiserver-authentication
subjects:
- kind: ServiceAccount
  name: cdi-apiserver
  namespace: cdi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-extension-apiserver-authentication
  namespace: kube-system
rules:
- apiGroups:
  - ""
  resourceNames:
  - extension-apiserver-authentication
  resources:
  - configmaps
  verbs:
  - get
---
apiVersion: v1
kind: Service
metadata:
  labels:
    cdi.kubevirt.io: cdi-apiserver
  name: cdi-api
  namespace: cdi
spec:
  ports:
  - port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    cdi.kubevirt.io: cdi-apiserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    cdi.kubevirt.io: cdi-apiserver
  name: cdi-apiserver
  namespace: cdi
spec:
  replicas: 1
  selector:
    matchLabels:
      cdi.kubevirt.io: cdi-apiserver
  strategy: {}
  template:
    metadata:
      labels:
        cdi.kubevirt.io: cdi-apiserver
    spec:
      containers:
      - args:
        - -v=1
        image: kubevirt/cdi-apiserver:v1.6.0
        imagePullPolicy: IfNotPresent
        name: cdi-apiserver
        resources: {}
      serviceAccountName: cdi-apiserver
---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-sa
  namespace: cdi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: containerized-data-importer
    cdi.kubevirt.io: ""
  name: cdi-deployment
  namespace: cdi
spec:
  replicas: 1
  selector:
    matchLabels:
      app: containerized-data-importer
  strategy: {}
  template:
    metadata:
      labels:
        app: containerized-data-importer
        cdi.kubevirt.io: ""
    spec:
      containers:
      - args:
        - -v=1
        env:
        - name: IMPORTER_IMAGE
          value: kubevirt/cdi-importer:v1.6.0
        - name: CLONER_IMAGE
          value: kubevirt/cdi-cloner:v1.6.0
        - name: UPLOADSERVER_IMAGE
          value: kubevirt/cdi-uploadserver:v1.6.0
        - name: UPLOADPROXY_SERVICE
          value: cdi-uploadproxy
        image: kubevirt/cdi-controller:v1.6.0
        imagePullPolicy: IfNotPresent
        name: cdi-controller
        resources: {}
      serviceAccountName: cdi-sa
---
metadata:
  labels:
    cdi.kubevirt.io: ""
  name: cdi-insecure-registries
  namespace: cdi
---
apiVersion: v1
kind: Service
metadata:
  labels:
    cdi.kubevirt.io: cdi-uploadproxy
  name: cdi-uploadproxy
  namespace: cdi
spec:
  ports:
  - port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    cdi.kubevirt.io: cdi-uploadproxy
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    cdi.kubevirt.io: cdi-uploadproxy
  name: cdi-uploadproxy
  namespace: cdi
spec:
  replicas: 1
  selector:
    matchLabels:
      cdi.kubevirt.io: cdi-uploadproxy
  strategy: {}
  template:
    metadata:
      labels:
        cdi.kubevirt.io: cdi-uploadproxy
    spec:
      containers:
      - args:
        - -v=1
        env:
        - name: APISERVER_PUBLIC_KEY
          valueFrom:
            secretKeyRef:
              key: id_rsa.pub
              name: cdi-api-signing-key
        - name: UPLOAD_SERVER_CLIENT_KEY
          valueFrom:
            secretKeyRef:
              key: tls.key
              name: cdi-upload-server-client-key
        - name: UPLOAD_SERVER_CLIENT_CERT
          valueFrom:
            secretKeyRef:
              key: tls.crt
              name: cdi-upload-server-client-key
        - name: UPLOAD_SERVER_CA_CERT
          valueFrom:
            secretKeyRef:
              key: ca.crt
              name: cdi-upload-server-client-key
        - name: SERVICE_TLS_KEY
          valueFrom:
            secretKeyRef:
              key: tls.key
              name: cdi-upload-proxy-server-key
        - name: SERVICE_TLS_CERT
          valueFrom:
            secretKeyRef:
              key: tls.crt
              name: cdi-upload-proxy-server-key
        image: kubevirt/cdi-uploadproxy:v1.6.0
        imagePullPolicy: IfNotPresent
        name: cdi-uploadproxy
        resources: {}
