clusternet-agent

by Clusternet

Helm chartv1.0.0App v1.0.0

Chart for clusternet-agent

About this chart

How to install clusternet-agent

clusternet-agent is responsible for

  • auto-registering current cluster to a parent cluster as a child cluster, which is also been called ManagedCluster;
  • reporting heartbeats of current cluster, including Kubernetes version, running platform, healthz/readyz/livez status, etc;
  • setting up a websocket connection that provides full-duplex communication channels over a single TCP connection to parent cluster;

Prerequisites

  • Kubernetes 1.18+
  • Helm 3.1.0

TL;DR

helm repo add clusternet https://clusternet.github.io/charts
helm install clusternet-agent -n clusternet-system --create-namespace \
  --set parentURL=PLEASE-CHANGE-ME \
  --set registrationToken=PLEASE-CHANGE-ME \
  clusternet/clusternet-agent

Please update PLEASE-CHANGE-ME to your valid configurations, such as,

helm install clusternet-agent -n clusternet-system --create-namespace \
  --set parentURL=https://192.168.10.10:6443 \
  --set registrationToken=07401b.f395accd246ae52d \
  clusternet/clusternet-agent

Note: If bootstrapping authentication is not supported by the kube-apiserver in parent cluster (like k3s), i.e. --enable-bootstrap-token-auth=false (which defaults to be false), please use serviceaccount token instead.

Click here to get the serviceaccount token from parent cluster.

helm install clusternet-agent -n clusternet-system --create-namespace \
  --set parentURL=https://192.168.10.10:6443 \
  --set registrationToken=Parent-Cluster-ServiceAccount-Token \
  clusternet/clusternet-agent

Step-by-step Installation & Uninstallation

Installing the Chart

Note: The images are synced to dockerhub as well, you could set image.registry to empty or docker.io if needed.

To install the chart with the release name clusternet-agent and release namespace clusternet-system:

helm repo add clusternet https://clusternet.github.io/charts
helm install clusternet-agent -n clusternet-system --create-namespace \
  --set parentURL=PLEASE-CHANGE-ME \
  --set registrationToken=PLEASE-CHANGE-ME \
  clusternet/clusternet-agent

Please update PLEASE-CHANGE-ME to your valid configurations, such as,

helm install clusternet-agent -n clusternet-system --create-namespace \
  --set parentURL=https://192.168.10.10:6443 \
  --set registrationToken=07401b.f395accd246ae52d \
  clusternet/clusternet-agent

These commands deploy clusternet-agent on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list -A

Uninstalling the Chart

To uninstall/delete the clusternet-agent deployment:

helm delete clusternet-agent -n clusternet-system

The command removes all the Kubernetes components associated with the chart and deletes the release.

Parameters

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname""
fullnameOverrideString to fully override common.names.fullname""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}

Exposure parameters

NameDescriptionValue
parentURLThe apiserver address of parent cluster""
registrationTokenThe bootstrap token used by cluster registration""
replicaCountSpecify number of clusternet-agent replicas3
serviceAccount.nameThe name of the ServiceAccount to create"clusternet-agent"
image.registryclusternet-agent image registryghcr.io
image.repositoryclusternet-agent image repositoryclusternet/clusternet-agent
image.tagclusternet-agent image tag (immutable tags are recommended)v1.0.0
image.pullPolicyclusternet-agent image pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[]
leaderElectEnable or disable leader electtrue
featureGatesEnable or disable feature gatesSocketConnection=true,AppPusher=true,Recovery=true,Predictor=true
kubeAPI.burstKubernetes API client Burst limit to use while talking with 'core' kubernetes apiserver100
kubeAPI.qpsKubernetes API client QPS limit to use while talking with the 'core' kubernetes apiserver50.0
extraArgs.cluster-sync-modeSpecify the sync mode 'Pull', 'Push' and 'Dual' between parent cluster and child clusterDual
extraArgs.use-metrics-serverUse metrics serverfalse
extraArgs.cluster-reg-nameSpecify the cluster registration namemycluster
extraArgs.cluster-reg-namespaceSpecify the cluster registration namespacemycluster-ns
resources.limitsThe resources limits for the container{}
resources.requestsThe requested resources for the container{}
nodeSelectorNode labels for pod assignment{}
priorityClassNameSet Priority Class Name to allow priority control over other pods""
hostNetworkSpecify whether to use the host's networking stackfalse
tolerationsTolerations for pod assignment[]
podAffinityPresetPod affinity preset. Ignored if affinity is set. Allowed values: soft or hard""
podAntiAffinityPresetPod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hardsoft
nodeAffinityPreset.typeNode affinity preset type. Ignored if affinity is set. Allowed values: soft or hard""
nodeAffinityPreset.keyNode label key to match. Ignored if affinity is set.""
nodeAffinityPreset.valuesNode label values to match. Ignored if affinity is set.[]
affinityAffinity for pod assignment{}

Deploy clusternet-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has clusternet-agent on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartclusternet-agent is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply