-
Notifications
You must be signed in to change notification settings - Fork 2.8k
docs: update "Getting started" guide #6929
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
docs: update "Getting started" guide #6929
Conversation
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>
|
Please ignore the broken images as they are being uploaded with this PR and they should work. |
juzhiyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Others LGTM.
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>
| APISIX provides a powerful [Admin API](./admin-api.md) and [APISIX Dashboard](https://github.com/apache/apisix-dashboard). Here, we will use the Admin API to create a Route and connect it to an [Upstream](./architecture-design/upstream.md) service. When a request arrives, APISIX will forward the request to the specified Upstream service. | ||
|
|
||
| We will create a sample configuration for our Route object so that Apache APISIX can forward the request to the corresponding Upstream service. | ||
| We will configure the Route so that APISIX can forward the request to the corresponding Upstream service: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is our dataplane right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't understand what you meant. I deployed Apache APISIX according to the documentation and I got an error when testing the routes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. :9081 and :9082 are for the Nginx service. My error is from HTTPbin. So if we use the local Nginx service, this error may not occur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, HTTPbin acts as the API the user is trying to expose with APISIX. It is a sample application of sorts. If HTTPbin is unavailable most of the time, we can maybe have it running locally but for me, HTTPbin was working on most cases. // @juzhiyuan @spacewander
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and let's use HTTPbin as upstream service here :)
| ``` | ||
|
|
||
| This request will be forwarded to `http://httpbin.org:80/anything/foo?arg=10` by Apache APISIX. | ||
| This request will be forwarded to `http://httpbin.org:80/anything/foo?arg=10` by APISIX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I will fix the second Route creation step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @navendu-pottekkat, I still can't get the correct response in this step. After adjusting the configuration information the correct return is obtained:
curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
{
"methods": ["GET"],
"host": "example.com",
"uri": "/anything/*",
"upstream": {
"type": "round-robin",
"pass_host": "node",
"nodes": {
"httpbin.org:80": 1
}
}
}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, maybe I made a mistake somewhere.
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>
|
@Baoyuantop @hf400159 I fixed the second Route creation step after abstracting to Upstream. It is working for me as expected. I'm using an M1 Mac. ➜ example git:(master) ✗ curl --location --request GET "http://httpbin.org/get?foo1=bar1&foo2=bar2"
{
"args": {
"foo1": "bar1",
"foo2": "bar2"
},
"headers": {
"Accept": "*/*",
"Host": "httpbin.org",
"User-Agent": "curl/7.79.1",
"X-Amzn-Trace-Id": "Root=1-6268d0d6-59f80a1b02e8b74f2a5f6511"
},
"origin": "117.213.46.176",
"url": "http://httpbin.org/get?foo1=bar1&foo2=bar2"
}
➜ example git:(master) ✗ docker-compose -p docker-apisix -f docker-compose-arm64.yml up -d
Creating network "docker-apisix_apisix" with driver "bridge"
Creating docker-apisix_etcd_1 ... done
Creating docker-apisix_web1_1 ... done
Creating docker-apisix_web2_1 ... done
Creating docker-apisix_apisix-dashboard_1 ... done
Creating docker-apisix_apisix_1 ... done
➜ example git:(master) ✗ curl "http://127.0.0.1:9080/apisix/admin/services/" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
{"action":"get","node":{"key":"\/apisix\/services","nodes":[],"dir":true},"count":0}
➜ example git:(master) ✗ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
{
"methods": ["GET"],
"host": "example.com",
"uri": "/anything/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
{"node":{"key":"\/apisix\/routes\/1","value":{"methods":["GET"],"uri":"\/anything\/*","host":"example.com","upstream":{"scheme":"http","pass_host":"pass","nodes":{"httpbin.org:80":1},"type":"roundrobin","hash_on":"vars"},"priority":0,"update_time":1651036453,"create_time":1651036453,"id":"1","status":1}},"action":"set"}
➜ example git:(master) ✗ curl -i -X GET "http://127.0.0.1:9080/anything/foo?arg=10" -H "Host: example.com"
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 425
Connection: keep-alive
Date: Wed, 27 Apr 2022 05:14:19 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Server: APISIX/2.13.1
{
"args": {
"arg": "10"
},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "example.com",
"User-Agent": "curl/7.79.1",
"X-Amzn-Trace-Id": "Root=1-6268d12b-695b7ba534d740fa278e6013",
"X-Forwarded-Host": "example.com"
},
"json": null,
"method": "GET",
"origin": "172.21.0.1, 117.213.46.176",
"url": "http://example.com/anything/foo?arg=10"
}
➜ example git:(master) ✗ curl "http://127.0.0.1:9080/apisix/admin/upstreams/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
{
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}'
{"node":{"key":"\/apisix\/upstreams\/1","value":{"scheme":"http","pass_host":"pass","nodes":{"httpbin.org:80":1},"update_time":1651036477,"type":"roundrobin","id":"1","create_time":1651036477,"hash_on":"vars"}},"action":"set"}
➜ example git:(master) ✗ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
{
"methods": ["GET"],
"host": "example.com",
"uri": "/anything/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
{"action":"set","node":{"key":"\/apisix\/routes\/1","value":{"methods":["GET"],"uri":"\/anything\/*","host":"example.com","upstream":{"scheme":"http","pass_host":"pass","nodes":{"httpbin.org:80":1},"type":"roundrobin","hash_on":"vars"},"priority":0,"update_time":1651036490,"create_time":1651036453,"id":"1","status":1}}}
➜ example git:(master) ✗ curl -i -X GET "http://127.0.0.1:9080/anything/foo?arg=10" -H "Host: example.com"
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 425
Connection: keep-alive
Date: Wed, 27 Apr 2022 05:15:08 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Server: APISIX/2.13.1
{
"args": {
"arg": "10"
},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "example.com",
"User-Agent": "curl/7.79.1",
"X-Amzn-Trace-Id": "Root=1-6268d15c-365a35046232f6d33facdff3",
"X-Forwarded-Host": "example.com"
},
"json": null,
"method": "GET",
"origin": "172.21.0.1, 117.213.46.176",
"url": "http://example.com/anything/foo?arg=10"
} |
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>
63cd471
juzhiyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| # for more detail. | ||
| # | ||
| --> | ||
| Now, you can use `docker-compose` to start APISIX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing APISIX using docker-compose will install both Grafana and Prometheus and Nginx and APISIX Dashboard, should we tell users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, you installed with RPM?
Or docker-compose file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The consensus was that we will update the docker-compose files to match.
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>
Signed-off-by: Navendu Pottekkat <navendupottekkat@gmail.com>











Signed-off-by: Navendu Pottekkat navendupottekkat@gmail.com
Description
Updates the "Getting started" guide to be easier for a new user.