Services available in Kubernetes
A Kubernetes service is a logical abstraction for a deployed group of pods in a cluster On the other hand, a service is responsible for exposing an interface to those pods, which enables network access from either within the cluster or between external processes and the service.
types of services offered::
- ClusterIP. Exposes a service which is only accessible from within the cluster.
- NodePort. Exposes a service via a static port on each node’s IP.
- LoadBalancer. Exposes the service via the cloud provider’s load balancer.
- ExternalName. Maps a service to a predefined externalName field by returning a value for the CNAME record.
Use Of Service named Kubernetes in default Namespace::
A Service in Kubernetes is an abstraction which defines a logical set of Pods and a policy by which to access them. Services enable a loose coupling between dependent Pods. A Service is defined using YAML (preferred) or JSON, like all Kubernetes objects.
How services works::
For a service to work, the label selector at the load balancer should match the label selector of the pod so that the endpoint IP can be configured and the services can be accessible accordingly.