Headless service endpoints disappear

Cluster information:

Kubernetes version: 1.17.15-gke.800
Cloud being used: GCP
Host OS: Container-optimised OS
CNI and version: Calico 3.8.8
CRI and version: Docker

Running a headless service

apiVersion: v1
kind: Service
metadata:
  name: headless-service
  namespace: mynamespace
spec:
  clusterIP: None
  ports:
    - protocol: TCP
      port: 8001
      targetPort: 8000
---
apiVersion: v1
kind: Endpoints
metadata:
  name: headless-service
  namespace: mynamespace
subsets:
  - addresses:
      - ip: 240.0.0.1
    ports:
      - port: 8001

I notice the endpoint is initially created fine - but approx. once a day is ‘updated’ by the endpoint controller, and the ‘subsets’ are removed, which results in the service becoming inaccessible.

Have been unable to find any information about what could be causing this. Similar issues generally seem to be because of incorrectly including a selector in the service, which is not relevant here. Any information about possible causes, and particularly about how to fix this, would be greatly appreciated. Thanks!

1 Like

@michael1 Hmm…that sounds like it might be a bug - would you mind opening a bug report in the kubernetes/kubernetes repo?

Please add /sig network in the issue body (it’ll add their label to the issue) and it’ll get it on their radar faster :+1:

Did you ever get to the bottom of this because i am seeing the same on GKE

Can you plz help me here. Facing same issue.

If this were a widespread bug it would have been found and fixed.

If you are seeing this, please open a bug on the kubernetes github with all the details and logs. The original report was against 1.17 which is now several years old. If you have somethig that looks like this, please open a NEW bug