Kubernetes NodePort로 iptables REDIRECT로 인해 요청이 중단됨

Kubernetes NodePort로 iptables REDIRECT로 인해 요청이 중단됨

192.168.1.100.30000(https 포트)에서 수신 대기하는 kubernetes 클러스터 NodePort로 클라이언트 트래픽을 전달하려고 합니다.

클라이언트는 192.168.1.100.8000에 요청해야 하므로 iptables에 다음 REDIRECT 규칙을 추가했습니다.

iptables -t nat -I PREROUTING -p tcp --dst 192.168.1.100 --dport 8000 -j REDIRECT --to-port 30000
iptables -t nat -I OUTPUT -d 192.168.1.100 -p tcp --dport 8000 -j REDIRECT --to-port 30000

그러나 다음과 같은 오류가 발생합니다.

# curl -vk https://192.168.1.100:8000/v1/api
* About to connect() to 192.168.1.100 port 8000 (#0)
*   Trying 192.168.1.100...
* Connected to 192.168.1.100 (192.168.1.100) port 8000 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* NSS error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG)
* SSL received a record that exceeded the maximum permissible length.
* Closing connection 0
curl: (35) SSL received a record that exceeded the maximum permissible length.

또한 다음에 표시된 원격 시스템을 설정하려고 시도했습니다.이것동일한 엔드포인트에 응답하고 요청했는데 다음 오류가 발생했습니다.

# ip netns exec remotesystem curl -vk https://192.168.1.100:8000/v1/api
* About to connect() to 192.168.1.100 port 8000 (#0)
*   Trying 192.168.1.100...
* Connection timed out
* Failed connect to 192.168.1.100:8000; Connection timed out
* Closing connection 0
curl: (7) Failed connect to 192.168.1.100:8000; Connection timed out

kubernetes 클러스터에는 calico crds로 시행되는 네트워크 정책이 있다는 것을 알고 있지만 네트워크 정책에 기본 허용을 추가했는데 트래픽이 여전히 중단된 것 같습니다.

또한 수신 컨트롤러의 로그를 확인하여 요청이 이루어졌는지 확인했지만 요청 시 로그 출력이 표시되지 않았습니다.

이상한 점은 노드 포트가 https://192.168.1.100.30000/v1/api작동하도록 직접 컬링하고 성공적인 응답을 받는 것입니다.

질문은 컬링으로 인해 https://192.168.1.100:8000/v1/api (with the REDIRECT rule to 30000)요청이 중단되는 이유는 무엇입니까?

관련 정보