Skip to content

Commit

Permalink
Merge pull request #1495 from 3scale/dev-environment-with-backend
Browse files Browse the repository at this point in the history
plain-http-upstream is configured with external 3scale backend
  • Loading branch information
eguzki authored Sep 19, 2024
2 parents fddfd07 + cac87e1 commit 5fd93e1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev-environments/camel-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Camel PROXY

Development environment to test integration between APIcast and proxies built
on top of [Camel framework](https://camel.apache.org/components/4.0.x/netty-http-component.html)
on top of [Camel framework](https://camel.apache.org/components/4.8.x/netty-component.html)

This dev environment uses [Camel Netty Proxy example](https://github.com/zregvart/camel-netty-proxy).
Any request that is received using the HTTP PROXY protocol,
Expand Down
17 changes: 16 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 All @@ -43,3 +49,12 @@ curl --resolve post.example.com:8080:127.0.0.1 -v -X POST "http://post.example.c
```sh
make clean
```

## Echo API

Using EchoAPI `quay.io/kuadrant/authorino-examples:talker-api` docker image.

Based on Ruby's [rack](https://github.com/rack/rack) / [rackup](https://github.com/rack/rackup/blob/main/lib/rackup.rb)
HTTP server framework uses [WebRick](https://github.com/ruby/webrick) server engine.

Github: https://github.com/Kuadrant/authorino-examples/tree/main/talker-api
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/kuadrant/authorino-examples:talker-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/kuadrant/authorino-examples:talker-api
container_name: 3scale.backend
environment:
PORT: 3000
expose:
- "3000"

0 comments on commit 5fd93e1

Please sign in to comment.