containerized-data-importer/doc/datavolume-annotations.md
Ben Coxford 3a57e0ebf2
Add support for linkerd injection annotations on datavolumes (#2954)
* add support for linkerd annotations on datavolumes

Signed-off-by: bcoxford <ben.coxford@ncr.com>

* fix default value linkerd injection annotation

Signed-off-by: bcoxford <ben.coxford@ncr.com>

* set default value for linkerd injection to disabled

Signed-off-by: bcoxford <ben.coxford@ncr.com>

* resolve linting on mesh annotation hinting

Signed-off-by: bcoxford <ben.coxford@ncr.com>

* fix linting on AnnPodSidecarInjectionLinkerdDefault hints

Signed-off-by: bcoxford <ben.coxford@ncr.com>

* add note to sidecar unit tests

Signed-off-by: bcoxford <ben.coxford@ncr.com>

---------

Signed-off-by: bcoxford <ben.coxford@ncr.com>
2023-11-16 19:23:21 +01:00

2.3 KiB

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

Linkerd Mesh

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

For example:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: dv-am
  annotations:
      linkerd.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