Selfnotes-Services

What is a Service?

A service is a logical abstraction for a deployed group of pods in a cluster (which all perform the same function).

What is the types Services?

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.

What is the use of service named with “kubernetes” in default namespace?

all the requests to the kubernetes.default service from the cluster will be routed to the configured Endpoint IP

How services works?

A service is assigned an IP address (“cluster IP”), which the service proxies use.
A service can map an incoming port to any targetPort. (By default, the targetPort is set to the same value of the port field, and it can be defined as a string.)