Hello,
I have an nginx pod running in my cluster, and tried to expose it via the combination of an EndpointSlice object and a service without a selector.
First, I created a service without a selector by:
kubectl create svc clusterip nginx --tcp 80:80
Then. I created an EndpointSlice manually based on the snippet from
with a single endpoint address, that of the nginx pod running in my cluster.
I used the label ‘kubernetes.io/service-name: nginx’ as suggested in the docs.
I was expecting for K8s to associate the service with the EndpointSlice object, however that didn’t happen. The service has no endpoints, and after creating the service a new EndpointSlice object with a random suffix in its name, no ports and no endpoints is automatically created.
If someone has tried and succeeded in exposing a set of pods via a manually created EndpointSlice with the pod IP addresses, I would appreciate your feedback and help on how to make this work.
Thanks in advance.