Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
ddragosd committed Jul 15, 2018
1 parent 91b6905 commit 99b899b
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions README.md
Expand Up @@ -20,8 +20,19 @@ The current project is considered production ready.
Quick start
===========

## Standalone

```bash
$ docker run --name="apigateway" \
-p 80:80 \
-e "LOG_LEVEL=info" \
adobeapiplatform/apigateway:latest
```
docker run --name="apigateway" \

## With Apache Mesos

```bash
$ docker run --name="apigateway" \
-p 80:80 \
-e "MARATHON_HOST=http://<marathon_host>:<port>" \
-e "LOG_LEVEL=info" \
Expand Down Expand Up @@ -67,7 +78,7 @@ docker run --name="apigateway" \
```

`s3://api-gateway-config-bucket` should contain something similar to what's in the [api-gateway-config](https://github.com/adobe-apiplatform/apigateway/blob/master/api-gateway-config/) folder.
For any customizations it would be good to start from there.
For any customization it would be good to start from there.
There are only 2 files that won't be synchronised:
* `/etc/api-gateway/conf.d/includes/resolvers.conf` . Read bellow for more info
* `https://github.com/adobe-apiplatform/apigateway/blob/master/api-gateway-config/environment.conf.d/api-gateway-upstreams.http.conf` which is automatically generated by the Marathon Discovery script.
Expand All @@ -83,12 +94,16 @@ docker run --name="apigateway" \
-e "LOG_LEVEL=info" \
adobeapiplatform/apigateway:latest
```
By default the remote config is checked for changes every `10s` and it's configurable through the `REMOTE_CONFIG_SYNC_INTERVAL` env variable.
By default the remote config is checked for changes every `10s`. This interval is configurable through the `REMOTE_CONFIG_SYNC_INTERVAL` env variable.
There are a few things to take into consideration when changing this value:
* How often the configs really change
* Cost. Some tools may make 1 API request per file to compare it. I.e. in S3 72 config files checked every `10s` costs `$7.46` but when checked every `30s` it's only `$2.4`, times number of GW nodes.
* Average time for an API Request. When reloading the GW the existing NGINX processes handling active connections are kept in the background until the request completes. So reloading the Gateway too fast may have the side effect of keeping too many processes running at the same time. This may, or may not be a problem but it's good to be aware of it.

#### Customizing the sync command

The sync command used for downloading the configuration files can be controlled via `REMOTE_CONFIG_SYNC_CMD` as well. This ENV VAR overrides the `REMOTE_CONFIG` one.

#### Resolvers
While starting up this container automatically creates the `/etc/api-gateway/conf.d/includes/resolvers.conf` config file using `/etc/resolv.conf` as the source.
To learn more about the `resolver` directive in NGINX see the [docs](http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver).
Expand All @@ -102,8 +117,8 @@ What's inside

| Module | Version | Details |
|--------------|------------|--------------|
| [Openresty](https://github.com/openresty/) | 1.9.7.3 | Installed in `/usr/local/sbin/api-gateway` |
| [Openresty](https://github.com/openresty/) compiled `--with-debug` | 1.9.7.3 | Installed in `/usr/local/sbin/api-gateway-debug` which enables [debugging log](http://nginx.org/en/docs/debugging_log.html) |
| [Openresty](https://github.com/openresty/) | 1.13.6.1 | Installed in `/usr/local/sbin/api-gateway` |
| [Openresty](https://github.com/openresty/) compiled `--with-debug` | 1.13.6.1 | Installed in `/usr/local/sbin/api-gateway-debug` which enables [debugging log](http://nginx.org/en/docs/debugging_log.html) |
| [Test Nginx](https://github.com/openresty/test-nginx) | [0.24](https://github.com/openresty/test-nginx/releases/tag/v0.24) | Useful for executing integration tests from the container. <br/> It's installed in `/usr/local/test-nginx-0.24/`. <br/> It's also used during Docker build to execute `make test` on lua modules. |
| [PCRE](https://sourceforge.net/projects/pcre/) | [8.37](https://sourceforge.net/projects/pcre/files/pcre/8.37/) | Enables PCRE JIT support |
| [ZeroMQ](http://download.zeromq.org/) | [4.0.5](http://zeromq.org/area:download) | ZeroMQ |
Expand Down

0 comments on commit 99b899b

Please sign in to comment.