how to use consul as a default dns or service discovery in kubernetes

8/20/2018
  • make Consul as default Service Discovery with Glider labs registrator.
  • registrator is for registering all services in k8s cluster
-- Godasi Satish
kubernetes

1 Answer

8/20/2018

First thing that comes to mind is : WHY?!?

Regardless, there is no "default service discovery" in kubernetes. Kubernetes has API where everything is created/registered/updated. That you can not take away unless you simply stop using Kubertnetes. You can run sidecar container for every pod though and use it to register to Consul service additionally. No idea why you would, but you can. Some software can follow similar pattern for it's own clustering coordination via separate instance where all it's instances register to.

If you rely on service IPs and DNS, and want to switch that to different service discovery, you can obviously select different DNS service IP then (Kube/Core)DNS and use ie. Consuls, but again, I see no reasonable use case for that.

-- Radek 'Goblin' Pieczonka
Source: StackOverflow