Kubernetes 101 : Services and deployment

Kubernetes services:

A kubernetes service is a persistent virtual IP address that allows client applications to be able to always connect to the pods, since the pods crash and get redeployed with a new IP address.

The Kube-proxy is a kubernetes object that runs on all the nodes of the cluster and does the mapping between the services and the pods using ip-tables rules for the routing of the requests.


Instead of managing pods individually, we could group them in deployments and manage them as a single unit.


We first create our deployment of the "nginx" pods using the command line as below:

Then we expose our deployment "nginx-dep" through a service on "port:80", using the below command:

The requests reach the service on "port:80", and get redirected to one of the "nginxpods.


Leave as a comment: