Kubernetes management is hard and getting more complex day-by-day, Virtual clusters or vClusters have emerged as a game-changing solution for organizations looking to optimize their deployments. Today, we're excited to walk you through setting up and using vClusters with Taikun CloudWorks, a hands-on demo on how this powerful combination can revolutionize your Kubernetes strategy.

Why vClusters?

Before we dive into the hands-on portion, let's quickly recap why vClusters are gaining traction:

  1. Isolation: vClusters provide better workload isolation than namespaces.
  2. Cost Efficiency: Share underlying infrastructure while maintaining logical separation.
  3. Rapid Provisioning: Create new environments in seconds, perfect for CI/CD pipelines.
  4. Multi-Tenancy: Enable multiple teams to work independently within the same physical cluster.

CloudWorks and vCluster Capabilities

vCluster support in CloudWorks is provided by the vCluster open source project. CloudWorks brings together a set of platform capabilities that build on the base functionality and value of vClusters.

Feature vCluster vCluster with CloudWorks
Management
Limits 5 vClusters, 2 Host Clusters, 50 Users No Limits
Terraform Integration Yes Single Provider for all supported platforms/ Cloud Providers
CRDs Yes Yes
Cluster API Integration Yes Yes
Monitoring Install required Prometheus pre-configured on the host cluster to monitor virtual control plane
Backup Install required Velero pre-installed on host cluster
Alerts E-mail, Slack and WebHooks
White Labelling Yes
Networking
CoreDNS Pre-configured
Ingress Yes Yes plus Taikun Ingress to expose services without the need for a Load Balancer for dev/test
Backing Store
SQLite Yes Yes
Self-Managed etcd Yes
Application Lifecycle
Application Delivery Pre-integrated and integrates with existing CI/CD tooling
Repositories Curated set of applications plus bring your own
Catalogues Create project specific allocation catalogs
Kubeconfig
Management Via command line Create and manage via Console and access vCluster via console terminal
Self-Service
Projects Organise vClusters and Users Manage Clusters, resources, applications and users. Can be host or vClusters
Quotas Limit CPU, RAM and Storage for each project.
Expiration Control the lifetime of projects
Access
RBAC Yes Yes
User Access Yes Yes
SSO Yes, via Keycloak
Audit Events are logged, searchable and downloadable
Deployment
Multi-Region Global Control Plane
Edge With infrastructure partners
Air-Gapped Self-hosted install for private or disconnected environments
Support
E-Mail Yes Yes
Slack Private Shared Channel
24/7 Support Included

Setting Up vClusters in Taikun CloudWorks

Let's walk through the process of creating and managing a vCluster in CloudWorks.

For example: Let's explore how Sarah, a DevOps lead, leverages virtual Kubernetes clusters to optimize resource utilization and reduce costs. Sarah is facing inefficiencies due to idle workloads and excessive Kubernetes clusters. vClusters offer a solution by running isolated clusters within a single physical Kubernetes cluster. Each vCluster has its own API server, providing better isolation than namespaces and more cost-effectiveness than separate clusters.

Let's see how Sarah can implement vCluster in Taikun CloudWorks:

  1. She logs into Taikun CloudWorks and selects her host Kubernetes cluster.
  2. In the 'Virtual Clusters' tab, she creates a new vCluster named 'marketing-ai-vcluster'.
  3. Sarah configures resource limits and selects the Kubernetes version.
  4. Behind the scenes, Taikun CloudWorks uses vCluster to create a lightweight virtual control plane within the host cluster.
  5. This vCluster runs its own API server, scheduler, and controller manager, isolated from the host cluster's control plane.

Let's go hands-on !! 🚀

Glimpse of basic Taikun CloudWorks and vCluster Architecture

vcluster-cloudworks

Step 1: Log into Taikun CloudWorks

First, access your CloudWorks platform and log in with your credentials.
platform

Step 2: Create a Host Cluster

