Skip to content
/ loft Public

Namespace & Virtual Cluster Manager for Kubernetes - Lightweight Virtual Clusters, Self-Service Provisioning for Engineers and 70% Cost Savings with Sleep Mode

License

Notifications You must be signed in to change notification settings

loft-sh/loft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

vCluster Platform

A powerful Kubernetes platform for managing virtual clusters, multi-tenancy, and cluster sharing

vCluster Platform provides a single pane of glass that lets you connect your clusters, deploy virtual clusters, configure user access, and reduce operational costs. Built on top of Kubernetes, it enables teams to efficiently share cluster resources while maintaining strong isolation and self-service capabilities.

πŸš€ Features

Core Platform Features

  • Projects: Highest organizational unit for logically grouping resources by team or division with role-based access controls (RBAC)
  • Clusters: Connect to and manage multiple physical Kubernetes clusters, deploying spaces, virtual clusters, and apps as needed
  • Virtual Clusters: Lightweight virtual Kubernetes clusters that run inside a namespace within the host physical cluster - ideal for development, testing, and production workloads
  • Apps: Define and deploy applications with configurable parameters across clusters, spaces, and virtual clusters using Kubernetes Manifests, bash scripts, Helm charts, and more
  • Cost Reduction Tools:
    • Sleep Mode: Put Kubernetes namespaces to sleep (sets replicas: 0 for all replica-controlled resources), reducing cloud costs by up to 70%
    • Auto Delete: Configure auto-deletion for inactive virtual clusters
    • Inactivity Detection: Automatically detect and respond to namespace inactivity
  • Multi-Tenancy: Granular RBAC at project, space, and virtual cluster levels
  • GitOps Ready: All resources are defined as Custom Resource Definitions (CRDs) for GitOps workflows
  • RESTful API: Comprehensive OpenAPI 3.0-compliant API for programmatic access and automation

πŸ“‹ Table of Contents

πŸƒ Quick Start

Prerequisites

Resource Requirements

  • Pod Resources:
    • Requests: memory: 256Mi, cpu: 200m
    • Limits: memory: 4Gi, cpu: 2
  • Network Ports: Ensure the following ports are open:
    • 8443 – API service extension for cluster communication (v1.cluster.loft.sh)
    • 9443 – Webhook validation and enforcement (loft webhook)
    • 9444 – Management API for platform administration (v1.management.loft.sh)
    • 9090 – Prometheus metrics proxy for cost monitoring
  • Egress Traffic: Allow egress to https://admin.loft.sh/* (HTTPS, port 443) for license retrieval and validation

Installation Methods

Option 1: Using vCluster CLI (Recommended)

The vCluster CLI is the preferred method for deploying the platform. See the Quick Start Guide for detailed instructions.

# Download and install vCluster CLI
# macOS (Intel/AMD)
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-darwin-amd64" && \
  sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster

# Verify installation
vcluster --version

# Deploy the platform
vcluster platform start

The CLI automatically opens the UI in your browser and logs you in. You'll be prompted to create an administrator user.

Option 2: Using Helm

See the Helm Installation Guide for detailed instructions.

# Add the Loft Helm repository
helm repo add loft https://charts.loft.sh
helm repo update

# Deploy vCluster Platform
RELEASE_NAME=vcluster-platform
RELEASE_NAMESPACE=vcluster-platform

helm upgrade $RELEASE_NAME vcluster-platform \
  --install \
  --repo https://charts.loft.sh/ \
  --namespace $RELEASE_NAMESPACE \
  --create-namespace \
  --set admin.username=admin \
  --set admin.password=your-secure-password

Option 3: Using ArgoCD (GitOps)

For GitOps deployments, see the ArgoCD Installation Guide for managing the platform deployment with ArgoCD or other GitOps tools.

Access the Platform

After installation, you can access the platform in several ways:

  1. Loft Router (Default): If loftHost is not configured, a random domain is automatically provisioned. Retrieve it with:

    kubectl get secret loft-router-domain \
      -n vcluster-platform \
      -o jsonpath="{.data.domain}" | base64 --decode
  2. Custom Ingress: If you configured an ingress, access via your custom domain

  3. Port Forward: For local access:

    kubectl port-forward -n vcluster-platform svc/vcluster-platform 8080:80

Default Credentials

If not set in your values.yaml, the default credentials are:

  • Username: admin
  • Password: my-password

⚠️ Security Note: It is strongly recommended to change these default credentials immediately after first login.

