Skip to main content

Version: latest

Deploy for High Availability

Deploying API7 Gateway for high availability (HA) eliminates single points of failure in both the control plane (CP) and data plane (DP). This guide covers the prerequisites, architecture, and step-by-step instructions for deploying a production-grade HA setup.

For a conceptual overview, see High Availability.

This page explains how to deploy an HA topology. After the deployment is in place, use the configure-and-manage guides for ongoing operations:

Architecture Overview

A high-availability deployment consists of:

  • Multiple CP nodes (Dashboard + DP Manager) sharing a PostgreSQL database, fronted by a load balancer.
  • Multiple DP nodes in one or more Gateway Groups, fronted by a load balancer.
  • (Optional) A backup gateway node that periodically exports configuration to external storage (AWS S3 or Azure Blob Storage) for data plane resilience during CP outages.

Prerequisites

Minimum Hosts

ComponentMinimum NodesNotes
Control Plane2Each runs Dashboard + DP Manager
Data Plane2Each runs API7 Gateway
PostgreSQLManaged or HA clusterHA configuration is out of scope; see PostgreSQL HA

Hardware Requirements

ComponentCPUMemoryDisk
Control Plane4 Cores8 GB40 GB
Data Plane4 Cores8 GB20 GB

For detailed requirements, see System Requirements.

Network Ports

Ensure the following ports are accessible between components:

ServicePortProtocolDescription
Dashboard7080 / 7443HTTP / HTTPSDashboard UI and Admin API
DP Manager7900 / 7943HTTP / HTTPSData plane management
Gateway (HTTP)9080HTTPAPI traffic
Gateway (HTTPS)9443HTTPSAPI traffic
Gateway Status7085HTTPHealth check endpoint
PostgreSQL5432TCPDatabase
Prometheus9090HTTPMetrics (optional)

Control Plane HA

The API7 Dashboard and DP Manager are stateless applications that store all configuration in PostgreSQL. Deploy multiple instances behind a load balancer for HA.

Scale the control plane by setting replica counts in your Helm values:

values.yaml
dashboard:
replicaCount: 2
dp_manager:
replicaCount: 2

postgresql:
builtin: false

dashboard_configuration:
database:
dsn: "postgres://api7ee:$DB_PASSWORD@your-pg-ha-endpoint:5432/api7ee"

dp_manager_configuration:
database:
dsn: "postgres://api7ee:$DB_PASSWORD@your-pg-ha-endpoint:5432/api7ee"

❶ Deploy at least 2 Dashboard replicas for redundancy.
❷ Deploy at least 2 DP Manager replicas.
❸ Disable the built-in PostgreSQL and point to your external HA PostgreSQL cluster.

Install or upgrade the Helm release:

helm upgrade --install api7ee3 api7/api7ee3 -f values.yaml -n api7 --create-namespace
tip

All Dashboard and DP Manager instances must connect to the same PostgreSQL database. PostgreSQL HA (primary-replica, Patroni, or managed services like Amazon RDS, Azure Database, or Google Cloud SQL) is a separate concern and should be configured according to your database provider's documentation.

Data Plane HA

Data plane nodes are stateless — they receive configuration from the control plane and process traffic independently. Deploy multiple nodes behind a load balancer.

Health Check Configuration

Each gateway node exposes a status endpoint for health monitoring:

EndpointMethodDescription
/statusGETReturns 200 if the gateway is running
/status/readyGETReturns 200 if the gateway is ready to accept traffic

The status endpoint listens on port 7085 by default. Configure your load balancer to perform health checks against this endpoint at regular intervals (for example, every 10–30 seconds).

Deploy Multiple DP Nodes

Scale data plane replicas using the gateway Helm chart:

gateway-values.yaml
replicaCount: 3

# Pod disruption budget for rolling updates
podDisruptionBudget:
enabled: true
minAvailable: 1

# Anti-affinity to spread pods across nodes
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- api7-gateway
topologyKey: kubernetes.io/hostname

For details on health checks and resilience behavior, see Data Plane High Availability.

Data Plane Resilience (Fallback CP)

For environments that require the data plane to survive extended control plane outages, configure Fallback CP. This feature periodically exports all gateway configuration to external storage (AWS S3 or Azure Blob Storage), enabling data plane nodes to fetch configuration from storage when the control plane is unreachable.

For detailed setup instructions, see Data Plane Resilience.

Verification

After deploying the HA setup, verify each component:

  1. Control Plane: Access the Dashboard through the load balancer URL. Confirm that both instances are serving requests by checking access logs on each node.

  2. Data Plane: Send a test request through the DP load balancer:

    curl -i "http://<dp-load-balancer>:9080/"
  3. Health Checks: Verify the status endpoint on each DP node:

    curl -i "http://<dp-node>:7085/status"
    # Expected: HTTP/1.1 200 OK
  4. Failover Test: Stop one CP node and verify the Dashboard remains accessible through the load balancer. Stop one DP node and verify API traffic continues to flow through the remaining nodes.

Next Steps

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation