<p>My application is running in Kubernetes pods and I would like to use <a href="https://github.com/golang/groupcache" rel="nofollow noreferrer">golang/groupcache</a> to distribute key/value entities amongst instances of the app.</p>

<p>The groupcache library in each of my app instances is required to know the connection details (IP &amp; port) of all the other app instances so it can distribute the key/value entities as it sees fit. How can I let groupcache know the connection details of the other running instances of my application? Would it be preferable/possible to use the Kubernetes <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">Go Client Library</a>?</p>

<p>Go Client Library is one of the options. Another (more simple) option is to setup a <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="nofollow noreferrer">headless service</a> for groupcache, so with a single DNS lookup you can get all IP addresses of all groupcache pods.</p>
