In this Kubernetes tip, you will learn about deleting a service in Kubernetes.

What is a Kubernetes Service?

Services enable communication between various components within and outside of the application. Kubernetes services helps you connect applications together with other applications or users. It provides a stable virtual IP (VIP) address. By using a service IP, clients can reliably connect to the containers running inside the pods.

For example, your application has groups of pods running for various sections such as a group for serving front end load to users and other group for running back end processes and a third group connecting to an external data source.

It is services that enable connectivity between these groups of pods. You can have as many services as required within the cluster.

Why do we use Service?

Kubernetes Pods are unreliable and non-permanent resources because they get created and destroyed to match the state of your cluster. When you  create a Kubernetes Deployment to run your app, it can create and destroy Pods dynamically.

Every pod has  its own IP address and that might change at a later point in time because that pod might get destroy and a new might come up.

This leads to a problem: if some set of Pods (call them “backends”) provides functionality to other Pods (call them “frontends”) inside your cluster, how do the frontends find out and keep track of which IP address to connect to, so that the frontend can use the backend part of the workload?

That is the reason Kubernetes architects came up with a solution which is known as Service.

#kubernetes #docker

How to Delete a Service in Kubernetes
13.90 GEEK