etcd-service-registrar

command module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2014 License: MIT Imports: 4 Imported by: 0

README

etcd service registrar

An opinionated command line tool, implemented in Go, to register a service host a port in a local etcd instance which runs into a Docker container.

Description

An opinionated command line tool, implemented in Go, to register a service host a port in a local etcd instance which runs into a Docker container.

The local etcd instance must run into a docker container, which must expose the etcd client default port 4001 in all the network interfaces, IP 0.0.0.0, therefore it is accessible under the IP 172.17.42.1 (default docker daemon IP).

The tool is bound to the data structure used by etcd container presence used to register the hosts and ports exposed by services, which may be Docker containers but it is not a must, as this tool has been backed to allows to publish the services running in your local machine to give the ability to other services which depend of them to run and access them meanwhile you are working (fixing/refactoring/implementing) on them.

How to use

The binary has the classical brief help about the arguments that it must and may been provided, showed when -h, or it is extended version --help, argument is used.

You can download it from here.

However you can also take a look them there:

   --container, -c      The container name or id [REQUIRE]
   --ip, -i '127.0.0.1' The ip or name of the host where the service is running
   --port, -p           The original port of the service [REQUIRED]
   --mapped-port, --mp  The real port which the service is listening; by default port
   --ttl '0'            The time to live for the registration
   --delete-all, --da   Remove all the entries for this container on etcd; 
                        when used only --container is required and used
   --help, -h           show help
   --version, -v        print the version

Compile me

To compile it, you must have gom installed and working; then you are ready to compile it, just executing make.

Why we implemented it

We implemented it to have a simple command line tool that allows us to register services in etcd obeying the same data structures use by etcd container presence without the constraint to run the services into Docker containers but in a host machine (the most of the times localhost), which it is a requirement during the development cycle, whenever we must run different services, which some depend of others.

Therefore the tool allows us to remove the hassle to create different configurations between development and testing/production environments, which it is appreciated because we remove the differences between them and we are less prone to introduce issues which would be detected, hopefully, in CI testing than production.

License

Just MIT, Copyright (c) 2014 DreamItGetIT, read LICENSE file for more information.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL