azure-api-management-gateway
A Helm chart to deploy the self-hosted gateway of Azure API Management on Kubernetes
About this chart
Azure API Management Gateway
Self-hosted Azure API Management gateway allows you to run Azure API Management gateway anywhere - Any cloud, hybrid or on-premises.
TL;DR
We are using Helm v3.
helm repo add azure-apim-gateway https://azure.github.io/api-management-self-hosted-gateway/helm-charts/
helm repo update
helm install --name azure-api-management-gateway azure-apim-gateway/azure-api-management-gateway \
--set gateway.configuration.uri='<gateway-url>' \
--set gateway.auth.key='<gateway-key>'
Introduction
This chart bootstraps an Azure API Management gateway deployment on a Kubernetes cluster using the Helm package manager.
Prerequisites
- Azure Subscription
- Azure API Management instance
- A provisioned self-hosted gateway resource.
- Endpoint & authentication information required for deployment. See the
Deploymentsection of the created gateway resource in Azure Portal.
- Helm 3
- Kubernetes nodes running Linux on AMD64 (
amd64) or ARM64 (arm64). ARM64 requires gateway image version 2.13.0 or later.
Usage
Add the Repo
To add the chart repository:
helm repo add azure-apim-gateway https://azure.github.io/api-management-self-hosted-gateway/helm-charts/
Update your Helm chart repos:
helm repo update
Installing the Chart
To install the chart with the release name azure-api-management-gateway:
Entra ID (Workload Identity):
helm install --name azure-api-management-gateway azure-apim-gateway/azure-api-management-gateway \
--set gateway.name=='<gateway-name>' \
--set gateway.configuration.uri='<gateway-url>' \
--set gateway.auth.type='WorkloadIdentity' \
--set gateway.auth.azureAd.app.id='<entra-id-app-id>'
Entra ID (Client Secret/Certificate):
helm install --name azure-api-management-gateway azure-apim-gateway/azure-api-management-gateway \
--set gateway.name=='<gateway-name>' \
--set gateway.configuration.uri='<gateway-url>' \
--set gateway.auth.type='AzureAdApp' \
--set gateway.auth.azureAd.tenant.id='<entra-id-tenant-id>' \
--set gateway.auth.azureAd.app.id='<entra-id-app-id>'
--set config.service.auth.azureAd.clientSecret='<entra-id-secret>' \
Gateway token authentication:
helm install --name azure-api-management-gateway azure-apim-gateway/azure-api-management-gateway \
--set gateway.configuration.uri='<gateway-url>' \
--set gateway.auth.key='<gateway-key>'
The command deploys the Azure API Management gateway on the Kubernetes cluster.
Uninstall the Chart
To uninstall the azure-api-management-gateway deployment:
helm delete azure-api-management-gateway
The command removes all the Kubernetes components associated with the chart and deletes the release.
Common Scenarios
ARM64 and Mixed-Architecture Clusters
Gateway image version 2.13.0 supports both Linux AMD64 and ARM64 using the same image tag. Kubernetes automatically pulls the image matching the node architecture; no architecture-specific image repository or tag is required.
By default, the chart does not restrict the node architecture. With gateway image version 2.13.0 or later, gateway pods can run on either architecture in a mixed-architecture cluster. To select an ARM64-capable image and deploy only to ARM64 nodes, use:
image:
tag: "2.13.0"
nodeSelector:
kubernetes.io/os: linux
kubernetes.io/arch: arm64
Use kubernetes.io/arch: amd64 to target AMD64 nodes instead. When overriding image.tag, ensure the selected image supports the target node architecture; gateway versions earlier than 2.13.0 do not support ARM64.
Gateway Token Authentication
gateway:
configuration:
uri: "https://my-gateway.configuration.azure-api.net"
auth:
key: "GatewayKey ey..."
Microsoft Entra ID (formerly Azure AD) Authentication - Workload Identity
gateway:
name: "my-gateway"
configuration:
uri: "https://my-gateway.configuration.azure-api.net"
auth:
type: "WorkloadIdentity"
azureAd:
app:
id: "00000000-0000-0000-0000-000000000000"
Microsoft Entra ID (formerly Azure AD) Authentication - Client Certificate
gateway:
name: "my-gateway"
configuration:
uri: "https://my-gateway.configuration.azure-api.net"
auth:
type: "AzureAdApp"
azureAd:
tenant:
id: "00000000-0000-0000-0000-000000000000"
app:
id: "00000000-0000-0000-0000-000000000000"
# Client certificate should be provided via secret
Configuration
The following sections list the configurable parameters of the self-hosted Azure API Management gateway chart organized by category.
- Gateway Configuration
- High Availability
- Observability
- Security
- Networking
- Dapr
- Advanced Configuration
Gateway Configuration
Connection and authentication settings for the Azure API Management gateway.
| Parameter | Type | Default | Description |
|---|---|---|---|
gateway.auth.azureAd.app.id | string | nil | Required for AzureAdApp and WorkloadIdentity auth. Client ID (application ID) of the Azure AD app registered for gateway authentication. Find this in Azure Portal under App registrations. |
gateway.auth.azureAd.app.secret | string | nil | Required for AzureAdApp auth (client secret). Client secret of the Azure AD app. Not used with WorkloadIdentity. Not used when an existing secret is configured. |
gateway.auth.azureAd.authority | string | nil | Azure AD authority URL. Defaults to public Azure AD if not specified. Example: https://login.microsoftonline.com/<tenant-id>. |
gateway.auth.azureAd.tenant.id | string | nil | Required for AzureAdApp auth. Azure AD tenant ID (GUID). Find this in Azure Portal under Azure Active Directory → Properties. |
gateway.auth.key | string | nil | Required for GatewayToken auth. Authentication token from Azure API Management gateway resource. Starts with GatewayKey. Find this in the Azure Portal under the gateway's Deployment section. Not used when an existing secret is configured. |
gateway.auth.type | string | "GatewayToken" | Type of authentication to use for Azure API Management's Configuration API. Options: GatewayToken (use gateway.auth.key), AzureAdApp (use client secret/certificate), or WorkloadIdentity (use managed identity). |
gateway.configuration.additional | object | {} | Advanced: Specify additional gateway configuration settings not yet supported by the Helm chart. See Azure API Management self-hosted gateway configuration. |
gateway.configuration.backup.enabled | bool | false | Enable storing a backup copy of the latest downloaded gateway configuration on a persistent volume. This allows the gateway to start with last-known configuration if it cannot reach Azure API Management. |
gateway.configuration.backup.persistentVolumeClaim.accessMode | string | "ReadWriteMany" | Access mode for the Persistent Volume Claim (PVC). Use ReadWriteMany for multi-replica deployments, ReadWriteOnce for single replica. |
gateway.configuration.backup.persistentVolumeClaim.create | bool | true | Create a new Persistent Volume Claim (PVC) for configuration backup with the settings specified below. |
gateway.configuration.backup.persistentVolumeClaim.existingName | string | "" | Use an existing Persistent Volume Claim (PVC) for configuration backup instead of creating one. Requires *.persistentVolumeClaim.create to be false. |
gateway.configuration.backup.persistentVolumeClaim.size | string | "50Mi" | Size of the Persistent Volume Claim (PVC) for configuration backup. |
gateway.configuration.backup.persistentVolumeClaim.storageClassName | string | nil | Storage class name for the Persistent Volume Claim (PVC). null uses the cluster default storage class, "" means no storage class will be set. |
gateway.configuration.uri | string | nil | Required. Configuration endpoint URL from your Azure API Management gateway resource. Find this in the Azure Portal under the gateway's Deployment section. Format: https://<gateway-name>.configuration.azure-api.net. |
gateway.deployment.dns.hostAliases | object | {} | Add custom host aliases to /etc/hosts in the gateway pod (useful for custom configuration endpoints). Check the values.yaml for format details. |
gateway.deployment.network.proxy.bypass | string | nil | Comma-separated list of addresses/domains to bypass when using an HTTP(S) network proxy. Example: localhost,127.0.0.1,.svc.cluster.local. |
gateway.deployment.network.proxy.http | string | nil | HTTP network proxy address for outbound HTTP requests to backend services (egress). Format: http://proxy.example.com:8080. |
gateway.deployment.network.proxy.https | string | nil | HTTPS network proxy address for outbound HTTPS requests to backend services (egress). Format: http://proxy.example.com:8080. |
gateway.deployment.strategy | object | {} | Deployment strategy to use for replacing old pods. May be Recreate (stop all old pods before creating new ones) or RollingUpdate (default, gradually replace pods). |
gateway.deployment.terminationGracePeriodSeconds | int | 60 | Maximum time in seconds the Pod may spend in the Terminating phase during shutdown. The gateway uses this time to gracefully complete ongoing requests. Learn more about the termination of Pods. |
gateway.name | string | nil | Name of the gateway resource in Azure API Management. This is required when using Azure AD authentication (WorkloadIdentity or AzureAdApp). Find this in the Azure Portal under your API Management instance. |
High Availability
Settings for deployment resilience.
| Parameter | Type | Default | Description |
|---|---|---|---|
highAvailability.disruption.maximumUnavailable | string | "25%" | Maximum percentage or number of pods that can be unavailable during voluntary disruptions like node drains or deployments. Example: 25% or 1. |
highAvailability.enabled | bool | true | Deploy the gateway with high availability features enabled. When true, distributes pods across availability zones and prevents voluntary disruptions. Recommended for production deployments. |
highAvailability.podTopologySpread.whenUnsatisfiable | string | "ScheduleAnyway" | How to handle pod scheduling when topology spread constraints cannot be met. ScheduleAnyway allows scheduling even if constraints are not met (preferred), DoNotSchedule prevents scheduling. Learn more in the Kubernetes docs. |
Observability
Monitoring, logging, and telemetry configuration.
| Parameter | Type | Default | Description |
|---|---|---|---|
observability.azureMonitor.metrics.enabled | bool | true | Enable sending metrics to Azure Monitor. This allows you to monitor gateway performance in Azure Portal. Learn more in our documentation. |
observability.logs.local.journal.endpoint | string | nil | Endpoint to send logs to with journal protocol. Learn more in our documentation. |
observability.logs.local.json.endpoint | string | "127.0.0.1:8888" | UDP endpoint that accepts JSON data. This can be a file path, IP:port, or hostname:port convention. Learn more in our documentation. |
observability.logs.local.localsyslog.endpoint | string | nil | Endpoint to send logs to with localsyslog protocol. Learn more in our documentation. |
observability.logs.local.localsyslog.facility | string | nil | Facility code as per localsyslog, for example 7. Learn more in our documentation. |
observability.logs.local.rfc5424.endpoint | string | nil | Endpoint to send logs to with rfc5424 protocol. Learn more in [our documentation](https://docs.microsoft.com/azure/api-management/how-t |
Deploy azure-api-management-gateway with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has azure-api-management-gateway 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 chartazure-api-management-gateway is pinned at v1.17.2 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