Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Data Volume annotations documentation #1582

Merged
merged 1 commit into from Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions doc/datavolume-annotations.md
@@ -0,0 +1,65 @@
# 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:

```yaml
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](https://kubevirt.io/2020/Multiple-Network-Attachments-with-bridge-CNI.html).

## AspenMesh / istio

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

For example:

```yaml
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:

```bash
kubectl label namespace default istio-injection=enabled
kubectl get namespace default -L istio-injection
```
2 changes: 2 additions & 0 deletions doc/datavolumes.md
Expand Up @@ -254,6 +254,8 @@ The running and ready conditions are mutually exclusive, if running is true, the
* Reason The reason the status transitioned to a new value, this is a camel cased single word, similar to an EventReason in events.
* Message A detailed messages expanding on the reason of the transition. For instance if Running went from True to False, the reason will be the container exit reason, and the message will be the container exit message, which explains why the container exitted.

## Annotations
Specific [DV annotations](datavolume-annotation.md) are passed to the transfer pods to control their behavior.

## Kubevirt integration
[Kubevirt](https://github.com/kubevirt/kubevirt) is an extension to Kubernetes that allows one to run Virtual Machines(VM) on the same infra structure as the containers managed by Kubernetes. CDI provides a mechanism to get a disk image into a PVC in order for Kubevirt to consume it. The following steps have to be taken in order for Kubevirt to consume a CDI provided disk image.
Expand Down