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

doc: update develop.md #129

Merged
merged 2 commits into from
Dec 25, 2020
Merged
Changes from 1 commit
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
14 changes: 10 additions & 4 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Tips: The Kubernetes cluster deployment method is recommended for production and

[Install Apache APISIX in Kubernetes](https://github.com/apache/apisix/tree/master/kubernetes)

### 3. httpbin service

Deploy [httpbin](https://github.com/postmanlabs/httpbin) to your Kubernetes cluster and expose it as a Service.

## Configuration

### Configure the `kube config` file locally to facilitate local debugging
Expand Down Expand Up @@ -68,7 +72,7 @@ Tips: The program may print some error logs, indicating that the resource cannot

### Define ApisixRoute

Take the back-end service `httpserver` as an example (you can choose any upstream service for test).
Take the backend service `httpbin` as an example (you can choose any other upstream services for test).

In fact, in order to reduce the trouble caused by ingress migration, we try to keep the structure of ApisixRoute consistent with the original ingress.

Expand All @@ -89,12 +93,14 @@ spec:
http:
paths:
- backend:
serviceName: httpserver
serviceName: httpbin.default.svc.cluster.local
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the port of httpbin container is 80, the port should be change to 80 instead of 8080.
Or we do need a service file to describe the port Mapping.

Copy link
Contributor Author

@tokers tokers Dec 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let me add the service/deployment description in doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed @gxthrj .

servicePort: 8080
path: /hello*
EOF
```

Here we use the FQDN `httpbin.default.svc.cluster.local` as the `serviceName`, and the service port is 8080, change them if your `httpbin` service has different name, namespace or port.

In addition, `ApisixRoute` also continues to support the definition with annotation, you can also define as below.

```yaml
Expand All @@ -115,7 +121,7 @@ spec:
http:
paths:
- backend:
serviceName: httpserver
serviceName: httpbin.default.svc.cluster.local
servicePort: 8080
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

path: /hello*
plugins:
Expand Down Expand Up @@ -165,7 +171,7 @@ kubectl apply -f - <<EOF
apiVersion: apisix.apache.org/v1
kind: ApisixUpstream # apisix upstream
metadata:
name: httpserver # default/httpserver
name: httpbin # default/httpbin
spec:
ports:
- port: 8080
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Expand Down