The gliderlabs/registrator:master is customized to use IP from environment variables.
670
The registrator auto-registers the docker containerized services to service discovery tools such as consul, etcd, etc. This service auto-registration of docker containerized services is much needed feature for the environments where the docker containers are managed by orchestration tools like kubernetes, etc.
The gliderlabs/registrator:master is customized to accept the pod IP from the environment variables.
The registrator will register the docker containerized services with the service discovery tools by grabbing the container IP address and exposed ports from the docker inspect information (low-level information of docker object). But, the docker containers which are managed by the kubernetes will not show up the container IP address under docker inspect information. In some kubernetes cluster managed environments, the docker containers network information will be offloaded to another container whos reference is given under HostConfig.NetworkMode value.
In GKE (Google Container Engine), the docker containers will not show up container IP address either in the container inspect information or in the offloaded container inspect information.
gliderlabs/registrator?This example information is given based on the consul service discovery perspective.
The POD_IP is the environment variable.
Run the registrator service as shown:
$ registrator -useIpFromEnv=POD_IP consul://<consul-agent-ip>:8500
Add the following k8s spec configuration in each deployment file to register the service:
...
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
...
When the registrator run with the flag -useIpFromEnv=POD_IP, the registrator uses this IP address (the value of POD_IP env) as container IP address and registers with consul agent service.
For more information, you can visit the official gliderlabs/registrator github or docs links.
Content type
Image
Digest
Size
9.4 MB
Last updated
over 9 years ago
docker pull biarca/registrator:v7