0

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.

Community
  • 1
  • 1
Tony
  • 1,128
  • 12
  • 23

1 Answers1

1

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
  • 1,136
  • 1
  • 8
  • 4
  • This won't work for GKE because: - The kube-system namespace is brought up automatically when a cluster is created. - I would really like to not have to manage my own manifest file (sync-ing it for every update) for every cluster. - Cluster ownership is independent for each team. - The master is not accessible. – Tony Jan 23 '17 at 18:10
  • 1
    Hey Tony, your last reply is totally right. kube-dns now supports adding upstream domains natively, you may find this blog post useful: http://blog.kubernetes.io/2017/04/configuring-private-dns-zones-upstream-nameservers-kubernetes.html. – MrHohn Jun 12 '17 at 23:36