A pod named 'web-frontend' is in CrashLoopBackOff. You run 'kubectl logs web-frontend' and see: 'Error: listen tcp :8080: bind: address already in use'. What is the most likely cause and how should you fix it?
Trap 1: The NodePort is conflicting; change the service type to ClusterIP.
NodePort is unrelated to container-level port binding.
Trap 2: The container is missing an environment variable required for…
Missing env vars typically cause connection errors, not port bind errors.
Trap 3: The pod has insufficient memory; increase memory limits in the…
Memory issues cause OOMKill, not bind errors.
- A
The NodePort is conflicting; change the service type to ClusterIP.
Why wrong: NodePort is unrelated to container-level port binding.
- B
The container is missing an environment variable required for startup; add it via ConfigMap.
Why wrong: Missing env vars typically cause connection errors, not port bind errors.
- C
The container process is not terminating gracefully; add a preStop hook or use a proper init system to release the port.
The error shows port already in use, indicating the old process didn't release it.
- D
The pod has insufficient memory; increase memory limits in the deployment.
Why wrong: Memory issues cause OOMKill, not bind errors.