πŸ—οΈ Architecture

vcluster Platform consists of several key components:

  • Platform Controller: Core orchestration engine managing virtual clusters, accounts, and resources
  • API Server: RESTful API server exposing OpenAPI-compliant endpoints
  • Webhook Server: Validating and mutating webhooks for resource management
  • Agent: Lightweight agent deployed to managed clusters for multi-cluster operations
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  vcluster Platform                      β”‚
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   API Server β”‚  β”‚  Controller  β”‚  β”‚   Webhook    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚         Virtual Cluster Management               β”‚   β”‚
β”‚  β”‚  β€’ Create/Delete Virtual Clusters                β”‚   β”‚
β”‚  β”‚  β€’ Sleep/Wake Operations                         β”‚   β”‚
β”‚  β”‚  β€’ Resource Quotas & Limits                      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚         Multi-Tenancy & Isolation                β”‚   β”‚
β”‚  β”‚  β€’ Account Management                            β”‚   β”‚
β”‚  β”‚  β€’ Namespace Templates                           β”‚   β”‚
β”‚  β”‚  β€’ RBAC & Security Policies                      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Installation & Configuration

Recommended Configuration

When deploying with Helm, it's recommended to explicitly set these values:

admin:
  username: my-own-username
  password: my-secure-password

config:
  audit:
    enabled: true
  loftHost: vcluster-platform.mytld.com  # Publicly resolvable hostname

ingress:
  enabled: true
  host: vcluster-platform.mytld.com
  tls:
    enabled: true

# Environment variables for proxy configuration (if needed)
env:
  NO_PROXY: localhost,127.0.0.1,.svc,.svc.cluster.local,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
  no_proxy: localhost,127.0.0.1,.svc,.svc.cluster.local,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

Loft Router

vCluster Platform provides a hosted domain service called Loft Router that enables you to trial the platform using a hosted domain. This is enabled by default and particularly useful when you cannot use your own DNS.

To disable Loft Router, either:

  • Explicitly set config.loftHost and config.devPodSubDomain, or
  • Set the environment variable DISABLE_LOFT_ROUTER=true

Air-Gapped Installation

For environments without internet access, see the Air-Gapped Installation Guide for detailed instructions on:

  • Setting up a private OCI-compliant registry
  • Populating the registry with container images and Helm charts
  • Configuring vCluster Platform and agents for offline use

See chart/values.yaml for all available configuration options.

πŸ“š API Documentation

vCluster Platform exposes a comprehensive RESTful API that is fully OpenAPI 3.0 compliant. The API documentation is automatically generated and synced to this repository.

API Specs

API Endpoints

The API provides endpoints for:

  • Management API (/apis/management.loft.sh/v1/): Core platform management operations
  • Cluster API (/apis/v1.cluster.loft.sh/): Cluster communication and management
  • Virtual Cluster API: Virtual cluster lifecycle management
  • Project API: Project and resource management
  • User & Access API: User management and access control

Using the API

# Get API versions
curl https://your-vcluster-platform/api/apis/

# List virtual clusters
curl -H "Authorization: Bearer $TOKEN" \
  https://your-vcluster-platform/api/apis/management.loft.sh/v1/virtualclusters

For complete API reference, see the API Documentation in the official docs.

πŸ“Š Helm Charts

The Helm charts for vCluster Platform are automatically synced to this repository. The chart includes:

  • Deployment: Main platform controller and API server
  • Service: Kubernetes service for accessing the platform
  • Ingress: Optional ingress configuration with TLS support
  • RBAC: Service accounts, roles, and role bindings
  • Webhooks: Validating and mutating webhooks for resource management
  • Certificates: TLS certificate management with cert-manager integration
  • Monitoring: ServiceMonitor for Prometheus integration
  • Pod Disruption Budget: High availability configuration
  • Persistent Volume Claims: Optional persistence for platform data

Chart Structure

