Kubernetes
Install and configure Traefik Hub API Gateway.
Before You Begin
Before you begin the installation process, it is recommended that you have a basic understanding of Kubernetes. You should have access to a working Kubernetes cluster, either on a cloud provider or on your own infrastructure.
Please make sure that you have the following:
- Kubectl
- Helm v3
- Networking requirements to make sure that the Traefik Hub API Gateway can communicate with Traefik Hub to validate the token.
To install Traefik Hub API Gateway, copy and paste the following instructions. This will install Traefik Hub API Gateway.
- Install Traefik Hub API Gateway
- Install Traefik Hub API Gateway in a multitenant Kubernetes cluster
Install Traefik Hub API Gateway
# Add and update the Helm repository
helm repo add --force-update traefik https://traefik.github.io/charts
# Install Traefik Hub API Gateway with ClusterRole in traefik namespace
kubectl create namespace traefik
kubectl create secret generic traefik-hub-license --namespace traefik --from-literal=token=YOUR-TRAEFIK-HUB-TOKEN
helm upgrade --install --namespace traefik \
--set hub.token=traefik-hub-license \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.3.1 \
traefik traefik/traefik
Install Traefik Hub API Gateway in a multitenant Kubernetes cluster
# Add and update the Helm repository
helm repo add --force-update traefik https://traefik.github.io/charts
# Install Traefik Hub API Gateway with namespace'd Role in foo namespace
kubectl create namespace foo
kubectl create secret generic traefik-hub-license --namespace foo --from-literal=token=FIRST-TRAEFIK-HUB-TOKEN
helm upgrade --install --namespace foo \
--set hub.token=traefik-hub-license \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.3.1 \
--set ingressClass.enabled=false \
--set rbac.enabled=true \
--set rbac.namespaced=true \
--set providers.kubernetesCRD.namespaces[0]=foo \
--set providers.kubernetesIngress.namespaces[0]=foo \
--set providers.kubernetesGateway.namespaces[0]=foo \
traefik traefik/traefik
# Install Traefik Hub API Gateway with namespace'd Role in bar namespace
kubectl create namespace bar
kubectl create secret generic traefik-hub-license --namespace bar --from-literal=token=SECOND-TRAEFIK-HUB-TOKEN
helm upgrade --install --namespace bar \
--set hub.token=traefik-hub-license \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.3.1 \
--set ingressClass.enabled=false \
--set rbac.enabled=true \
--set rbac.namespaced=true \
--set providers.kubernetesCRD.namespaces[0]=bar \
--set providers.kubernetesIngress.namespaces[0]=bar \
--set providers.kubernetesGateway.namespaces[0]=bar \
traefik traefik/traefik
warning
The multi-tenant installation is only available for Traefik Hub API Gateway.
YOUR-TRAEFIK-HUB-TOKEN
: Your token provided by Traefik Labs
Did You Know?
That Traefik Hub API Gateway is installed using the same Helm Chart as Traefik Proxy It's open source and contributors are welcome.
Migrating from Traefik Proxy
To migrate from Traefik Proxy, install the Traefik Hub API Gateway as described below.
Install Traefik Hub API Gateway
# Add and update the Helm repository
helm repo add --force-update traefik https://traefik.github.io/charts
# Upgrade the release to use Traefik Hub API Gateway instead of Traefik Proxy
kubectl create secret generic traefik-hub-license --namespace traefik --from-literal=token=YOUR-TRAEFIK-HUB-TOKEN
helm upgrade --install --namespace traefik \
--reuse-values \
--set hub.token=traefik-hub-license \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.3.1 \
traefik traefik/traefik
YOUR-TRAEFIK-HUB-TOKEN
: Your token provided by Traefik Labs