Kubernetes 101 : Endpoints, services and pods
There is an endpoint for each pod that has a label that matches the service label selector.
Endpoints are a group of IP addresses and ports that a service forwards its requests to.
Endpoint get the IP address and the port number a pod is listening on.
Endpoint get the IP address and the port number a pod is listening on.
For each endpoint the kube-proxy creates a iptables rule with the IP address of pod.
The kube-proxy is the process that allows communication with a pod that lives inside a node.
Remark:
Kubernetes uses the pod selector mentioned in the service Yaml file to create the endpoints that correspond to these selectors.
Endpoints are "decoupled" from services, so they can also be created manually.
Endpoints are "decoupled" from services, so they can also be created manually.
Below is the Yaml configuration file of the endpoints:
The name of the endpoints needs to match the name of the service "service_1" in our example below:
Displaying endpoints:
We could display the endpoint in the kubernetes cluster using the below command:
Comments