chart/
β”œβ”€β”€ Chart.yaml              # Chart metadata
β”œβ”€β”€ values.yaml             # Default configuration values
β”œβ”€β”€ templates/              # Kubernetes manifests
β”‚   β”œβ”€β”€ deployment.yaml
β”‚   β”œβ”€β”€ service.yaml
β”‚   β”œβ”€β”€ ingress.yaml
β”‚   β”œβ”€β”€ ingress-wakeup-service.yaml
β”‚   β”œβ”€β”€ rbac/
β”‚   β”‚   └── clusterrolebinding.yaml
β”‚   β”œβ”€β”€ webhook.yaml
β”‚   β”œβ”€β”€ apiservice.yaml
β”‚   β”œβ”€β”€ servicemonitor.yaml
β”‚   β”œβ”€β”€ pdb.yaml
β”‚   β”œβ”€β”€ pvc.yaml
β”‚   β”œβ”€β”€ secret.yaml
β”‚   β”œβ”€β”€ serviceaccount.yaml
β”‚   └── cert-issuer/
β”‚       └── issuer.yaml
└── tests/                  # Chart tests
    β”œβ”€β”€ deployment_test.yaml
    β”œβ”€β”€ pdb_test.yaml
    └── secret_test.yaml

Finding Chart Versions

To retrieve all available versions of the platform Helm chart:

helm search repo loft/vcluster-platform --versions

Customizing the Installation

You can customize your installation by creating a custom values file:

# custom-values.yaml
admin:
  username: myadmin
  password: mypassword

config:
  loftHost: vcluster-platform.example.com
  audit:
    enabled: true

ingress:
  enabled: true
  host: vcluster-platform.example.com
  tls:
    enabled: true

resources:
  limits:
    memory: 8Gi
    cpu: "4"

Then install with:

helm upgrade vcluster-platform vcluster-platform \
  --install \
  --repo https://charts.loft.sh/ \
  --namespace vcluster-platform \
  --create-namespace \
  --values custom-values.yaml

Note: vCluster Platform exclusively supports the default secret backend for storing Helm releases. Alternative HELM_DRIVER configurations (such as configmap or sql) are not supported.

βš™οΈ Configuration

Platform Configuration

Platform configuration can be managed via the config section in values.yaml or through the UI under Admin > Config. Key configuration options include:

config:
  audit:
    enabled: true
  loftHost: vcluster-platform.example.com  # Publicly resolvable hostname
  # Additional configuration options

For a detailed list of all available configuration options, see the Configuration Documentation.

Environment Variables

vCluster Platform can be configured via environment variables in the env section:

env:
  # Proxy configuration (if using proxies)
  NO_PROXY: localhost,127.0.0.1,.svc,.svc.cluster.local,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
  no_proxy: localhost,127.0.0.1,.svc,.svc.cluster.local,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
  HTTPS_PROXY: "https://proxy.example.com:8080"
  HTTP_PROXY: "http://proxy.example.com:8080"
  
  # Disable Loft Router
  DISABLE_LOFT_ROUTER: "true"

GitOps Deployment

vCluster Platform can be managed via GitOps tools like ArgoCD. Export your Helm configuration and store it in a Git repository for version-controlled deployments.

πŸ”„ Automatic Synchronization

This repository automatically syncs:

  • API Documentation: OpenAPI specifications are automatically generated and updated
  • Helm Charts: Chart templates and values are kept in sync with the platform releases
  • Swagger Specs: Swagger JSON and path definitions are regenerated on updates

These components are maintained automatically, ensuring the repository always reflects the latest platform capabilities.

πŸ§ͺ Testing

The Helm chart includes test templates that can be executed:

# Run chart tests
helm test vcluster-platform -n vcluster-platform

🀝 Contributing

Contributions are welcome! Please see our contributing guidelines for details on:

  • Code of conduct
  • Development setup
  • Pull request process
  • Issue reporting

πŸ“„ License

See LICENSE file for details.

πŸ”— Resources

πŸ†˜ Support

For questions, issues, or feature requests:

🎯 Next Steps

After installing vCluster Platform:

  1. Create Virtual Clusters: Start creating virtual clusters immediately - you're automatically part of a project called "Default Project"
  2. Learn About Projects: Understand how resources can be grouped together into different projects
  3. Explore Templates: Learn how to use templates to control what type of resources can be created
  4. Add Host Clusters: Connect additional host clusters to the platform
  5. Configure Sleep Mode: Set up sleep and wakeup functionality to reduce costs

For detailed guides, see the official documentation.


Note: This repository contains automatically synced API documentation and Helm charts. The platform codebase is maintained separately. All API specs, Swagger definitions, and Helm chart templates are kept up-to-date automatically to reflect the latest platform capabilities.

About

Namespace & Virtual Cluster Manager for Kubernetes - Lightweight Virtual Clusters, Self-Service Provisioning for Engineers and 70% Cost Savings with Sleep Mode

Topics

Resources

License

Stars

Watchers

Forks

Contributors 18

Languages