I'm running Kubernetes on CoreOS on Google Compute Engine, and I'd like to access etcd from a container to enable dynamic configuration using confd. Is there any way for a container in a Pod to know the Kubernetes master's IP address?
You can inject environment variables into your pod through the pod definition. Once you create your cluster, note the internal IP address of your master and set it as an environment variable in your container. Note that the variables ${KUBERNETES_SERVICE_HOST} and ${KUBERNETES_SERVICE_PORT} are defined automatically but that the former refers to the service address (e.g. 10.0.0.1) of the master rather than the GCE internal address.