cdi
CDI - Containerized Data Importer for KubeVirt - Import, clone, and manage VM disk images on Kubernetes
About this chart
cdi
CDI - Containerized Data Importer for KubeVirt - Import, clone, and manage VM disk images on Kubernetes
Homepage: https://github.com/encircle360-oss/helm-charts/tree/main/charts/cdi
⚠️ UNDER CONSTRUCTION This chart is currently under active development and has not been battle-tested in production environments. NOT PRODUCTION READY - Use at your own risk and thoroughly test in non-production environments first. CDI is a component of the KubeVirt ecosystem requiring Kubernetes storage knowledge. Only use this chart if you are an experienced Kubernetes operator.
Description
CDI (Containerized Data Importer) is a Kubernetes add-on that provides the ability to import, clone, and manage VM disk images for use with KubeVirt. This Helm chart provides a deployment of CDI v1.64.0 with comprehensive configuration options.
Key Features:
- Full CDI v1.64.0 support with all configuration options
- Operator-based lifecycle management
- DataVolume support for importing VM disk images
- HTTP, S3, registry, and PVC clone sources
- Scratch space and filesystem overhead configuration
- Import proxy support for air-gapped environments
Prerequisites
- Kubernetes 1.28+
- Helm 3.8+
- KubeVirt installed in the cluster (recommended)
- A CSI-compatible StorageClass (e.g., Longhorn, Rook-Ceph)
Platform Compatibility: This chart works on both vanilla Kubernetes (including K3s, K0s) and OpenShift. OpenShift-specific RBAC rules are included but will be safely ignored on non-OpenShift clusters.
Installation
Important: Two-Step First Install This chart manages the CDI CRD as a regular Helm template (not in
crds/directory) so it gets updated on everyhelm upgrade. However, Helm cannot validate the CDI Custom Resource on a fresh install because the CRD doesn't exist yet. Therefore, the first install requires two steps. Subsequent upgrades work normally with a single command.
Quick Start (First Install)
# Add the Helm repository
helm repo add encircle360-oss https://encircle360-oss.github.io/helm-charts
helm repo update
# Step 1: Install operator + CRD only (skip CDI CR)
helm install cdi encircle360-oss/cdi \
--namespace cdi \
--create-namespace \
--set cdi.deploy=false
# Step 2: Upgrade to enable CDI CR (CRD is now registered)
helm upgrade cdi encircle360-oss/cdi \
--namespace cdi
# Wait for CDI to be ready
kubectl wait cdi cdi \
--for=jsonpath='{.status.phase}'=Deployed \
--timeout=10m
Quick Start with Helmfile
# helmfile.yaml
releases:
- name: cdi
namespace: cdi
createNamespace: true
chart: encircle360-oss/cdi
values:
- values.yaml
# Step 1: Install operator + CRD only
helmfile sync --set cdi.deploy=false
# Step 2: Enable CDI CR (all subsequent syncs work with just this)
helmfile sync
Installation with Custom Values
# Step 1
helm install cdi encircle360-oss/cdi \
--namespace cdi \
--create-namespace \
--set cdi.deploy=false \
-f custom-values.yaml
# Step 2
helm upgrade cdi encircle360-oss/cdi \
--namespace cdi \
-f custom-values.yaml
Why Two Steps?
This chart manages the CDI CRD as a regular Helm template instead of placing it in the crds/ directory. This design choice ensures:
- CRDs are updated on every
helm upgrade(thecrds/directory only applies onhelm install) - CRD version upgrades are handled automatically by the auto-update workflow
- The
helm.sh/resource-policy: keepannotation prevents CRD deletion onhelm uninstall
The trade-off is that the first install needs two steps because Helm validates all resources against the Kubernetes API before applying them. Since the CRD doesn't exist yet on a fresh install, Helm can't validate the CDI Custom Resource.
Configuration
Basic Configuration
| Parameter | Description | Default |
|---|---|---|
global.enabled | Enable CDI deployment | true |
namespace.name | Namespace for CDI | cdi |
operator.replicas | Number of operator replicas | 1 |
operator.image.tag | Operator image tag | v1.64.0 |
cdi.deploy | Deploy CDI Custom Resource | true |
Feature Gates
CDI uses feature gates to control optional functionality:
cdi:
config:
featureGates:
- HonorWaitForFirstConsumer # Respect WaitForFirstConsumer binding mode
Available Feature Gates (v1.64.0)
HonorWaitForFirstConsumer- Respect WaitForFirstConsumer storage class binding mode
See the CDI feature gates documentation for the complete list.
Scratch Space Configuration
cdi:
config:
# Storage class for temporary scratch space during imports
scratchSpaceStorageClass: "longhorn"
# Filesystem overhead per storage class
filesystemOverhead:
global: "0.055"
storageClass:
longhorn: "0.04"
Import Proxy Configuration
For environments behind a corporate proxy:
cdi:
config:
importProxy:
HTTPProxy: "http://proxy.example.com:3128"
HTTPSProxy: "http://proxy.example.com:3128"
noProxy: ".cluster.local,.svc"
trustedCAProxy: "my-ca-configmap"
Node Placement
Infrastructure Components (cdi-apiserver, cdi-controller, cdi-uploadproxy)
cdi:
infra:
nodeSelector:
node-role.kubernetes.io/control-plane: ""
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
Workload Components (importer/cloner pods)
cdi:
workload:
nodeSelector:
node-role.kubernetes.io/worker: ""
Certificate Configuration
cdi:
certConfig:
ca:
duration: 168h
renewBefore: 24h
server:
duration: 48h
renewBefore: 24h
client:
duration: 48h
renewBefore: 24h
Usage Examples
Import a Cloud Image via HTTP
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: ubuntu-cloud-img
spec:
source:
http:
url: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: longhorn
Clone an Existing PVC
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: cloned-disk
spec:
source:
pvc:
namespace: default
name: source-pvc
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
Import from Container Registry
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: registry-disk
spec:
source:
registry:
url: "docker://quay.io/kubevirt/cirros-container-disk-demo:latest"
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Upgrading
helm repo update
helm upgrade cdi encircle360-oss/cdi \
--namespace cdi \
-f values.yaml
Frequently Asked Questions (FAQ)
Does this work on K3s/K0s/vanilla Kubernetes?
Yes! This chart is designed to work on:
- Vanilla Kubernetes (upstream)
- K3s (lightweight Kubernetes)
- K0s (zero friction Kubernetes)
- MicroK8s
- OpenShift/OKD
The chart includes OpenShift-specific RBAC rules, but these are safely ignored on non-OpenShift clusters.
Why are there OpenShift resources in the RBAC?
CDI officially supports both vanilla Kubernetes and OpenShift. The OpenShift-specific resources (security.openshift.io/securitycontextconstraints, route.openshift.io/routes) are:
- Optional and only used on OpenShift
- Ignored on vanilla Kubernetes/K3s (API groups don't exist)
- Standard practice in the official CDI manifests
Your K3s cluster will simply skip these rules - no issues!
Why does the first install require two steps?
This chart manages the CDI CRD as a regular Helm template (not in the crds/ directory). This ensures CRDs are updated on every helm upgrade. However, on a fresh install, Helm cannot validate the CDI Custom Resource because the CRD doesn't exist yet. The first step installs the operator + CRD, and the second step adds the CDI CR.
What storage classes work with CDI?
CDI works with any CSI-compatible StorageClass. Tested and recommended:
- Longhorn - Recommended for K3s clusters
- Rook-Ceph - Recommended for larger clusters
- OpenEBS - Lightweight option
- Local Path Provisioner - For development (no replication)
What's the difference between CDI and KubeVirt?
- KubeVirt manages virtual machines on Kubernetes
- CDI handles the storage side: importing, cloning, and managing VM disk images
CDI is a companion project to KubeVirt. While KubeVirt can run VMs with ephemeral disks, CDI is needed for persistent VM storage via DataVolumes.
Troubleshooting
Check Installation Status
# Check CDI CR
kubectl get cdi
# Check all components
kubectl get pods -n cdi
# Check operator logs
kubectl logs -n cdi deployment/cdi-operator
# Check import progress
kubectl get datavolumes -A
Common Issues
1. Import stuck at 0%
Solution: Check if scratch space is available and the source URL is reachable:
kubectl describe datavolume <name>
kubectl logs -n cdi <importer-pod>
2. CDI operator not starting
Solution: Verify RBAC and CRDs are installed:
kubectl get crd cdis.cdi.kubevirt.io
kubectl get clusterrole cdi-operator-cluster
3. DataVolume stuck in "WaitForFirstConsumer"
Solution: This is expected with WaitForFirstConsumer storage classes. The import starts when a Pod (e.g., a VM) is scheduled to use the PVC. Enable the HonorWaitForFirstConsumer feature gate:
cdi:
config:
featureGates:
- HonorWaitForFirstConsumer
Debug Commands
# Describe CDI CR
kubectl describe cdi cdi
# Check CDI config
kubectl get cdi cdi -o jsonpath='{.spec.config}' | jq .
# Check importer pod logs
kubectl logs -n cdi <cdi-importer-pod>
# Check events
kubectl get events -n cdi --sort-by='.lastTimestamp'
Uninstallation
# Delete all DataVolumes first (optional, keeps PVCs)
kubectl delete datavolumes --all -A
# Uninstall the chart
helm uninstall cdi -n cdi
# Delete namespace (if desired)
kubectl delete namespace cdi
Note: By default, CRDs are kept on uninstallation to prevent data loss (helm.sh/resource-policy: keep).
To also remove CRDs: kubectl delete crd cdis.cdi.kubevirt.io
Migration from Raw Manifests
If you're currently using raw CDI manifests:
-
Export current configuration:
kubectl get cdi cdi -o yaml > current-config.yaml -
Create values.yaml from current config: Review your current CDI CR and translate settings to Helm values.
-
Uninstall existing CDI:
kubectl delete cdi cdi kubectl delete deployment cdi-operator -n cdi -
Install using Helm (two-step):
# Step 1: Install operator + CRD only helm install cdi encircle360-oss/cdi \ --namespace cdi \ --set cdi.deploy=false \ -f values.yaml # Step 2: Enable CDI CR helm upgrade cdi encircle360-oss/cdi \ --namespace cdi \ -f values.yaml
Resources
Contributing & Maintainership
We Welcome Contributors! 🎉
We're actively seeking contributors and co-maintainers for this CDI chart! Whether you want to:
- Become a co-maintainer for this chart
- Submit pull requests for bug fixes, features, or documentation improvements
- Help with testing storage features and data import workloads
- Improve documentation with real-world deployment examples
- Share your storage and CDI expertise with the community
Your expertise is valuable! Whether you're a storage expert, a CDI user, or someone passionate about managing VM disk images on Kubernetes - we'd love your contribution.
Become a Chart Co-Maintainer
Interested in becoming a co-maintainer for this CDI chart? We'd be excited to collaborate!
What we're looking for:
- Experience with Kubernetes storage (CSI, PVCs, StorageClasses)
- Strong Kubernetes and Helm knowledge
- Understanding of VM disk management and data import workflows
- Willingness to review PRs and help with issues
- Passion for bringing data management to the KubeVirt ecosystem
How to get involved:
- Start by contributing PRs or helping in issues/discussions
- Reach out to us at [email protected] expressing your interest
- We'll work together to onboard you as a co-maintainer
We especially welcome storage experts who can help users successfully manage VM disk images on Kubernetes!
Support & Professional Services
Community Support
For issues and questions about this Helm chart:
- Matrix Community: Join our Matrix Chat to chat with maintainers and other users
- Chart Issues: Create an Issue for Helm chart bugs and feature requests
- General Questions: Start a [Discussion](https://github.com/encircle360-oss/helm-
Deploy cdi with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cdi on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcdi is pinned at v0.1.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply