Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access pods without services in Kubernetes

Tags:

kubernetes

I was wondering how pods are accessed when no service is defined for that specific pod. If it's through the environment variables, how does the cluster retrieve these?

Also, when services are defined, where on the master node is it stored?

Kind regards, Charles

like image 522
Charles Van Damme Avatar asked Nov 28 '18 10:11

Charles Van Damme


People also ask

Can pods communicate without service?

Kubernetes assumes that pods can communicate with other pods, regardless of which host they land on. Kubernetes gives every pod its own cluster-private IP address, so you do not need to explicitly create links between pods or map container ports to host ports.


1 Answers

  • If you define a service for your app , you can access it outside the cluster using that service

  • Services are of several types , including nodePort , where you can access that port on any cluster node and you will have access to the service regardless of the actual location of the pod

  • you can access the endpoints or actual pod ports inside the cluster as well , but not outside

  • all of the above uses the kubernetes service discovery

  • There are two type of service dicovery though
  • Internal Service discovery
  • External Service Discovery.

enter image description here

like image 183
Ijaz Ahmad Avatar answered Sep 22 '22 08:09

Ijaz Ahmad