Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.8 KB

datavolume-annotations.md

File metadata and controls

65 lines (53 loc) · 1.8 KB

Data Volume Annotations

Introduction

CDI allows adding specific annotations to a DV or PVC to be passed to the Transfer Pods and control their behavior. Only specifically allowed annotations are passed, to prevent unexpected behavior due to missing testing coverage.

Multus

Anntoations allows controlling which network will be used by the importer pod:

  • k8s.v1.cni.cncf.io/networks: networkname - pod will get both the default network from the cluster, and the secondary multus network.
  • v1.multus-cni.io/default-network: networkname - pod will get the multus network as its default network.

For example:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: dv-ann
  annotations:
      v1.multus-cni.io/default-network: bridge-network
spec:
  source:
      http:
         url: "http://mirrors.nav.ro/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2"
  pvc:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi

Further reference on setting Multus secondary network can be found here.

AspenMesh / istio

  • sidecar.istio.io/inject: "false" - disables sidecar injection to the pod

For example:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: dv-am
  annotations:
      sidecar.istio.io/inject: "false"
spec:
  source:
      http:
         url: "http://mirrors.nav.ro/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2"
  pvc:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi

To enable sidecar injection in namespace:

kubectl label namespace default istio-injection=enabled
kubectl get namespace default -L istio-injection