I am new to Kubernetes and started reading through the documentation. There often the term \'endpoint\' is used but the documentation lacks an explicit definition.
What
An endpoint is an object that gets IP addresses of individual pods assigned to it. The endpoint object is then in turn referenced by a kubernetes service, so that the service has a record of the internal IPs of pods in order to be able to communicate with them. We need endpoints as an abstraction layer because the 'service' in kubernetes acts as part of the orchestration to ensure distribution of traffic to pods (including only sending traffic to healthy pods). For example if a pod dies, a replacement pod will be generated, with a new IP address. Conceptually, the dead pod IP will be removed from the endpoint object, and the IP of the newly created pod will be added, so that the service is updated and 'knows' which pods to connect to.
Read 'Exposing pods to the cluster', then 'Creating a Service' here - https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#exposing-pods-to-the-cluster
An easy way to investigate and see the relationship is:
kubectl get pods
- and observe the IP addresses of your podskubectl get ep
- and observe the IP addresses assigned to your endpointkubectl describe service myServiceName
- and observe the Endpoints
associated with your serviceSo no, the endpoint isn't anything to do with the IP of an individual node. I find it useful to understand the overall structure of kubernetes and the relationship between the cluster, nodes, services, endpoints and pods. This diagram summarises it nicely: