Elevate your multi-cluster strategy by seamlessly integrating virtual clusters (vClusters) into your Sveltos management framework. This detailed guide outlines the process of deploying Sveltos, setting up a vCluster, and registering it to become a first-class citizen in your cluster fleet, allowing for unified governance and operations.
Essential Preparations
Before diving into the integration, ensure you have the following tools installed:
-
Install the
sveltosctl
CLI: This command-line interface is crucial for generating manifest files for cluster registration and interacting with Sveltos.
curl -L https://github.com/projectsveltos/sveltosctl/releases/latest/download/sveltosctl-darwin-amd64 -o sveltosctl
chmod +x sveltosctl
sudo mv sveltosctl /usr/local/bin/
- Install Helm: If you don’t already have it, follow the official Helm installation documentation. Helm is essential for deploying Sveltos and its dashboard.
Phase 1: Deploying Sveltos
Begin by installing Sveltos on your designated management cluster. This foundational step deploys the Sveltos controller and its Custom Resource Definitions (CRDs).
helm repo update && helm upgrade --install sveltos projectsveltos/projectsveltos --namespace projectsveltos --create-namespace
After deployment, verify that Sveltos components are running correctly:
helm list -n projectsveltos
kubectl get pods -n projectsveltos
At this juncture, Sveltos’s core functionalities, including its CRDs and controller, should be operational within your cluster.
Phase 2: Setting Up the Sveltos Dashboard (Optional)
For a more intuitive visualization and management experience, you can deploy the Sveltos dashboard.
helm install sveltos-dashboard projectsveltos/sveltos-dashboard -n projectsveltos
helm list -n projectsveltos
kubectl port-forward service/dashboard -n projectsveltos 8080:80
Access the dashboard in your web browser at: http://localhost:8080/login
To log in, you’ll need an admin service account and an authentication token:
kubectl create sa platform-admin -n default
kubectl create clusterrolebinding platform-admin-access --clusterrole cluster-admin --serviceaccount default:platform-admin
kubectl create token platform-admin -n default --duration=24h
Use the generated token to authenticate and gain access to the dashboard.
Phase 3: Creating a vCluster
Next, provision a new virtual cluster that you intend to manage with Sveltos.
vcluster create my-vcluster --namespace my-team
Once the vCluster is created, disconnect from it:
vcluster disconnect
Phase 4: Registering Your vCluster with Sveltos
This is the pivotal step where your vCluster becomes a manageable entity within Sveltos.
- Generate the
SveltosCluster
manifest for your vCluster:
sveltosctl register cluster --namespace=monitoring --cluster=vcluster --pullmode --labels=environment=production,tier=backend > sveltoscluster_registration.yaml
This command outputs a YAML file that defines your vCluster’s parameters and registration details for Sveltos.
- Connect to your newly created vCluster:
vcluster connect my-vcluster --namespace my-team
- Apply the generated registration YAML directly within the vCluster:
kubectl apply -f sveltoscluster_registration.yaml
Congratulations! Your vCluster is now successfully registered with Sveltos, ready for centralized management.
What’s Next? Expanding Your Management Capabilities
With your vCluster fully integrated into Sveltos, you can now leverage its powerful features:
- Apply ClusterProfiles: Define and enforce consistent policies, configurations, and workloads across your vClusters.
- Implement Drift Detection: Ensure continuous compliance by automatically detecting and correcting any configuration deviations within your vCluster.
- Centralized Add-on Management: Consistently deploy and manage essential add-ons, such as monitoring stacks or logging solutions, across diverse environments.
By following these steps, you transform vClusters from isolated, temporary resources into robust, first-class components of your comprehensive multi-cluster management strategy.