Member-only story
If you are already familiar with Kubernetes then you must be aware that pod IPs are unreliable. When Pods fail, they get replaced with new Pods that have new IPs. Scaling up a Deployment introduces new Pods with new IP addresses. Scaling down a Deployment removes Pods. This creates a large amount of IP churn and makes the Pod IPs unreliable.
Services are the answer to this, where it provides a stable IP address, its own stable DNS name, and its own stable port. With this you get a reliable endpoint to connect to which further can load balance your request to the pods further where your actual application lives.
Theory
The figure below shows a simple Pod-based application deployed via a Kubernetes Deployment. It shows a client (which could be another component of the app) that does not have a reliable network endpoint for accessing the Pods. Remember: it’s a bad idea to talk directly to an individual Pod because that Pod could disappear at any point via scaling operations, updates and rollbacks, and failures.
The next figure shows the same application with a Service added into the mix. The Service is associated with the Pods and fronts them…