Giter Site home page Giter Site logo

mvanholsteijn / docker-service-registrator-kong Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 3.0 100 KB

A docker service registrator for the Kong API Gateway

License: Apache License 2.0

Shell 18.60% Makefile 12.56% Python 68.85%
registrator kong sync automatic upstream targets docker

docker-service-registrator-kong's Introduction

Docker service registrator for Kong

Manages the upstream target registration in Kong for Docker containers running on this host.

When a container is started, the registrator will create a upstream target for each exposed port of a container which has a matching SERVICE_<exposed-port>_NAME environment variable. If the container exposes a single port, it is sufficient to have a SERVICE_NAME environment variable.

In addition, if the container has an environment variable named KONG_<exposed_port>_API, containing a json string with a Kong API definition it is registered too. If the name and the upstream_url are missing, it will set using the SERVICE_NAME value. If the container exposes a single port, it is sufficient to have a KONG_API variable.

The registrator has three commands: remove-all, sync and daemon.

Daemon mode

When the registrator starts in daemon mode it will first do a full sync, to ensure that the upstream targets are actually reflecting docker instances running on this host.

After that, it will process Docker container start and die events to update the upstreams.

Sync

You can run a standalone sync command to ensure that the upstream targets are actually reflecting docker instances running on this host.

Remove all

When the host is shutdown, it is wise to run the remove-all command to upstream targets pointing to this host.

remove-all  - remove all upstream targets pointing to this host, but run on host shutdown
sync        - synchronise the upstream targets with the running containers 
daemon      - continuously update the upstream targets by subscribing to the Docker event stream

you must specify, either the dns name or the Route53 hosted zone id:

  --dns-name TEXT        to append to the service name to create an upstream name, defaults to '.docker.internal'
  --admin_url TEXT       pointing to the Kong admin API, defaults to http://localhost:8001
  --hostname HOSTNAME    to use in targets.

docker-service-registrator-kong's People

Contributors

mvanholsteijn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.