This is a Kubernetes operator for managing VirtualClusters using the loft vcluster Helm chart.
The OpenVC operator provides a declarative way to manage VirtualClusters within your Kubernetes environment. It uses Helm to deploy and manage the lifecycle of VirtualClusters based on the VirtualCluster
custom resource.
- Create, update, and delete VirtualClusters using Kubernetes CRDs
- Declaratively configure VirtualClusters using spec.values (directly corresponds to the Helm chart values)
- Automated lifecycle management with finalizers to ensure proper cleanup
- Based on Helm v3 and the official vcluster Helm chart (v0.24.1)
- Kubernetes 1.19+
- Helm 3.0+
- Install CRDs:
kubectl apply -f https://raw.githubusercontent.com/OpenVirtualCluster/openvirtualcluster-operator/main/config/crd/bases/core.openvc.dev_virtualclusters.yaml
- Deploy the operator:
kubectl apply -f https://raw.githubusercontent.com/OpenVirtualCluster/openvirtualcluster-operator/main/config/default
Create a VirtualCluster by applying a YAML manifest:
apiVersion: core.openvc.dev/v1alpha1
kind: VirtualCluster
metadata:
name: sample-vcluster
namespace: default
spec:
values:
service:
type: ClusterIP
sync:
ingresses:
enabled: true
storage:
persistence: false
telemetry:
disabled: true
Apply the manifest:
kubectl apply -f virtualcluster.yaml
You can access your VirtualCluster using the vcluster CLI:
vcluster connect sample-vcluster -n default
Or you can get the kubeconfig locally:
kubectl get secret sample-vcluster-kubeconfig -n default -o jsonpath="{.data.config}" | base64 --decode > kc.yaml
kubectl --kubeconfig=vc-kc.yaml get pods -A
The spec.values
field in the VirtualCluster CR directly maps to the values.yaml of the vcluster Helm chart. For all available configuration options, refer to the vcluster documentation.
# Build the operator
make build
# Run the operator locally
make run
# Build the Docker image
make docker-build
# Push the Docker image
make docker-push
This project is licensed under the Apache License 2.0.