cluster-chart

by MoTTTT

Helm chartv0.1.6App 1.0.0Apache-2.0Verified publisher

A Helm chart to generate Cluster API managed Cluster manifests.

About this chart

cluster-chart: A Helm chart to generate Cluster API Cluster manifests

The chart supports the following CAPI providers, which need to be pre-installed on your CAPI management cluster:

  • Proxmox CAPI Infrastructure Provider
  • Talos Cluster Provider
  • Talos Bootstrap Provider

Pre-requisites

  • kubectl (Kubernetes command line tool)
  • clusterctl (Cluster API cluster management tool, used to install providers)
  • helm (Kubernetes package manager) required unless you are using server-side apply.
  • talosctl (Talos command line tool)
  • flux (GitOps tool) to connect your cluster to a gitops repo
  • Proxmox (Hypervisor). You will need a user token name, token value, and URL
  • Talos template vm created in your proxmox cluster.
  • Management Cluster: Any kubernetes cluster with network access to your hypervisor will do.

Configuration and Installation of Cluster API

Values

The values used in the chart will need configuration to match your requirements. Most of them are going to need attention.

IP Address range defaults to 192.168.4.191-192.168.4.197, and Control plane VIP to 192.168.4.190.

The default machine sizing is a single 16 CPU, 16 GB RAM, and 40GB DISK control plane node, and a single 16 CPU, 16 GB RAM, and 140GB DISK worker node.

The default network uses 192.168.4.0/24 subnet, with a gateway of 192.168.4.1. The Gateway/Bastion server is available on an external network with IP address 192.168.1.80, and hostname "freyr".

The default Talos image is V1.11.1, NoCloud, amd64, with siderolabs/drbd, siderolabs/qemu-guest-agent extensions.

Value NameDescriptionDefault value
cluster.nameCluster namecluster09
cluster.versionKubernetes versionv1.32.0
cluster.imageTalos imagefactory.talos.dev/nocloud-installer/6adc7e7fba27948460e2231e5272e88b85159da3f3db980551976bf9898ff64b:v1.11.1
network.ip_rangesIP range for the cluster[192.168.4.191-192.168.4.197]
network.ip_prefixIP prefix for the cluster24
network.gatewayGateway for the cluster192.168.4.1
network.bastion_hostBastion hostfreyr
network.bastion_host_endpoint_ipBastion host endpoint IP192.168.1.80
network.dns_serversDNS servers[192.168.1.201]
controlplane.endpoint_ipControl plane IP192.168.4.190
controlplane.machine_countControl plane machines1
controlplane.boot_volume_sizeControl plane boot volume size40
controlplane.num_coresControl plane cores4
controlplane.num_socketsControl plane sockets4
controlplane.memory_mibControl plane memory16384
worker.machine_countWorker machines1
worker.boot_volume_sizeWorker boot volume size140
worker.num_coresWorker cores4
worker.num_socketsWorker sockets4
worker.memory_mibWorker memory16384
proxmox.allowed_nodesProxmox Allowed Nodes[venus]
proxmox.template.sourcenodeProxmox Source Nodevenus
proxmox.template.template_vmidProxmox Template VM ID100
proxmox.vm.boot_volume_deviceProxmox Boot Volume Devicevirtio0
proxmox.vm.bridgeProxmox Bridgevmbr0

Usage

Helm CLI

  • Install the chart repo: helm repo add cluster-chart https://motttt.github.io/charts/
  • Generate a dry-run manifest:helm install --dry-run --debug dry-run-release cluster-chart/cluster-chart > cluster-chart-dryrun.yaml
  • cluster-chart-dryrun.yaml will contain the default values and the manifests that are generated using no value overrides.
  • Apply the manifest to your management cluster once you are happy with the values.
  • Personalised manifests can be generated by creating your own values file, or by defining the values inline:
helm install   cluster08-release cluster-chart/cluster-chart  \ 
        --set cluster.name=cluster08 \
        --set network.ip_ranges='[192.168.4.181-192.168.4.187]' \
        --set controlplane.endpoint_ip=192.168.4.180 \
        --set controlplane.num_cores=2 \
        --set controlplane.num_sockets=2 \
        --set controlplane.memory_mib=8192 \
        --set worker.boot_volume_size=40 \
        --set worker.num_cores=2 \
        --set worker.num_sockets=2 \
        --set worker.memory_mib=8192
  • The release notes provide sample commands for Cluster API progress monitoring, Talos and kube configuration extraction, and Flux bootstrapping.

Flux example

The cluster-chart helm chart was created to mechanism to add clusters to a Management cluster using gitops.

If your management cluster is using Flux, then each managed cluster can be added as a kustomization.

See an example in the cluster09 git repo https://github.com/MoTTTT/cluster09/tree/main/gitops/cluster-charts/observability.

Manifest Templates

The following manifests templates are used to generate the manifests to provision a cluster using the Proxmox and Talos CAPI providers:

TemplateObject Kind created
cluster.yamlCAPI Cluster
machinedeployment.yamlCAPI MachineDeployment
namespace.yamlNamespace: Identical to the cluster name
NOTES.txtHelm Release Notes
proxmoxcluster.yamlProxmoxCluster
proxmoxmachinetemplate-cp.yamlProxmoxMachineTemplate for Control Plane
proxmoxmachinetemplate-w.yamlProxmoxMachineTemplate for Worker Nodes
talosconfigtemplate.yamlTalos machine patch
taloscontrolplane.yamlTalos control plane patch

Networking considerations

Bastion server entries in the values file can be used to add additional entries to SAN (Subject Alternative Name) of the kube api certificate.

If the target cluster's kubernetes api server needs to be accessed indirectly, using an external hostname, IP Address or both, these can be added to the api certificates SAN, using values for network.bastion_host and network.bastion_host_endpoint_ip.

Best practice would be to avoid exposing the cluster's api endpoints externally, so the bastion server's ports should be set up for local access only, using a VPN or similar solution if remote access to the target cluster api is specifically required.

References

Deploy cluster-chart with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cluster-chart 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 chartcluster-chart is pinned at v0.1.6 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