Deploying Apache APISIX as a Kubernetes Ingress Controller with Helm
This article introduces Apache APISIX, a high‑performance API gateway built on OpenResty and etcd, explains its architecture, demonstrates how to install it as a Kubernetes Ingress controller using Helm charts, and shows configuration, routing, and dashboard usage with example manifests and commands.
Apache APISIX is a dynamic, real‑time, high‑performance API gateway based on OpenResty and etcd, offering features such as load balancing, dynamic routing, A/B testing, rate limiting, circuit breaking, authentication, monitoring, and service observability for both north‑south and east‑west traffic.
Compared with traditional API gateways, APISIX provides dynamic routing and hot‑loaded plugins, supports multiple protocols (HTTP/HTTPS, HTTP2, Dubbo, QUIC, MQTT, TCP/UDP), includes a built‑in Dashboard, and allows custom plugin development.
The architecture separates the data plane (handling client requests) and the control plane (managing routes via etcd). The control plane watches etcd for route and upstream changes, while the data plane processes traffic accordingly.
APISIX Ingress
APISIX can serve as a Kubernetes Ingress controller. The controller component manages configuration and distributes it, while the APISIX proxy handles business traffic. Users apply custom CRD resources with kubectl apply , and the controller watches these resources to update APISIX via its admin API.
APISIX Ingress adopts a split data‑plane/control‑plane architecture, allowing flexible deployment of the data plane inside or outside the Kubernetes cluster, unlike Ingress Nginx which couples both planes in a single pod.
Key features of the APISIX Ingress controller include:
Fully dynamic routing with advanced match rules and support for over 50 built‑in plugins and custom plugins.
CRD support for declarative configuration.
Compatibility with native Ingress resources.
Traffic splitting.
Automatic service registration and discovery.
Flexible load‑balancing strategies with health checks.
Support for gRPC and TCP layer‑4 proxying.
Installation
Install APISIX in a Kubernetes cluster using the official Helm chart. First, add the chart repository:
➜ helm repo add apisix https://charts.apiseven.com
➜ helm repo updateFetch and extract the chart, then create a custom values file (e.g., apisix/ci/prod.yaml ) to enable the Ingress controller and configure components:
# ci/prod.yaml
apisix:
enabled: true
nodeSelector: # fixed to node2
kubernetes.io/hostname: node2
gateway:
type: NodePort
externalTrafficPolicy: Cluster
http:
enabled: true
servicePort: 80
containerPort: 9080
etcd:
enabled: true # creates a 3‑node etcd cluster by default
replicaCount: 1
dashboard:
enabled: true
ingress-controller:
enabled: true
config:
apisix:
serviceName: apisix-admin
serviceNamespace: apisixNote: The official Helm chart’s etcd multi‑node support may require template adjustments; for testing, a single‑node etcd cluster is used.
If a default StorageClass is not present, install an NFS provisioner to provide one:
➜ helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
➜ helm upgrade --install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
--set nfs.server=192.168.31.31 \
--set nfs.path=/var/lib/k8s/data \
--set image.repository=cnych/nfs-subdir-external-provisioner \
--set storageClass.defaultClass=true -n kube-systemAfter the StorageClass is created, install APISIX with the custom values:
➜ helm upgrade --install apisix ./apisix -f ./apisix/ci/prod.yaml -n apisixThe deployment should show running pods and services for APISIX, its dashboard, etcd, and the ingress controller.
Testing
Create an ApisixRoute resource to expose the dashboard:
apiVersion: apisix.apache.org/v2beta2
kind: ApisixRoute
metadata:
name: dashboard
namespace: apisix
spec:
http:
- name: root
match:
hosts:
- apisix.qikqiak.com
paths:
- "/*"
backends:
- serviceName: apisix-dashboard
servicePort: 80The ingress controller translates this CRD into APISIX configuration, which can be verified with:
➜ kubectl get apisixroute -n apisixAccess the dashboard via the APISIX gateway NodePort (default credentials: admin/admin). The dashboard UI displays the created route and its upstream service, demonstrating how APISIX maps Kubernetes Endpoints to upstreams and handles load balancing.
The APISIX dashboard also allows configuring plugins, traffic splitting, authentication, and other advanced features directly from the UI, and supports both CRD‑based and native Ingress resources.
DevOps Cloud Academy
Exploring industry DevOps practices and technical expertise.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.