EADDRINUSE kubernetes runtime_error ai_generated true

Error: listen tcp :80: bind: address already in use

ID: kubernetes/port-conflict-ingress

Also available as: JSON · Markdown · 中文
88%Fix Rate
87%Confidence
1Evidence
2023-11-20First Seen

Root Cause

The port 80 or 443 is already occupied by another process on the host, preventing the ingress controller or kube-proxy from binding.

generic

中文

端口 80 或 443 已被主机上的另一个进程占用,阻止了入口控制器或 kube-proxy 绑定。

Official Documentation

https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/

Workarounds

  1. 90% success Identify and stop the process using the port: 'sudo lsof -i :80' then 'sudo kill -9 <PID>' or 'sudo systemctl stop nginx' if it's the default web server.
    Identify and stop the process using the port: 'sudo lsof -i :80' then 'sudo kill -9 <PID>' or 'sudo systemctl stop nginx' if it's the default web server.
  2. 85% success Configure the ingress controller to use a different host port via hostPort in the deployment spec, e.g., 'hostPort: 8080'.
    Configure the ingress controller to use a different host port via hostPort in the deployment spec, e.g., 'hostPort: 8080'.

中文步骤

  1. Identify and stop the process using the port: 'sudo lsof -i :80' then 'sudo kill -9 <PID>' or 'sudo systemctl stop nginx' if it's the default web server.
  2. Configure the ingress controller to use a different host port via hostPort in the deployment spec, e.g., 'hostPort: 8080'.

Dead Ends

Common approaches that don't work:

  1. Delete and recreate the ingress controller pod 80% fail

    The pod inherits the host network; the port conflict persists on the node regardless of pod lifecycle.

  2. Change the ingress controller's service type to NodePort 60% fail

    NodePort still uses host ports; the conflict remains unless the port is freed.