Skip to content

Commit

Permalink
plain-http-upstream is configured with external 3scale backend
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Sep 13, 2024
1 parent fddfd07 commit 9520001
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
8 changes: 7 additions & 1 deletion dev-environments/plain-http-upstream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ Running custom apicast image
make gateway IMAGE_NAME=quay.io/3scale/apicast:latest
```

Traffic between the proxy and upstream can be inspected looking at logs from `example.com` service
Traffic between apicast and upstream can be inspected looking at logs from `example.com` service

```
docker compose -p plain-http-upstream logs -f example.com
```

Traffic between apicast and backend can be inspected looking at logs from `backend` service

```
docker compose -p plain-http-upstream logs -f backend
```

## Testing

`GET` request
Expand Down
4 changes: 2 additions & 2 deletions dev-environments/plain-http-upstream/apicast-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"hosts": ["get.example.com"],
"api_backend": "http://example.com/get",
"backend": {
"endpoint": "http://127.0.0.1:8081",
"endpoint": "http://backend:80",
"host": "backend"
},
"policy_chain": [
Expand All @@ -34,7 +34,7 @@
"hosts": ["post.example.com"],
"api_backend": "http://example.com/post",
"backend": {
"endpoint": "http://127.0.0.1:8081",
"endpoint": "http://backend:80",
"host": "backend"
},
"policy_chain": [
Expand Down
20 changes: 18 additions & 2 deletions dev-environments/plain-http-upstream/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,27 @@ services:
example.com:
image: alpine/socat:1.7.4.4
container_name: example.com
command: "-d -v -d TCP-LISTEN:80,reuseaddr,fork TCP:two.upstream:80"
command: "-d -d -v -d TCP-LISTEN:80,reuseaddr,fork TCP:two.upstream:3000"
expose:
- "80"
restart: unless-stopped
two.upstream:
image: kennethreitz/httpbin
image: quay.io/3scale/authorino:echo-api
environment:
PORT: 3000
expose:
- "3000"
backend:
image: alpine/socat:1.7.4.4
container_name: backend
command: "-d -d -v -d TCP-LISTEN:80,reuseaddr,fork TCP:3scale.backend:3000"
expose:
- "80"
restart: unless-stopped
3scale.backend:
image: quay.io/3scale/authorino:echo-api
container_name: 3scale.backend
environment:
PORT: 3000
expose:
- "3000"

0 comments on commit 9520001

Please sign in to comment.