A license-renewal container listens on port 8080, but the Pod’s containerPort and the Service targetPort are set to 80. Users hit connection failures. How should the developer diagnose and fix?
Select an answer to reveal the explanation.
Short Explanation
If the app speaks on 8080 but the Service knocks on 80, nobody answers the door. Check what the process actually listens on, then match targetPort. Extra replicas will not change the listen port.
Full Explanation
Service traffic is delivered to targetPort on the Pod. If the application process listens on 8080 while Service/Pod metadata points at 80, connections fail. Diagnosis uses logs, exec (ss/netstat), or describe to confirm the listen port, then updates containerPort and Service targetPort (and probes if needed) to match. Replica count, ExternalName, and hostPort workarounds do not correct a targetPort mismatch to the real listen port.