|
| 1 | +--- |
| 2 | +title: Getting started |
| 3 | +keywords: |
| 4 | + - APISIX ingress |
| 5 | + - Apache APISIX |
| 6 | + - Kubernetes ingress |
| 7 | +description: Guide to get started with Apache APISIX ingress controller. |
| 8 | +--- |
| 9 | +<!-- |
| 10 | +# |
| 11 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 12 | +# contributor license agreements. See the NOTICE file distributed with |
| 13 | +# this work for additional information regarding copyright ownership. |
| 14 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 15 | +# (the "License"); you may not use this file except in compliance with |
| 16 | +# the License. You may obtain a copy of the License at |
| 17 | +# |
| 18 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 19 | +# |
| 20 | +# Unless required by applicable law or agreed to in writing, software |
| 21 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 22 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 23 | +# See the License for the specific language governing permissions and |
| 24 | +# limitations under the License. |
| 25 | +# |
| 26 | +--> |
| 27 | + |
| 28 | +import Tabs from '@theme/Tabs'; |
| 29 | +import TabItem from '@theme/TabItem'; |
| 30 | + |
| 31 | +APISIX Ingress Controller is a [Kubernetes ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) using [Apache APISIX](https://apisix.apache.org) as the high performance reverse proxy. |
| 32 | + |
| 33 | +APISIX Ingress Controller can be configured using the native Kubernetes Ingress or Gateway API, as well as with APISIX’s own declarative and easy-to-use custom resources. The controller translates these resources into APISIX configuration. |
| 34 | + |
| 35 | +## Quick Start |
| 36 | + |
| 37 | +Get started with APISIX Ingress Controller in a few simple steps. |
| 38 | + |
| 39 | +### Prerequisites |
| 40 | + |
| 41 | +Before installing APISIX Ingress Controller, ensure you have: |
| 42 | + |
| 43 | +1. A working Kubernetes cluster (version 1.26+) |
| 44 | +2. [Helm](https://helm.sh/) (version 3.8+) installed |
| 45 | + |
| 46 | +### Install APISIX and APISIX Ingress Controller |
| 47 | + |
| 48 | +Install the Gateway API CRDs, APISIX, and APISIX Ingress Controller using the following commands: |
| 49 | + |
| 50 | +```bash |
| 51 | +helm repo add apisix https://charts.apiseven.com |
| 52 | +helm repo add bitnami https://charts.bitnami.com/bitnami |
| 53 | +helm repo update |
| 54 | + |
| 55 | +helm install apisix \ |
| 56 | + --namespace ingress-apisix \ |
| 57 | + --create-namespace \ |
| 58 | + --set ingress-controller.enabled=true \ |
| 59 | + --set ingress-controller.apisix.adminService.namespace=ingress-apisix \ |
| 60 | + --set ingress-controller.gatewayProxy.createDefault=true \ |
| 61 | + apisix/apisix |
| 62 | +``` |
| 63 | + |
| 64 | +### Set Up a Sample Upstream |
| 65 | + |
| 66 | +Install the httpbin example application to test the configuration: |
| 67 | + |
| 68 | +```bash |
| 69 | +https://raw.githubusercontent.com/apache/apisix-ingress-controller/refs/heads/v2.0.0/examples/httpbin/deployment.yaml |
| 70 | +``` |
| 71 | + |
| 72 | +### Configure a Route |
| 73 | + |
| 74 | +Install an ApisixRoute or Ingress resource to route traffic to httpbin: |
| 75 | + |
| 76 | +> The examples below show how these differ. Both the examples configure a Route in APISIX that routes to an httpbin service as the Upstream. |
| 77 | +
|
| 78 | +<Tabs |
| 79 | +groupId="resources" |
| 80 | +defaultValue="apisix" |
| 81 | +values={[ |
| 82 | +{label: 'APISIX Ingress CRD', value: 'apisix'}, |
| 83 | +{label: 'Kubernetes Ingress API', value: 'ingress'}, |
| 84 | +]}> |
| 85 | + |
| 86 | +<TabItem value="apisix"> |
| 87 | + |
| 88 | +```yaml title="httpbin-route.yaml" |
| 89 | +apiVersion: apisix.apache.org/v2 |
| 90 | +kind: ApisixRoute |
| 91 | +metadata: |
| 92 | + name: httpbin-route |
| 93 | +spec: |
| 94 | + ingressClassName: apisix |
| 95 | + http: |
| 96 | + - name: route-1 |
| 97 | + match: |
| 98 | + hosts: |
| 99 | + - local.httpbin.org |
| 100 | + paths: |
| 101 | + - /* |
| 102 | + backends: |
| 103 | + - serviceName: httpbin |
| 104 | + servicePort: 80 |
| 105 | +``` |
| 106 | +
|
| 107 | +</TabItem> |
| 108 | +
|
| 109 | +<TabItem value="ingress"> |
| 110 | +
|
| 111 | +```yaml title="httpbin-route.yaml" |
| 112 | +apiVersion: networking.k8s.io/v1 |
| 113 | +kind: Ingress |
| 114 | +metadata: |
| 115 | + name: httpbin-route |
| 116 | +spec: |
| 117 | + ingressClassName: apisix |
| 118 | + rules: |
| 119 | + - host: local.httpbin.org |
| 120 | + http: |
| 121 | + paths: |
| 122 | + - backend: |
| 123 | + service: |
| 124 | + name: httpbin |
| 125 | + port: |
| 126 | + number: 80 |
| 127 | + path: / |
| 128 | + pathType: Prefix |
| 129 | +``` |
| 130 | +
|
| 131 | +</TabItem> |
| 132 | +</Tabs> |
| 133 | +
|
| 134 | +:::note |
| 135 | +
|
| 136 | +More details on the installation can be found in the [Installation guide](./install.md). |
| 137 | +
|
| 138 | +::: |
| 139 | +
|
| 140 | +### Verify Route Configuration |
| 141 | +
|
| 142 | +Let's verify the configuration. In order to access APISIX locally, we can use `kubectl port-forward` command to forward traffic from the specified port at your local machine to the specified port on the specified service. |
| 143 | + |
| 144 | +```bash |
| 145 | +kubectl port-forward -n ingress-apisix svc/apisix-gateway 9080:80 |
| 146 | +``` |
| 147 | + |
| 148 | +Run curl command in a APISIX pod to see if the routing configuration works. |
| 149 | + |
| 150 | +```bash |
| 151 | +curl http://127.0.0.1:9080/headers -H 'Host: local.httpbin.org' |
| 152 | +``` |
| 153 | + |
| 154 | +## Features |
| 155 | + |
| 156 | +To summarize, APISIX ingress controller has the following features: |
| 157 | + |
| 158 | +- Declarative configuration with CRDs. |
| 159 | +- Supports native Kubernetes Ingress v1 and Gateway API. |
| 160 | +- Supports service discovery through Kubernetes Service. |
| 161 | +- Supports load balancing based on pods (Upstream nodes). |
| 162 | +- Rich [Plugins](https://apisix.apache.org/docs/apisix/next/plugins/batch-requests/) with [custom Plugin](https://apisix.apache.org/docs/apisix/next/plugin-develop/) support. |
| 163 | + |
| 164 | +## Get involved |
| 165 | + |
| 166 | +You can contribute to the development of APISIX ingress controller. See [Development guide](./developer-guide.md) for instructions on setting up the project locally. |
| 167 | + |
| 168 | +See the [Contribute to APISIX](https://apisix.apache.org/docs/general/contributor-guide/) section for details on the contributing flow. |
| 169 | + |
| 170 | +## Compatibility with APISIX |
| 171 | + |
| 172 | +The table below shows the compatibility between APISIX ingress controller and the APISIX proxy. |
| 173 | + |
| 174 | +:::note |
| 175 | + |
| 176 | +APISIX Ingress Controller 2.0.0+ support the [APISIX Standalone API-driven Mode](https://apisix.apache.org/docs/apisix/deployment-modes/#api-driven-experimental), but require APISIX 3.13+. |
| 177 | + |
| 178 | +::: |
| 179 | + |
| 180 | +| APISIX ingress controller | Supported APISIX versions | Recommended APISIX version | |
| 181 | +| ------------------------- | ------------------------- | -------------------------- | |
| 182 | +| `master` | `>=3.0` | `3.13` | |
| 183 | +| `2.0.0` | `>=3.0` | `3.13` | |
| 184 | +| `1.6.0` | `>= 2.15`, `>=3.0` | `2.15`, `3.0` | |
| 185 | +| `1.5.0` | `>= 2.7` | `2.15` | |
| 186 | +| `1.4.0` | `>= 2.7` | `2.11` | |
| 187 | +| `1.3.0` | `>= 2.7` | `2.10` | |
| 188 | +| `1.2.0` | `>= 2.7` | `2.8` | |
| 189 | +| `1.1.0` | `>= 2.7` | `2.7` | |
| 190 | +| `1.1.0` | `>= 2.7` | `2.7` | |
| 191 | +| `1.0.0` | `>= 2.7` | `2.7` | |
| 192 | +| `0.6` | `>= 2.6` | `2.6` | |
| 193 | +| `0.5` | `>= 2.4` | `2.5` | |
| 194 | +| `0.4` | `>= 2.4` | | |
0 commit comments