Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ingress-apisix version of deploy image tag and document #1968

Merged
merged 6 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 41 additions & 9 deletions docs/en/latest/composite.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ title: Composite Architecture
#
-->

**Please note that this is a preview feature**
:::note

**This feature is experimental**

:::

## Background

Expand Down Expand Up @@ -49,10 +53,30 @@ Since apisix strongly relies on the etcd API, the control-plane will simulate th

## Installation

Save the APISIX Ingress version to an environment variable to be used next:

```bash
APISIX_INGRESS_VERSION="1.7.0"
```

Clone the APISIX Ingress source code of this version into a new directory apisix-APISIX_VERSION:

```bash
git clone --depth 1 --branch v${APISIX_INGRESS_VERSION} https://github.com/apache/apisix-ingress-controller.git ingress-apisix-${APISIX_INGRESS_VERSION}
```

Install the CRDs and ingress-apisix:

```bash
cd ingress-apisix-${APISIX_INGRESS_VERSION}
# install CRDs
kubectl apply -k samples/deploy/crd/v1
# install ingress-apisix
kubectl apply -f samples/deploy/composite.yaml
```

```shell
$ kubectl apply -f samples/deploy/composite.yaml
# install ingress-apisix output
namespace/ingress-apisix created
clusterrole.rbac.authorization.k8s.io/apisix-view-clusterrole created
serviceaccount/apisix-view-serviceaccount created
Expand All @@ -65,11 +89,15 @@ service/ingress-apisix-gateway created
Check the pod status to confirm successful installation:

```shell
$ kubectl get service -n ingress-apisix # check service
kubectl get service -n ingress-apisix # check service
kubectl get pods -n ingress-apisix # check pod
```

```shell
# service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-apisix-gateway NodePort 10.99.236.58 <none> 80:31143/TCP,443:30166/TCP 90s

$ kubectl get pods -n ingress-apisix # check pod
# pod
NAME READY STATUS RESTARTS AGE
ingress-apisix-composite-deployment-5df9bc99c7-xxpvq 2/2 Running 0 100s
```
Expand All @@ -82,12 +110,16 @@ Install the ApisixRoute and httpbin app:
kubectl apply -f samples/httpbin/httpbin-route.yaml
```

After forwarding the local port 9080 to the service port 80, send a request:
After forwarding the local port 9080 to the `ingress-apisix-gateway` service port 80, send a request:

```shell
$ kubectl port-forward service/ingress-apisix-gateway 9080:80 -n ingress-apisix &
```bash
# forward local port 9080 to ingress-apisix-gateway service port 80
kubectl port-forward service/ingress-apisix-gateway 9080:80 -n ingress-apisix &
# send a request
curl http://127.0.0.1:9080/headers -H 'Host: httpbin.org'
```

$ curl http://127.0.0.1:9080/headers -H 'Host: httpbin.org'
```shell
{
"headers": {
"Accept": "*/*",
Expand Down
94 changes: 51 additions & 43 deletions samples/deploy/composite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ metadata:
name: ingress-apisix

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -136,7 +135,7 @@ rules:
- ingresses/status
- networkpolicies
verbs:
- '*'
- "*"
- apiGroups:
- metrics.k8s.io
resources:
Expand All @@ -163,13 +162,13 @@ rules:
- apisixglobalrules
- apisixglobalrules/status
verbs:
- '*'
- "*"
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'
- "*"
- apiGroups:
- discovery.k8s.io
resources:
Expand Down Expand Up @@ -202,15 +201,13 @@ rules:
- list

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: apisix-view-serviceaccount
namespace: ingress-apisix

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -224,9 +221,7 @@ subjects:
name: apisix-view-serviceaccount
namespace: ingress-apisix


---

apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -352,7 +347,6 @@ data:
enable_export_server: false

---

apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -374,32 +368,48 @@ spec:
name: apisix-gw-config.yaml
defaultMode: 420
containers:
- name: ingress-apisix
image: apache/apisix-ingress-controller:dev
- livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 15
timeoutSeconds: 2
periodSeconds: 2
successThreshold: 1
failureThreshold: 3
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 10
timeoutSeconds: 2
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
name: ingress-apisix
image: apache/apisix-ingress-controller:1.7.0
command:
- /ingress-apisix/apisix-ingress-controller
- ingress
- '--log-output'
- "--log-output"
- stdout
- '--apisix-resource-sync-interval'
- "--apisix-resource-sync-interval"
- 1h
- '--apisix-resource-sync-comparison=true'
- '--http-listen'
- ':8080'
- '--https-listen'
- ':8443'
- '--default-apisix-cluster-name'
- "--apisix-resource-sync-comparison=true"
- "--http-listen"
- ":8080"
- "--https-listen"
- ":8443"
- "--default-apisix-cluster-name"
- default
- '--default-apisix-cluster-base-url'
- "--default-apisix-cluster-base-url"
- http://127.0.0.1:9180/apisix/admin
- '--default-apisix-cluster-admin-key'
- "--default-apisix-cluster-admin-key"
- edd1c9f034335f136f87ad84b625c8f1
- '--api-version'
- "--api-version"
- apisix.apache.org/v2
- '--ingress-status-address'
- ''
- '--disable-status-updates=false'
- '--etcd-server-enabled=true'
- "--ingress-status-address"
- ""
- "--disable-status-updates=false"
- "--etcd-server-enabled=true"
ports:
- name: http
containerPort: 8080
Expand All @@ -422,26 +432,26 @@ spec:
apiVersion: v1
fieldPath: metadata.name
resources: {}
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 2
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
- livenessProbe:
failureThreshold: 3
initialDelaySeconds: 20
periodSeconds: 2
successThreshold: 1
failureThreshold: 3
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
port: 9080
timeoutSeconds: 2
periodSeconds: 10
successThreshold: 1
readinessProbe:
failureThreshold: 3
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
- name: apisix
initialDelaySeconds: 15
periodSeconds: 2
successThreshold: 1
tcpSocket:
port: 9080
timeoutSeconds: 1
name: apisix
image: apache/apisix:3.2.2-centos
ports:
- name: http
Expand Down Expand Up @@ -473,9 +483,7 @@ spec:
revisionHistoryLimit: 10
progressDeadlineSeconds: 600


---

apiVersion: v1
kind: Service
metadata:
Expand Down