Skip to main content

Other k8s Distributions

By default, vcluster will use k3s as virtual Kubernetes cluster, which is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.

However, vcluster also works with other Kubernetes distributions and k3s is not required. We recommend to use k3s, because it has a small footprint and widely adopted, but if your use case requires a different k8s distribution, vcluster also supports k0s or vanilla k8s.

k0s#

k0s is an all-inclusive Kubernetes distribution, which is configured with all of the features needed to build a Kubernetes cluster and packaged as a single binary for ease of use. vcluster supports k0s as backing virtual Kubernetes cluster.

In order to use k0s as backing cluster, create a vcluster with the following command:

vcluster create vcluster-1 -n host-namespace-1 --distro k0s

Connect to the vcluster and start using it:

vcluster connect vcluster-1 -n host-namespace-1
# Then execute in a new terminal
export KUBECONFIG=kubeconfig.yaml
kubectl get ns
...

Behind the scenes a different helm chart will be deployed (vcluster-k0s), that holds specific configuration to support k0s. Check the github repository for all available chart options.

Vanilla k8s#

When choosing this option, vcluster will deploy a separate etcd cluster, kubernetes controller manager and api server alongside the vcluster hypervisor.

In order to use vanilla k8s as backing cluster, create a vcluster with the following command:

vcluster create vcluster-1 -n host-namespace-1 --distro k8s

Connect to the vcluster and start using it:

vcluster connect vcluster-1 -n host-namespace-1
# Then execute in a new terminal
export KUBECONFIG=kubeconfig.yaml
kubectl get ns
...

Behind the scenes a different helm chart will be deployed (vcluster-k8s), that holds specific configuration to support vanilla k8s. Check the github repository for all available chart options.

High Available Vanilla k8s#

In order to run vcluster in high availability mode, create a values.yaml in the following form:

# Enable HA mode
enableHA: true
# Scale up syncer replicas
syncer:
replicas: 3
# Scale up etcd
etcd:
replicas: 3
# Scale up controller manager
controller:
replicas: 3
# Scale up api server
api:
replicas: 3

Then create the vcluster with the following command:

vcluster create ... --distro k8s -f values.yaml

Check that vcluster including the control plane are running correctly:

kubectl get po -n vcluster
NAME READY STATUS RESTARTS AGE
coredns-6ff7df994d-m5pcd-x-kube-system-x-vcluster 1/1 Running 0 23m
vcluster-9d88f577-m55xf 1/1 Running 0 30m
vcluster-9d88f577-drsxz 1/1 Running 0 30m
vcluster-9d88f577-maslo 1/1 Running 0 30m
vcluster-api-66bfc4cf94-cp28t 1/1 Running 0 30m
vcluster-api-66bfc4cf94-drnll 1/1 Running 0 30m
vcluster-api-66bfc4cf94-jfbnn 1/1 Running 0 30m
vcluster-controller-b4cd55bb6-9mvc4 1/1 Running 0 30m
vcluster-controller-b4cd55bb6-bmfdj 1/1 Running 0 30m
vcluster-controller-b4cd55bb6-kcxr7 1/1 Running 0 30m
vcluster-etcd-0 1/1 Running 0 30m
vcluster-etcd-1 1/1 Running 0 29m
vcluster-etcd-2 1/1 Running 0 29m

Now connect to the vcluster:

vcluster connect vcluster-1 -n host-namespace-1
# Then execute in a new terminal
export KUBECONFIG=kubeconfig.yaml
kubectl get ns
...

Check the github repository for all available chart options.