Headless Service: Endpoint's IP and PORT info is lost after 24 Hrs

I have created a headless service, accessing an application thru Kubernetes load balancer. It works after appling yml configurations. However, after 24Hrs, endpoints info is lost.

Cluster information:

Kubernetes version:
Cloud being used: Digital Ocean

$  kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:“1”, Minor:“25”, GitVersion:“v1.25.3”, GitCommit:“434bfd82814af038ad94d62ebe59b133fcb50506”, GitTreeState:“clean”, BuildDate:“2022-10-12T10:47:25Z”, GoVersion:“go1.19.2”, Compiler:“gc”, Platform:“darwin/arm64”}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:“1”, Minor:“24”, GitVersion:“v1.24.8”, GitCommit:“fdc77503e954d1ee641c0e350481f7528e8d068b”, GitTreeState:“clean”, BuildDate:“2022-11-09T13:31:40Z”, GoVersion:“go1.18.8”, Compiler:“gc”, Platform:“linux/amd64”}

apiVersion: v1
kind: Service
metadata:
name: headless-srv
namespace: staging
annotations:
konghq.com/protocol: “http”
spec:
clusterIP: None
selector:
app: headless-srv
ports:

  • name: http
    port: 8081
    targetPort: 8081
    protocol: TCP

kind: Endpoints
apiVersion: v1
metadata:
name: headless-srv
namespace: staging
subsets:

  • addresses:
    • ip: 68.222.222.222
      ports:
    • port: 8081
      name: http
      protocol: TCP

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: headless-srv-ingress
namespace: staging
annotations:
kubernetes.io/tls-acme: “true”
cert-manager.io/cluster-issuer: letsencrypt-prod
plugins.konghq.com: apidocs-rewrite
spec:
ingressClassName: kong
tls:
- secretName: headless.srv.neelam.one
hosts:
- headless.srv.neelam.one
rules:
- host: headless.srv.neelam.one
http:
paths:
- backend:
service:
name: headless-srv
port:
number: 8081
path: /
pathType: ImplementationSpecific

There is no pod for the service nd endpoint. IP address nd port configured belongs to a standalone server outside k8s cluster

Your service includes a selector, which tells the endpoints controller to look for matching pods and populate the Endpoints and EndpointSlice resources. Remove the selector and you can manage Endpoints yourself.