Skip to main content

Uplink

An Uplink is a Custom Resource Definition (CRD) used for inter-cluster service advertisement in multi-cluster deployments.

A child cluster declares an Uplink to advertise to a parent cluster that it can handle a particular workload. This advertisement is automatically materialized as a service on the parent cluster, enabling the parent to route traffic to the advertised workload.

Overview

The Uplink resource works with:

Configuration Example

apiVersion: hub.traefik.io/v1alpha1
kind: Uplink
metadata:
name: api-workload
namespace: apps
spec:
weight: 10

Configuration Options

FieldDescriptionDefaultRequired
kindResource kind. Must be Uplink.-Yes
metadata.nameName of the Uplink. Used to reference this uplink from routers and to create services on the parent cluster.-Yes
metadata.namespaceNamespace of the Uplink.-Yes
spec.exposeNameCustom name for the service exposed to parent clusters. Useful for controlling the service name independent of the resource name.-No
spec.entryPointsList of uplink entry point names this uplink is associated with. If not specified, uses default uplink entry points.[]No
spec.weightWeight for weighted round-robin load balancing when multiple child clusters advertise the same uplink. Higher weights receive proportionally more traffic. Must be >=0.1No
spec.healthCheckActive health check configuration for the parent cluster's load balancer. See Health Check Configuration for details.-No

The Uplink name is used to:

  1. Reference from routers: IngressRoutes reference uplinks using the hub.traefik.io/router.uplinks annotation
  2. Create parent services: The parent cluster creates services using the uplink name

By default, Kubernetes Uplinks are named using the pattern <namespace>-<name>. You can override this with the spec.exposeName field.

When the uplink is registered with the parent cluster, the service name follows the pattern:

  • <uplink-name>@multicluster - Weighted round-robin across all children advertising this uplink
  • <uplink-name>-<child-name>@multicluster - Direct access to a specific child

For example, an Uplink named api-workload in namespace apps creates:

  • apps-api-workload@multicluster - WRR service
  • apps-api-workload-child-1@multicluster - Per-child service (where child-1 is the child name from parent config)

IngressRoutes reference uplinks using the hub.traefik.io/router.uplinks annotation. The annotation value is a comma-separated list of fully-qualified uplink names (including namespace prefix).

When a router references an uplink:

  1. The router is advertised to parent clusters through the uplink
  2. The router must not specify entryPoints (entry points come from the uplink)
  3. The router must not specify tls configuration (TLS is handled by the uplink entry point)
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: api-route
namespace: apps
annotations:
# Reference the uplink using <namespace>-<name> format
hub.traefik.io/router.uplinks: "apps-api-workload"
spec:
# Note: No entryPoints - inherited from the uplink
routes:
- match: PathPrefix(`/api`)
kind: Rule
services:
- name: api-backend
port: 8080
middlewares:
- name: rate-limit
Incorrect Configuration

The following configurations are incorrect and will result in an error:

# Invalid: Router has both entryPoints and uplink annotation
metadata:
annotations:
hub.traefik.io/router.uplinks: "apps-my-uplink"
spec:
entryPoints:
- websecure # Not allowed with uplinks
# Invalid: Router has both TLS and uplink annotation
metadata:
annotations:
hub.traefik.io/router.uplinks: "apps-my-uplink"
spec:
tls: {} # Not allowed with uplinks

Weight Configuration

The weight field controls traffic distribution when multiple child clusters advertise the same uplink:

# On child cluster 1 - receives 90% of traffic
apiVersion: hub.traefik.io/v1alpha1
kind: Uplink
metadata:
name: api-workload
spec:
weight: 90

Health Check Configuration

The healthCheck field enables active health monitoring of child clusters from the parent cluster. When configured, the parent cluster periodically probes the child cluster's uplink endpoint to verify availability. This enables automatic failover when a child becomes unavailable.

Health Check Fields

FieldDescriptionDefaultRequired
pathURL path for the health check endpoint (e.g., /health, /healthz).-No
schemeHTTP scheme to use for health check requests (http, https).Uses uplink server schemeNo
modeHealth check mode. Supported values: http (standard HTTP), grpc (gRPC health check protocol).httpNo
methodHTTP method for health check requests.GETNo
statusExpected HTTP status code indicating a healthy response.200No
portPort for health check requests.Uses uplink server portNo
intervalFrequency of health checks for healthy targets (e.g., 10s, 30s).30sNo
unhealthyIntervalFrequency of health checks for unhealthy targets.Same as intervalNo
timeoutMaximum time to wait for a health check response before marking as unhealthy.5sNo
hostnameValue of the Host header in health check requests.Uses uplink hostnameNo
followRedirectsWhether to follow HTTP redirects during health checks.trueNo
headersCustom headers to include in health check requests.-No

Basic Health Check Example

apiVersion: hub.traefik.io/v1alpha1
kind: Uplink
metadata:
name: api-workload
namespace: apps
spec:
entryPoints:
- uplink
healthCheck:
path: /health
interval: 10s
timeout: 3s
status: 200

Health Check Behavior

How It Works:

  1. Parent-Side Monitoring: Health checks run on the parent cluster's load balancer, probing the child cluster's uplink endpoint
  2. Automatic Status Updates:
    • Healthy targets are checked at the interval frequency (default 30s)
    • Unhealthy targets are checked at the unhealthyInterval frequency (defaults to same as interval)
  3. Failover Integration:
    • When a child fails health checks, it's automatically removed from the load balancing pool
    • Traffic is redistributed among remaining healthy children
    • When the child recovers, it's automatically re-added to the pool

Health Check with Failover:

# Child Cluster 1 (EU)
apiVersion: hub.traefik.io/v1alpha1
kind: Uplink
metadata:
name: api-workload
namespace: apps
spec:
exposeName: api-workload-eu
healthCheck:
hostname: "api.eu.example.com"
path: /health
interval: 10s
timeout: 3s
status: 200
port: 443
---
# Child Cluster 2 (US)
apiVersion: hub.traefik.io/v1alpha1
kind: Uplink
metadata:
name: api-workload
namespace: apps
spec:
exposeName: api-workload-us
healthCheck:
hostname: "api.us.example.com"
path: /health
interval: 10s
timeout: 3s
status: 200
port: 443

When EU cluster becomes unavailable, the parent cluster automatically routes all traffic to the US cluster.

info

Health checks probe the child cluster's uplink endpoint, not the backend service directly. Ensure your uplink endpoint is accessible and responds to health check requests.

Complete Example

This example shows a complete multi-cluster setup with an Uplink:

# traefik.yaml (child cluster)
hub:
uplinkEntryPoints:
multicluster:
address: ":9443"
asDefault: true
http:
tls: {}

providers:
multicluster: {} # Enable multicluster on child to expose API