Home

Awesome

Annon Infrastructure

Infrastructure helpers for Annon API Gateway:

  1. Sample Docker Compose files and one-click-install bash script.

    curl -L http://bit.ly/annon_compose | bash

    After Annon is started, open http://localhost:8080/apis for Management UI, http://localhost:4000/ for public API and http://localhost:4001/ for management API.

  2. Kubernetes config examples.

Environment Variables

This environment variables can be used to configure released docker container at start time. Also sample .env can be used as payload for docker run cli.

General

VAR_NAMEDefault ValueDescription
LOG_LEVELinfoElixir Logger severity level. Possible values: debug, info, warn, error.
PROTECTED_HEADERSx-consumer-id,x-consumer-scope,x-consumer-token,x-consumer-token-idComma-separated list of headers which are ignored when received from API consumers.

Monitoring

StatsD Metrics Collection

VAR_NAMEDefault ValueDescription
METRICS_COLLECTOR_ENABLEDtrueEnables or disables sending of metrics to the StatsD server.
METRICS_COLLECTOR_SEND_TAGStrueSet to fails it StatsD server does not support metrics tags.
METRICS_COLLECTOR_HOSTlocalhostHost of a StatsD server.
METRICS_COLLECTOR_PORT32768Port of a StatsD server.
METRICS_COLLECTOR_NAMESPACEannonName prefix for metrics.
METRICS_COLLECTOR_SAMPLE_RATE0.25Metrics sample rate.

Clustering

VAR_NAMEDefault ValueDescription
ERLANG_COOKIE03/yHifHIEl..Erlang [distribution cookie](http://erlang.org/doc/reference_manual/
LISTEN_DIST_MIN10000Start of Erlang's port range to connect between nodes.
LISTEN_DIST_MAX10100End of Erlang's port range to connect between nodes.
POD_IP127.0.0.1Node IP address. (Should be correct for clustering to work.)
SKYCLUSTER_STRATEGYCluster.Strategy.EpmdWhich strategy to use?
SKYCLUSTER_KUBERNETES_SELECTORapp=annon,component=apiHow to select gateway pods in kubernetes
SKYCLUSTER_NODE_NAMEannon_apiOTP application name.

HTTP Endpoints

VAR_NAMEDefault ValueDescription
GATEWAY_PUBLIC_PORT4000This is a public port that will may be available to the Internet.
GATEWAY_PRIVATE_PORT4002This is a port used for management API, must be protected by a firewall.
GATEWAY_MANAGEMENT_PORT4001This is a port that can be used by cluster services to communicate with each-other, must be protected by a firewall.

Database

You can set individual DB connection options that will apply for both configurations and requests connections:

VAR_NAMEDefault ValueDescription
DB_NAMEannonDatabase name.
DB_USERpostgresDatabase user.
DB_PASSWORDpostgresDatabase password.
DB_HOSTtravisDatabase host.
DB_PORT5432Database port.
DB_MIGRATEtrueMigrate database when container starts.

Our you can set separately via DB connection URLs:

VAR_NAMEDefault ValueDescription
CONFIGURATION_DATABASE_URLnot setURL with configurations DB connection settings, example: postgres://postgres:postgres@travis:5432/annon.
REQUESTS_DATABASE_URL    not set    URL with requests DB connection settings, example: postgres://postgres:postgres@travis:5432/annon.