<p>In kubernetes, is it somehow possible to &quot;assign&quot; multiple headless services to single statefulset, or achieve behaviour describe below some other way?</p>
<p>Use-case:
We've got statefulset, let's call it: set. It has 3 pod, and headless service called set-headless.
It is possible to access pods, using following dns names:</p>
<pre><code>set-0.set-headless.namespace.svc.cluster.local
set-1.set-headless.namespace.svc.cluster.local
set-2.set-headless.namespace.svc.cluster.local
</code></pre>
<p>For some reasons, we would like to change this endpoints, to i.e. contain some more information in headless service name - set-uswest1-headles.
To accomplish this change without downtime, it would be perfect, to have two headless services running at the same time, so pods could be accessible by following dns names:</p>
<pre><code>set-0.set-headless.namespace.svc.cluster.local
set-1.set-headless.namespace.svc.cluster.local
set-2.set-headless.namespace.svc.cluster.local
set-0.set-uswest1-headless.namespace.svc.cluster.local
set-1.set-uswest1-headless.namespace.svc.cluster.local
set-2.set-uswest1-headless.namespace.svc.cluster.local
</code></pre>
<p>Is it possible at all? Can this be achieved some other way (not using headless servic</p>

user1223183
<p>Yes, it all depends on the labels applied to each statefulSet/Pod that will add that pod to the headless service endpoints.</p>
<p>You can have one headless service to route to all the pods, and 1 for each set of different set of pods</p>
<p>EDIT: For your use case, in order to not have downtime, its important that both of the headless services has the same labels.</p>
<p>Also, its important to remember that headless services are for pods in the same statefulset to communicate with each other and services are used for pods to be reached from other services. So in case you need the pods to be reached by other services/ingress you need the same labels applied to both services and satefulsets for no downtime.</p>
<p>Or you could explain what kind of service is this and i can help you with specific actions for that kind of service</p>
