Introduction of services in Kubernetes

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

What is a Service?

Services in Kubernetes nothing but load balancer. It is load balancer for POD. It enables a group of pods, which provide specific functions (web services, image processing, etc.) to be assigned a name and unique IP address (clusterIP).

What is the types Services?

  1. ClusterIP. Exposes a service which is only accessible from within the cluster.
  2. NodePort. Exposes a service via a static port on each nodeā€™s IP.
  3. LoadBalancer. Exposes the service via the cloud providerā€™s load balancer.
  4. .ExternalName. Maps a service to a predefined external Name field by returning a value for the CNAME record.

What is the use of service named with ā€œkubernetesā€ in default namespace?

The kubernetes service in the default namespace is a service which forwards requests to the Kubernete API server. All the requests to the kubernetes default service from the cluster will be routed to the configured Endpoint IP.

How services works?

A Kubernetes service is a logical abstraction for a deployed group of pods in a cluster (which all perform the same function). Since pods are ephemeral, a service enables a group of pods, which provide specific functions (web services, image processing, etc.) to be assigned a name and unique IP address (clusterIP).