Skip to content

OpenVirtualCluster/openvirtualcluster-operator

Repository files navigation

OpenVC - VirtualCluster Operator

This is a Kubernetes operator for managing VirtualClusters using the loft vcluster Helm chart.

Overview

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.

Features

  • 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)

Getting Started

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.0+

Installation

  1. Install CRDs:
kubectl apply -f https://raw.githubusercontent.com/OpenVirtualCluster/openvirtualcluster-operator/main/config/crd/bases/core.openvc.dev_virtualclusters.yaml
  1. Deploy the operator:
kubectl apply -f https://raw.githubusercontent.com/OpenVirtualCluster/openvirtualcluster-operator/main/config/default

Creating a VirtualCluster

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

Accessing the VirtualCluster

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

Configuration

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.

Development

Building the Operator

# Build the operator
make build

# Run the operator locally
make run

Building the Docker Image

# Build the Docker image
make docker-build

# Push the Docker image
make docker-push

License

This project is licensed under the Apache License 2.0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •