When I create service clusterIP at port 777 , targetPort 80. If the service sele . . .

Dar Nattp:
When I create service clusterIP at port 777 , targetPort 80.
If the service select to pod that has 2 container as nginx container and sidecar.
How service know it should reach on nginx container port not sidecar?

Ly Quoc Bao:
Hey, each container within the pod shares the same networking namespace so containers cannot listen to same port, in same pod. This mean your service just forward to port you have set in container you want.

Dar Nattp:
@Ly Quoc Bao Very impression thanks.

Ly Quoc Bao:
You’re welcome bro.