Set SKYDNS_NAMESERVERS without writing RC

10/4/2016

I would like to add additional name servers to kube-dns in the kube-system namespace (solution provided here: https://stackoverflow.com/a/34085756/2461761), however doing this in an automated manner.

So I know I can create my own dns addon via https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns and launch it in the system's namespace, however, I am trying to provide a simple script to developers to spin up their own clusters with DNS resolution built in and don't want them to concern with the system namespace.

Is there a way to modify/set the SKYDNS_NAMESERVERS environment variable without having to making a copy of the replication controller?

Or even set it via a command and re-launch the pods of the kube-dns deployment?

Thank you in advance.

-- Tony
dns
google-kubernetes-engine
kube-dns
kubernetes
skydns

1 Answer

10/4/2016

I still think that "adding SKYDNS_NAMESERVERS to the manifest file" solution is a good choice.

Suppose the developers still need to spin up the cluster, it would be better to set up the upstream DNS servers ahead through the manifest file instead of changing them on the fly. Or is there any requirement that need this to be done after the cluster is up?

If this has to be done while everything is running, one way to do so is to modify the manifest file locates on the master node. For current version kubernetes(1.4), you will also need to modify the ReplicationController name to a new one and the Addon Manager will then update the resources for you. But notice that there would be kube-dns outage(probably seconds) in between because current Addon Manager executes the update in the delete->create manner.

-- MrHohn
Source: StackOverflow