KubeFleet

repository·main·Indexed 41 days ago

https://github.com/kubefleet-dev/kubefleet

A CNCF sandbox project for multi-cluster Kubernetes management. KubeFleet provides a centralized control plane to manage workloads, schedule applications intelligently across edge, on-premises, and cloud environments, and roll out updates progressively. It consists of two primary components: the hub-agent for central control and the member-agent for cluster connectivity.

Tokens
35.2K
Snippets
72
Records
117
Agent score
50%

What's inside KubeFleet

  1. What is KubeFleet?

    main

    KubeFleet is a CNCF sandbox project that provides a set of Kubernetes controllers and Custom Resource Definitions (CRDs) for advanced multi-cluster application management. It enables users to treat a collection of Kubernetes clusters as a single, flexible container runtime environment.

    Key capabilities include:

    • Centralized Fleet Governance: Uses a hub-spoke architecture to create a single control plane for applying uniform policies across public clouds, private data centers, or edge locations.
    • Progressive Rollouts: Supports rollout plans that sequence updates across the fleet with health verification at each step, allowing for pauses or rollbacks to limit blast radius.
    • Multi-Cluster Scheduling: An intelligent scheduler that selects workload destinations based on cluster properties, capacity, and declarative placement policies (including affinity/anti-affinity, topology spread, and resource-based placement).
  2. Understand KubeFleet API versioning and lifecycle

    main

    KubeFleet core CRDs are served at multiple API versions. For example, the placement.kubernetes-fleet.io and cluster.kubernetes-fleet.io groups serve both v1 and v1beta1.

    • v1: The stable, externally promoted surface returned by kubectl by default.
    • v1beta1: The current storage version.

    Both versions refer to the same underlying objects. KubeFleet follows the Kubernetes API deprecation policy for its API maturity and deprecation windows.

  3. How hub-agent manages webhook certificates

    main

    The hub-agent supports two modes for managing webhook certificates:

    Automatic Certificate Generation (Default)

    • Mechanism: Generates certificates automatically at startup.
    • Pros: No external dependencies; works out of the box; 10-year validity.
    • Cons: Only supports single replica deployment (replicaCount must be 1).

    cert-manager (Optional)

    • Mechanism: Uses cert-manager to manage certificates.
    • Pros: Supports high availability (replicaCount > 1); automatic 90-day rotation; industry-standard practices.
    • Requirements: Requires useCertManager=true, enableWorkload=true, and enableWebhook=true.
  4. Configure Hub TLS for the member-agent

    main

    By default, the member-agent verifies the TLS server certificate of the hub API server (tlsClientInsecure=false). This requires a valid config.hubCA value. If the placeholder in values.yaml is not replaced with actual CA data, the agent will fail at startup.

    Only set tlsClientInsecure=true in explicitly trusted test environments where certificate verification cannot be configured, as this bypasses security checks.

  5. KubeFleet voting and consensus rules

    main

    KubeFleet primarily operates using lazy consensus. However, formal votes may be required for specific actions or changes. Votes can be conducted via the developer mailing list, the private Maintainer mailing list (for security or conduct), or during developer meetings.

    Voting Thresholds:

    • Simple Majority: Required for most votes, including new Maintainer approvals and CNCF resource requests. This means more than half of the Maintainers.
    • Two-Thirds (2/3) Majority: Required for:
      • Removing a Maintainer.
      • Modifying the Project Governance charter.
    • Any Maintainer has the right to demand a vote.
  6. Manage KubeFleet agent version skew

    main

    A KubeFleet deployment consists of a hub-agent (control plane) and a member-agent (worker/kubelet).

    KubeFleet supports a symmetric, single-minor skew. This means the hub-agent and member-agent may run adjacent minor versions—at most one minor apart, in either direction.

    Supported Examples:

    • Hub v0.5.z with Member v0.4.z (Supported)
    • Hub v0.5.z with Member v0.6.z (Supported)
    • Hub v0.5.z with Member v0.3.z (Unsupported)

    Important: Do not skip minor versions during upgrades. Upgrade through each minor version in turn to maintain compatibility.

  7. Understand KubeFleet versioning and release types

    main

    KubeFleet uses Semantic Versioning (vMAJOR.MINOR.PATCH). Because the project is in the 0.y.z series, minor version bumps (0.Y → 0.Y+1) may include breaking changes. Patch releases (0.Y.Z → 0.Y.Z+1) are strictly for backward-compatible bug fixes and security patches.

    Version Bump Reference

    Change TypeBump Type
    New CRD, or a new field/value on an existing CRDMinor
    Breaking change to an existing CRD (removed/renamed field, tightened validation, changed default)Minor
    Change to scheduling, override, rollout, or apply semantics that re-ranks or re-applies existing placementsMinor
    A new agent flag whose default changes observable behaviorMinor
    Backward-compatible bug fix or security patch with no API or behavior changePatch
    Dependency bumps with no user-visible behavior changePatch
  8. Available KubeFleet Helm Charts

    main

    KubeFleet is composed of two primary components deployed via Helm:

    • hub-agent: The central controller running on the hub cluster. It manages placement decisions, scheduling, and cluster inventory.
    • member-agent: The agent running on each member cluster. It applies workloads and reports cluster status back to the hub.
  9. Maintainer responsibilities and removal

    main

    KubeFleet Maintainers (the 'Maintainer Council') manage project resources and contributors. They have write access to the GitHub repository and are expected to participate in weekly public developer meetings.

    Removal and Resignation:

    • Resignation: Maintainers may resign at any time.
    • Removal: A Maintainer may be removed by a 2/3 vote of the remaining maintainers for reasons including:
      • Inactivity (defined as very low or no activity for 6 months or more without a return plan).
      • Failure to fulfill responsibilities.
      • Violating the Code of Conduct.
    • Emeritus Status: Depending on the reason for removal, a Maintainer may be converted to 'Emeritus' status, allowing them to be consulted on project matters and potentially return to full status later.
  10. Quickstart KubeFleet with Kind

    main

    To get started with KubeFleet using kind (Kubernetes in Docker), follow the official getting started guide. This will walk you through the initial setup and environment preparation.

    https://kubefleet-dev.github.io/website/docs/getting-started/kind/
  11. Cleanup resources after clusterloader2 tests

    main

    While clusterloader2 automatically deletes generated namespaces by default, it does not automatically delete Custom Resource Definitions (CRPs) created during the test. To clean up these remaining resources, use the provided cleanup.sh script.

    Ensure your KUBECONFIG environment variable is set to the correct path before running the script.

    export KUBECONFIG=<your path to the kubeconfig file>
    ./cleanup.sh
  12. Install KubeFleet via Traditional Helm Repository

    main

    You can also use a traditional Helm repository hosted on GitHub Pages. This requires adding the repository and updating your local cache before installation.

    # Add the KubeFleet Helm repository
    helm repo add kubefleet https://kubefleet-dev.github.io/kubefleet/charts
    
    # Update your local Helm chart repository cache
    helm repo update
    
    # Install hub-agent
    helm install hub-agent kubefleet/hub-agent \
      --namespace fleet-system \
      --create-namespace
    
    # Install member-agent
    helm install member-agent kubefleet/member-agent \
      --namespace fleet-system \
      --create-namespace \
      --set config.hubURL=https://<hub-api-server> \
      --set config.hubCA=<base64-encoded-hub-ca> \
      --set config.memberClusterName=<member-cluster-name>