Before we can create a vCluster, we need a host cluster:

  1. Navigate to the "Projects" section in the left sidebar. projects
  2. Click "Add Project" and fill in the details:
    • Name: "marketing-ai-demo" and choose your preferred cloud provider add-projects
    • Set appropriate quotas for CPU, RAM, and storage cpu-quota
  3. Click "Create Project" to provision your host cluster.
  4. Adding Kubernetes cluster servers:
    • Master node: You just need to type initials and taikun cloudworks pre-fill the data for you, Very cool indeed. master-node
    • Worker node: I'm creating one for this demo but you can create as much as you need according to your use-case. worker-node
    • Bastion server: It allows access to a private network from an external network. bastion
  5. Once done! Click on the green commit button to create a cluster.
    commit-button

Step 3: Create a Virtual Cluster

Once your host cluster is ready, there are two ways you can create a virtual cluster on Taikun Cloudworks!

Method 1

  1. You can directly click on the drop-down arrow beside Add project in projects to create a new virtual cluster.
    drop-down-virtual-cluster

Method 2

  1. In the Projects list, find your "marketing-ai-demo" project.
  2. Click on the project to open its details.
  3. Navigate to the "Virtual Clusters" tab. projects-virtual-clusters
  4. Click "Add Virtual Cluster" and provide the following:
    • Name: "ai-marketing-test-vc"
    • Alerting Profile: We can inherit this from the parent cluster(i.e. host Kubernetes cluster)
    • Expiration: With CloudWorks, we can also set an expiration time for a cluster, and you can automatically delete it when it expires.
  5. Click "Create" to provision your vCluster.
    vcluster

🎉 vCluster will be up and running in 1 or 2 mins!!

1 min create cluster
vcluster up

Step 4: Access Your Virtual Cluster

After your vCluster is created:

  1. In the Projects list, you'll see a new project with the Cloud Type "ai-marketing-test-vc".
  2. Click on this project to access your vCluster's details.
  3. In the "Overview" tab, find the "Kubeconfig" section.
  4. Click "Add Kubeconfig" to access your vCluster.
    add kubeconfig
  5. Once created, you can access this kubeconfig from terminal directly or you can download it for later.
    terminal-kubeconfig

Step 5: Deploy an Application to Your vCluster

Let's deploy a simple application to test our vCluster:

  1. Open your terminal and set the KUBECONFIG environment variable to the path of the downloaded kubeconfig file:
    export KUBECONFIG=/path/to/your/kubeconfig
    
  2. Create a deployment:
    kubectl create deployment nginx --image=nginx
    
  3. Expose the deployment:
    kubectl expose deployment nginx --port=80 --type=ClusterIP
    
  4. Verify the deployment:
    kubectl get pods,svc
    

Expected Output:
output terminal

Taikun Terraform Provider

You can also levarage our terraform provider to create this setup in a click from your favorite IDE or terminal/CLI. Check out this example terraform script for more.

Leveraging CloudWorks Features with vClusters

Taikun CloudWorks enhances the vCluster experience with several built-in features:

  1. Monitoring: CloudWorks pre-configures Prometheus on the host cluster to monitor your virtual control plane.
  2. Backup: Velero comes pre-installed on the host cluster for easy backups.
  3. Networking: CoreDNS is pre-configured, and you can use Taikun Ingress to expose services without needing a Load Balancer for dev/test environments.
  4. Access Management: Utilize CloudWorks's robust RBAC and SSO capabilities to manage access to your vClusters.

Conclusion

Virtual clusters in Taikun CloudWorks offer a powerful solution for organizations looking to optimize their Kubernetes deployments. By combining the isolation and flexibility of vClusters with CloudWorks's comprehensive management features, you can significantly improve your development workflows, reduce costs, and enhance multi-tenancy support.

We've only scratched the surface of what's possible with vClusters in CloudWorks. As you continue to explore, you'll discover how this combination can transform your Kubernetes strategy, enabling more efficient resource utilization, faster development cycles, and improved team autonomy.

Ready to take your Kubernetes management to the next level? Log into Taikun CloudWorks today and start exploring the power of virtual clusters!

Taikun CloudWorks is a one-stop solution for your Kubernetes workloads. Try Taikun CloudWorks today. Book your free demo today, and let our team simplify, enhance, and streamline your infrastructure management.