Code Monkey home page Code Monkey logo

docker-kong-service's Introduction

Kong as a Docker Service

Docker Repository on Quay

This an extension of the official Docker image for Kong, with support to for Rancher, Kubernetes, or Tutum/Docker Cloud.

Justifications

The official docker-kong image allows for:

1. linking `Cassandra` or `Postgres` database containers
2. connecting to external databases via custom `kong.yml` config file by replacing the `/etc/kong/` volume.

However when using Rancher or Kubernetes, containers are organised into Services deployed across multiple machine node clusters. Therefore it's not feasible to mount custom config files into volumes on each machine which are spun up and down on demand. See related question here

By configuring Cassandra and Postgres purely using Environment Variables, it is a lot easier to point to an external RDS or InstaClustr instance.

Supported tags and respective Dockerfile links

How to use this image

Existing docker-kong usages still applies. The following extra Environment Variables are added:

Kong Environment Variables:

Env Var Default Description
DATABASE cassandra either cassandra or postgres as per official image
CLUSTER_LISTEN 0.0.0.0:7946 host ip and port. When rancher is specified, the Rancher Meta Data Service to work out the correct container ip address for cluster_listen. Other platforms can be extended quite easily.

Example:

If using Rancher:

$ docker run -d --name kong
    -e "CLUSTER_LISTEN=rancher" \
    --link kong-database:kong-database \
    -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 7946:7946 -p 7946:7946/udp \
    littlebaydigital/kong

If using a custom IP:

$ docker run -d --name kong
    -e "CLUSTER_LISTEN=52.5.149.55:7946" \
    --link kong-database:kong-database \
    -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 7946:7946 -p 7946:7946/udp \
    littlebaydigital/kong

Cassandra Environment Variables:

Env Var Default Description
CASSANDRA_CONTACT_POINTS kong-database:9046 Optional. Defaults to linked container alias. Specify custom values in the format of \"ip1:9046\",\"ip2:9046\"
CASSANDRA_KEYSPACE kong Optional
CASSANDRA_USER kong Optional
CASSANDRA_PASSWORD kong Optional

Example:

$ docker run -d --name kong \
    -e "DATABASE=cassandra" \
    -e "CASSANDRA_CONTACT_POINTS=\"52.5.149.55:9042\",\"52.5.149.56:9042\"" \
    -e "CASSANDRA_KEYSPACE=kong" \
    -e "CASSANDRA_USER=cassandra" \
    -e "CASSANDRA_PASSWORD=cassandra" \
    -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 7946:7946 -p 7946:7946/udp \
    --security-opt seccomp:unconfined \
    littlebaydigital/kong

Postgres Environment Variables:

Env Var Default Description
POSTGRES_HOST kong-database Optional. Defaults to linked container alias
POSTGRES_PORT 5432 Optional.
POSTGRES_DATABASE kong Optional.
POSTGRES_USER kong Optional.
POSTGRES_PASSWORD kong Optional.

Example:

$ docker run -d --name kong \
    -e "DATABASE=cassandra" \
    -e POSTGRES_HOST=127.0.0.1 \
    -e POSTGRES_PORT=5432 \
    -e POSTGRES_DB=kong \
    -e POSTGRES_USER=kong \
    -e POSTGRES_PASSWORD=kong \
    -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 7946:7946 -p 7946:7946/udp \
    --security-opt seccomp:unconfined \
    littlebaydigital/kong

docker-kong-service's People

Contributors

subnetmarco avatar thibaultcha avatar nijikokun avatar pierrekircher avatar mschurenko avatar ankon avatar pklingem avatar

Stargazers

Daniel Hoelbling-Inzko avatar

Watchers

Peter V avatar James Cloos avatar Steve Fanale avatar  avatar Rachel Mashayekhi avatar Drive Yello Tech avatar Peter Vahaviolos avatar

Forkers

ravi-sharma

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.