DEV Community

Discussion on: Building a headless service in Kubernetes

Collapse
 
wangjunru profile image
charlie

The problem is you can not use the port 80 defined in service but only 3000 the pods exposed. Am I right? This's my experiment shown.

Collapse
 
luanau profile image
luanau

From the utility pod you can,
curl normal-service:80
curl 10.1.0.41:3000 #a headless service pod

The response is something like,
{"message":"Hello World from your container!","hostname":"api-deployment-f457fbcf6-6j8f9"}

The headless service has no dns name and no ip.