Getting Started
Verified against the chart commands in
src/hack/local-running.shat commite8b5a0c. Commands assume a parent cluster and at least one child cluster, pluskubectlandhelmon your path.
Prerequisites
- Two Kubernetes clusters, one parent and one child, on a version the release supports. Clusternet
v0.18.xrequires Kubernetes>=v1.30(README). kind clusters work for a local trial. kubectlconfigured with a context for each cluster.helm(v3) for installing the charts.- The parent API server address must be reachable from the child, since the child dials out to register.
Install
Add the official Helm chart repository (src/hack/local-running.sh:116).
helm repo add clusternet https://clusternet.github.io/charts
helm repo updateA first working setup
These steps mirror src/hack/local-running.sh. Run the parent steps against your parent context and the agent step against your child context.
Install the three parent-side components into the
clusternet-systemnamespace (src/hack/local-running.sh:122,src/hack/local-running.sh:129,src/hack/local-running.sh:134).bashhelm install clusternet-hub -n clusternet-system --create-namespace clusternet/clusternet-hub helm install clusternet-scheduler -n clusternet-system --create-namespace clusternet/clusternet-scheduler helm install clusternet-controller-manager -n clusternet-system --create-namespace clusternet/clusternet-controller-managerCreate the bootstrap token the child will use to register (
src/hack/local-running.sh:124). This applies a sample token to the parent.bashkubectl apply -f https://raw.githubusercontent.com/clusternet/clusternet/main/manifests/samples/cluster_bootstrap_token.yamlFind your parent API server address, which the agent needs as
parentURL.bashkubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'Install
clusternet-agentinto the child cluster, pointing it at the parent and the bootstrap token from step 2 (src/hack/local-running.sh:138). Replace the URL with the value from step 3.bashhelm install clusternet-agent -n clusternet-system --create-namespace \ --set parentURL=https://PARENT-APISERVER:PORT \ --set registrationToken=07401b.f395accd246ae52d \ clusternet/clusternet-agent
Verify it works
On the parent cluster, list the registered child clusters. The ManagedCluster CRD has the short name mcls.
kubectl get mcls -AA successfully registered child appears as a ManagedCluster in its own dedicated namespace. You can then create a Subscription on the parent to distribute a workload; the example manifests under src/examples/replication-scheduling and src/examples/static-dividing-scheduling show both scheduling strategies.
Where to go next
- The quick start tutorial sets up Clusternet locally with
kindand three child clusters; the script behind it issrc/hack/local-running.sh. - For installation options, sync modes, and the
extraArgs.cluster-sync-modevalue (Push,Pull, orDual), see the official docs (Introduction). - If the parent API server does not support bootstrap-token authentication (for example k3s), use a ServiceAccount token instead, per the official Helm installation docs.