{"id":"IL-0186","org":"Hans H. Kim","date":"2023-04-13","docs":[],"title":{"en":"Pods on one Kubernetes worker node could not reach external HTTP and HTTPS because storage components had added nat PREROUTING rules that redirected ports 80 and 443 to local ports","ko":"스토리지 구성 요소가 노드에 넣은 iptables REDIRECT 규칙 때문에 워커 노드 하나의 파드가 외부 HTTP 와 HTTPS 로 나가지 못했다."},"domain":["kubernetes","networking"],"impact":{"scope":"Outbound HTTP and HTTPS from pods on one worker node","users":"unknown","region":"unknown"},"review":{"written_by":"session","reviewed_at":null,"reviewed_by":null},"lessons":{"en":"Inside Kubernetes, kube-proxy itself manages iptables rules, so the author felt that part needs to be understood in depth. When packets go missing during network tests, check each step of the path in turn, which requires knowing clearly which steps the networking goes through.","ko":"쿠버네티스에서는 kube-proxy 가 iptables 를 직접 다루므로 이 부분을 깊이 이해해야 한다. 네트워크 시험 중 패킷이 사라지면 어느 단계에서 문제가 생겼는지 하나씩 따져 봐야 하고, 그러려면 네트워킹이 어떤 단계를 거쳐 이루어지는지 확실히 알고 있어야 한다."},"related":[],"sources":[{"url":"https://hhhyunwoo.github.io/posts/k8s-iptable/","kind":"blog","license":"cc-by","archived":null}],"summary":{"en":"Components installed for storage work automatically added iptables rules to one node. Packets sent from pods are handled by the nat PREROUTING chain, so every HTTP request from a pod on that node to an external address was redirected to local port 47080, and every HTTPS request to local port 47443. Pods on the node therefore had no outbound HTTP or HTTPS. Traffic from the host itself, such as image pulls, kept working, because the matching OUTPUT rules applied only to traffic going out through the loopback interface.\n\nThe author's team asked the people responsible for the storage components to delete the rules, which fixed it.","ko":"쿠버네티스 클러스터의 특정 워커 노드에서 파드가 80 포트와 443 포트로 외부와 통신하지 못했다. 인프라 담당자와 팀원이 함께 디버깅한 결과, 스토리지 작업용 구성 요소를 설치한 서버가 그 노드에 iptables 설정을 자동으로 추가해 둔 것이 원인이었다. nat 테이블의 PREROUTING 체인에 목적지 포트가 http 면 47080 으로, https 면 47443 으로 리다이렉트하는 규칙이 들어가 있었다.\n\n파드가 내보내는 요청은 PREROUTING 체인을 지난다. 그래서 파드에서 나가는 HTTP 와 HTTPS 요청은 각각 localhost:47080 과 localhost:47443 으로 리다이렉트돼 외부에 닿지 못했다. 반면 이미지 풀은 파드 안의 통신이 아니라 호스트 통신이라 OUTPUT 체인을 탔고, OUTPUT 의 규칙은 lo 로 나가는 요청에만 걸려 영향이 없었다. 스토리지 담당자에게 요청해 이 규칙을 지워 해결했다."},"trigger":{"en":"A server on which components for storage work had been installed automatically added nat REDIRECT rules for ports 80 and 443 to the node's iptables.","ko":"스토리지 작업용 구성 요소를 설치한 서버가 특정 노드에, 80 포트와 443 포트로 가는 트래픽을 로컬 포트로 리다이렉트하는 iptables nat 규칙을 자동으로 넣었다."},"severity":"unknown","symptoms":["requests-misrouted"],"timeline":{"detected_after":null,"resolved_after":null},"date_kind":"published","detection":null,"components":["node-iptables"],"root_cause":"config-change","remediation":[{"text":{"en":"had the people responsible for the storage components delete the REDIRECT rules from the node","ko":"스토리지 담당자에게 요청해 문제의 iptables 규칙을 지웠다."}}],"action_items":[],"contributing":[],"recurrence_of":null,"symptoms_text":{"en":"On one worker node of a Kubernetes cluster, traffic to ports 80 and 443 went missing: pods on that node could not make outbound HTTP or HTTPS requests. Infrastructure engineers and the author's teammates debugged it.\n\nListing the nat table on the node (test-a100) with iptables -L -t nat -v showed two REDIRECT rules after the KUBE-SERVICES rule in the PREROUTING chain: \"tcp dpt:http redir ports 47080\" and \"tcp dpt:https redir ports 47443\". The OUTPUT chain held the same two redirects, but only for traffic leaving through lo.\n\nImage pulls on the node still worked. They are made by the host, not from inside a pod, so they go through the OUTPUT chain, where the redirects only matched traffic to localhost.","ko":"쿠버네티스 클러스터의 특정 워커 노드에서 80 포트와 443 포트로 가는 통신이 되지 않았다. 그 노드의 파드는 외부와 HTTP, HTTPS 로 통신할 수 없었다.\n\n노드에서 iptables -L -t nat -v 로 nat 테이블을 보니 PREROUTING 체인에 KUBE-SERVICES 규칙 다음으로 REDIRECT tcp -- any any anywhere anywhere tcp dpt:http redir ports 47080 과 REDIRECT tcp -- any any anywhere anywhere tcp dpt:https redir ports 47443 규칙이 들어 있었다. https 규칙에는 패킷 234개가 걸려 있었다.\n\n이미지 풀은 영향을 받지 않았다. OUTPUT 체인에도 같은 REDIRECT 규칙이 있었지만 나가는 인터페이스가 lo 인 요청에만 걸렸기 때문이다."},"updated_at":"2026-11-09T11:55:57.486937Z","url":"https://benchlet.com/incidentlib/app/cases/IL-0186","org_slug":"hans-h-kim"}