HUB
Sign inSign up

contiamo/update-node-hosts

By contiamo

•Updated about 9 years ago

An image that can resolve a Kubernetes service within a pod and write it out to the node hosts file.

Image
0

5.9K

contiamo/update-node-hosts repository overview

⁠Update Node Hosts

This container is inspired from the Kubernetes Startup Script container⁠ which allows you to run a script in your nodes PID.

This is useful to things such as updating iptables. This container is specifically designed to resolve the ipaddress of a service and write it out to the node's /etc/hosts. We specifically use it to write the add the name of a cluter hosted Docker registry so that our application can build and push images to a cluster hosted registry and then launch new Kubernetes services from that same registry.

The original Startup Script container does not work in this scenario because when it runs the nslookup it is not run as if in the container and so the ip address it resolves (if any) is not correct. This container is 100% equivalent to running nslookup $SERVICE_NAME in any pod of your cluster and then copying that ip addres to your host node. In general, you most likely don't want to do this in a production environment, but, for a dev environment, it is very helpful.

An example DaemonSet configuration is provided for reference.

Tag summary

Content type

Image

Digest

Size

5.3 MB

Last updated

about 9 years ago

docker pull contiamo/update-node-hosts