Should we run a Consul container in every Pod?

We run our stack on Google Virtual Platform (host Kubernetes, GKE) and the Consul cluster runs outside of K8s (regular GCE instances).

Several services running in K8s use Consul, mainly for it CP K / V Store and extended blocking, not so much for service discovery so far.

We recently ran into some issues using the Consul service discovery from K8s . Right now our apps talk directly to Consul servers with register and unregister services .

This is not recommended for best practice, usually Consul clients (like applications using Consul) should talk to Consul agent ... There are no local Consul agents in our setup.

My question . Should we run local Consul agents as container containers in each container?

IMHO this would be a huge waste of resources, but it would best match the Consul's successes.

I tried googling but all the posts about Consul and Kubernete are talking about running Consul in K8, which I don't want to do.

+3


source to share


1 answer


I don't understand what you mean because of opening the Consul service from K8s, but we also have services available in a VM based environment that is opened by Consul, which must be accessed by multiple containers.



If you mean accessing services available to consuls from K8s containers, we accomplished that by making our internal Kubernetes DNS redirect the zone consul

to Consul servers. Thus, we do not make the Consul agent as a buddy for each container.

0


source







All Articles