Skip to main content

Configuring Azure Application Gateway (L7)

This guide describes how to configure a third-party Layer 7 (L7) load balancer for the Adeptia Rancher Package deployed on a three-node RKE2 high-availability (HA) cluster.

The load balancer handles all inbound HTTPS traffic and distributes requests across healthy cluster nodes. Each node runs Envoy Gateway as a DaemonSet, exposing HTTPS traffic on port 443.

Traffic flows as follows:

User --> DNS --> Load Balancer Virtual IP (VIP) --> HTTPS (Port 443) --> Backend Pool (RKE2 Node IPs) --> Envoy Gateway (Port 443 on each node) --> Rancher / Application Services

Prerequisites​

Before configuring the load balancer, ensure the following requirements are met.

ItemDescription
Load BalancerAny Layer 7 load balancer capable of HTTPS termination and health probing
Virtual IP (VIP)A static IP address assigned to the load balancer and accessible by end users.
Backend NodesLinux VMs for RKE2 cluster
TLS CertificateWildcard or SAN certificate covering all required hostnames
DNS RecordsHostnames such as rancher.mycompany.org and rancher-ac.mycompany.org
Firewall AccessHTTPS connectivity from the load balancer to all cluster nodes on port 443

Network Requirements​

Ensure that the load balancer can establish HTTPS connections to every cluster node.

The following ports must be allowed between the load balancer and the RKE2 nodes:

SourceDestinationPortProtocol
Load BalancerAll RKE2 Nodes443TCP
Load BalancerAll RKE2 NodesHealth Probe Port (if different)TCP
WarningUse the private IP addresses of the Rancher nodes. Do not use public IP addresses.

Backend Pool Configuration​

Create a backend pool containing all RKE2 nodes.

Example:

NodeIP Address
Node 110.32.4.6
Node 210.32.4.7
Node 310.32.4.10

All nodes should participate in load balancing.

Health Probe Configuration​

Configure an HTTPS health probe with the following settings:

SettingValue
ProtocolHTTPS
Path/healthz
Port443
Interval30 seconds
Timeout30 seconds
Healthy Response Codes200–399
WarningThe /healthz endpoint is provided by Envoy Gateway and returns HTTP 200 even when no application workloads are running. This ensures reliable node health monitoring.

Backend Service Settings​

Configure the backend service with the following recommended settings:

SettingValue
ProtocolHTTPS
Backend Port443
Session PersistenceEnabled (recommended)
Connection Draining30 seconds
Request Timeout300 seconds
Health Probe/healthz
WarningDo not reduce the request timeout below 60 seconds. Rancher operations may require longer-running API requests.

TLS Certificate Configuration​

Upload and assign a TLS certificate to the load balancer listener.

Example:

*.mycompany.org

The certificate should cover all required hostnames, including:

rancher.mycompany.org rancher-ac.mycompany.org

HTTP Header Configuration​

Configure the load balancer to forward the following header to backend services:

X-Forwarded-Proto: https
WarningRancher relies on this header to identify the original client protocol. Failure to forward this header may result in redirect loops or incorrect URL generation.

Listener Configuration​

Create HTTPS listeners for each hostname.

HostnamePortProtocol
rancher.mycompany.org443HTTPS
rancher-ac.mycompany.org443HTTPS

If multiple hostnames share the same VIP and port, configure Server Name Indication (SNI) support on the load balancer.

DNS Configuration​

Create DNS records that point to the load balancer VIP.

HostnameTypeValue
rancher.mycompany.orgALoad Balancer VIP
rancher-ac.mycompany.orgALoad Balancer VIP

Validation​

Verify node health directly:

Code

curl -sk -o /dev/null -w '%{http_code}' https://<IP address of VM1>/healthz
curl -sk -o /dev/null -w '%{http_code}' https://<IP address of VM2>/healthz
curl -sk -o /dev/null -w '%{http_code}' https://<IP address of VM3>/healthz

Expected response: 200

Verify access through the load balancer:

Code

curl -sk -o /dev/null -w '%{http_code}' https://rancher-ac.mycompany.org/healthz
curl -sk -o /dev/null -w '%{http_code}' https://rancher.mycompany.org/healthz

Expected response: 200

Verify Rancher UI access:

Code

curl -sk -o /dev/null -w '%{http_code}' https://rancher-ac.mycompany.org

Expected response: 200 or 302

Finally, open the following URL in a browser:

https://rancher-ac.mycompany.org

The Rancher login page should load successfully. This configuration is vendor-neutral and can be used for Kemp, AGW or any other enterprise load balancer.