hub-manager
by Traefik Labs
A Helm chart for hub-manager
About this chart
Hub Manager
hub-manager is the self-hosted control plane for Traefik Hub. It replaces the Traefik SaaS platform: instead of reaching out to platform.hub.traefik.io, your Traefik instances connect to a hub-manager you run inside your own cluster.
Introduction
hub-manager stores its state in PostgreSQL and is reached by Traefik through a Kubernetes Service. Linking the two requires an offline license token, shared by both sides.
A full setup is made of two charts:
hub-manager— the control plane (this chart).traefik— the proxy, configured with Traefik Hub pointing athub-manager.
Installing
Prerequisites
- Kubernetes (server) version v1.25.0 or higher:
kubectl version - Helm v3.9.0 or higher installed:
helm version - Traefik's chart repository:
helm repo add traefik https://traefik.github.io/charts - A reachable PostgreSQL database.
- An offline Traefik Hub license token.
1. Create the Secret
hub-manager reads its sensitive configuration from a single Secret. Create the namespace and a Secret that holds the license token, the PostgreSQL connection string and an encryption key:
kubectl create namespace hub
kubectl create secret generic hub-manager-config -n hub \
--from-literal=token='<offline-license-token>' \
--from-literal=postgres-uri='postgres://user:password@host:5432/hub' \
--from-literal=postgres-encryption-key="$(openssl rand -base64 32)"
2. Install the hub-manager chart
Reference the Secret from your values and install the chart:
token: hub-manager-config
postgres:
uri: hub-manager-config
encryptionKey: hub-manager-config
helm install hub-manager traefik/hub-manager -n hub -f values.yaml
or, to install from the OCI registry:
helm install hub-manager oci://ghcr.io/traefik/helm/hub-manager -n hub -f values.yaml
For complete documentation on all available parameters, check the default values file or VALUES.md.
3. Connect Traefik to hub-manager
Install the traefik chart in the same hub namespace so it can reuse the Secret created above, with Traefik Hub pointing at the hub-manager Service instead of the SaaS platform:
hub:
# Reuse the Secret created above: its 'token' key holds the same offline license token
token: hub-manager-config
offline: true
apimanagement:
enabled: true
additionalArguments:
- "--hub.platformurl=http://hub-manager.hub.svc.cluster.local/agent"
helm install traefik traefik/traefik -n hub -f traefik-values.yaml
The platform URL follows the hub-manager Service as http://<release>.<namespace>.svc.cluster.local/agent — here hub-manager in the hub namespace.
[!NOTE] The URL must end with
/agent, otherwise Traefik Hub cannot reach the control plane.--hub.platformurlis also only honoured with an offline license, sohub.offlinemust betrueon the Traefik side.
Deploy hub-manager with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has hub-manager 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charthub-manager is pinned at v1.0.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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