When you peel back the log files, you see it: the wrong internal port. The deployment is fine, the build passed, but the service isn’t reachable. This is what happens when internal ports are misunderstood or mismatched between code, container configuration, and orchestration settings.
The internal port is the port inside the container where your application actually listens. It’s not the same as the external or exposed port. When your service is deployed, traffic comes in through an external port handled by the platform or load balancer, then routed internally to this private port. If internal and external ports are not mapped correctly, the service will be invisible from outside even if it’s running perfectly inside.
This matters across Kubernetes deployments, Docker builds, and any microservices running in containerized environments. In Kubernetes, targetPort defines the internal port your Pod is listening on. port in the Service spec is the abstract port exposed inside the cluster, and nodePort or the load balancer configuration handles external access. In Docker, you define it with the EXPOSE instruction or through runtime flags. Get this wrong and you’ll be troubleshooting at 2 a.m.
Common mistakes include: