cluster-api-provider-hosted-control-plane

module
v0.0.0-...-b206684 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2025 License: AGPL-3.0

README ΒΆ

πŸ—οΈ Cluster API Control Plane Provider for Hosted Control Planes

Go Report Card License CLA assistant

A Kubernetes Cluster API control plane provider that enables management of hosted control planes as first-class Kubernetes resources. This provider allows you to create and manage highly available Kubernetes control plane components (API Server, Controller Manager, Scheduler, and etcd) as hosted services, decoupling them from the underlying infrastructure.

🌟 What is a Hosted Control Plane?

Traditional Kubernetes clusters tightly couple the control plane components with worker nodes on the same infrastructure. Hosted control planes break this coupling by running control plane components as managed services, offering:

  • Infrastructure Independence: Control planes run separately from worker nodes
  • Enhanced Reliability: Dedicated infrastructure for control plane components
  • Simplified Operations: Automated lifecycle management and upgrades
  • Cost Optimization: Shared control plane infrastructure across multiple clusters
  • Faster Provisioning: Pre-provisioned control planes reduce cluster creation time

πŸš€ Key Features

🎯 Core Capabilities
  • Multi-Replica Control Plane: Horizontal scaling for high availability
  • Automated ETCD Management: Built-in backup/restore with S3 integration
  • Gateway API Integration: Modern traffic routing and load balancing
  • Certificate Management: Automated TLS via cert-manager integration
  • OpenTelemetry Observability: Comprehensive tracing and monitoring
  • Cloud-Native Storage: S3-compatible backup solutions
πŸ”§ Advanced Features
  • Network Policy Support: Component-based access control

πŸ›οΈ Architecture

graph TB
    subgraph MC["πŸ—οΈ Management Cluster"]
        subgraph HCP["πŸŽ›οΈ Hosted Control Plane"]
            direction TB
            subgraph CP["Control Plane Components"]
                direction LR
                API["πŸ“‘ API Server"]
                CM["πŸ”§ Controller Manager"]
                SCHED["⏰ Scheduler"]
                API --- CM --- SCHED
            end

            ETCD["πŸ’Ύ ETCD Cluster"]
            CP --- ETCD
        end

        CAPI["πŸ€– Cluster API"]
        PROVIDER["🏠 HCP Provider"]
    end

    subgraph WC["πŸ”¨ Workload Cluster"]
        direction LR
        W1["πŸ‘· Worker Node 1"]
        W2["πŸ‘· Worker Node 2"]
        WN["πŸ‘· Worker Node N"]
        W1 --- W2 --- WN
    end

    HCP -->|"πŸ”‘ Kubeconfig"| WC
    CAPI --> PROVIDER
    PROVIDER --> HCP

    style MC fill:#e1f5fe,color:#000
    style HCP fill:#f3e5f5,color:#000
    style WC fill:#e8f5e8,color:#000
    style API fill:#fff3e0,color:#000
    style CM fill:#fff3e0,color:#000
    style SCHED fill:#fff3e0,color:#000
    style ETCD fill:#fce4ec,color:#000

πŸ› οΈ Installation

Prerequisites
  • Kubernetes cluster (management cluster) v1.28+
  • Cluster API v1.10+ installed
  • cert-manager for certificate management
  • Gateway API CRDs (for traffic routing)
Install the Provider
# Install using the latest release
kubectl apply -f https://github.com/teutonet/cluster-api-provider-hosted-control-plane/releases/latest/download/control-plane-components.yaml

# Or install a specific version
kubectl apply -f https://github.com/teutonet/cluster-api-provider-hosted-control-plane/releases/download/v0.1.0/control-plane-components.yaml
Verify Installation
kubectl get pods -n cluster-api-provider-hosted-control-plane-system

πŸ“– Usage

Basic Hosted Control Plane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
kind: HostedControlPlane
metadata:
  name: my-hosted-control-plane
  namespace: default
spec:
  version: v1.33.0
  replicas: 3
  gateway:
    name: capi
    namespace: capi-system
Integration with Cluster API
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: my-cluster
spec:
  controlPlaneRef:
    apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
    kind: HostedControlPlane
    name: my-hosted-control-plane
  infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    kind: AWSCluster # Or your infrastructure provider
    name: my-aws-cluster

πŸŽ›οΈ Configuration

Environment Variables
Variable Description Default
LEADER_ELECTION Enable leader election true
WEBHOOK_CERT_DIR Directory for webhook certs /tmp/k8s-webhook-server/serving-certs
MAX_CONCURRENT_RECONCILES Max concurrent reconciles 10
CONTROLLER_NAMESPACE Namespace for the controller
LOG_FORMAT Log format (json or text) json
LOG_LEVEL Log level (debug, info, etc.) info
OTEL_EXPORTER_OTLP_ENDPOINT OpenTelemetry collector endpoint -

πŸ§ͺ Development

Prerequisites
  • Go 1.24+
  • kubectl
  • Task (for building and testing)
Build and Test
# Build the project
task build

# Run tests
task test

# Run linting
task lint

# Generate manifests
task manifests

# Full CI pipeline
task ci
Local Development
# have CAPI installed
task manifests
kubectl apply -f ./build/control-plane-components.yaml
task dev
# Run the controller locally within you IDE (.run for IDEA provided)

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Code of Conduct
  • Development process
  • Pull request guidelines
  • Issue reporting
Development Workflow
  1. Fork the repository
  2. Create a feature branch (git switch -c feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting (task ci)
  5. Commit your changes (git commit)
  6. Push to the branch (git push fork feature/amazing-feature)
  7. Open a Pull Request (gh pr create is amazing!)

πŸ“‹ Compatibility

Component Version
Kubernetes v1.28+
Cluster API v1.10+
cert-manager v1.18+
Gateway API v1.3+ (optional)
Go 1.24+

πŸ›£οΈ Roadmap

  • Enhanced Monitoring: Prometheus metrics
  • Auto-Scaling: Dynamic control plane scaling based on load

πŸ†˜ Support

πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.


Built with ❀️ by the teuto.net team

⭐ Star us on GitHub β€’ πŸ› Report Issues β€’ πŸ’¬ Join Discussions

Directories ΒΆ

Path Synopsis
api
Package api contains the whole schema for the controller.
Package api contains the whole schema for the controller.
v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
cmd
pkg
hostedcontrolplane
Package hostedcontrolplane contains the controller logic for reconciling HostedControlPlane objects.
Package hostedcontrolplane contains the controller logic for reconciling HostedControlPlane objects.
operator
Package operator contains the main entrypoint for the operator.
Package operator contains the main entrypoint for the operator.
operator/etc
Package etc contains the configuration for the operator.
Package etc contains the configuration for the operator.
operator/util/names
Package names provides consistent naming for multiple resource types.
Package names provides consistent naming for multiple resource types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL