RKE2 版本: 2.8 操作系统和版本:Rocky 9 集群配置:v1.28.8+rke2r1 kube-proxy 模式是IPVS,
Service 创建了一个 nodeport ,外部业务能正常访问,但宿主机上使用losf和netstat 都查不到这个nodeport端口在监听?(使用nmap扫描宿主机端口是开启的)
github的回答显示,在新版本中已经删除了kube-proxy打开端口套接字部分,但是会在iptables中进行转发,故不影响访问。
service配置
![image|628x209](upload://1[root@Cluster01-k8s-master-01 ~]# kubectl get svc |grep netty
netty NodePort 192.168.10.169 10012:10012/TCP 11d
[root@Cluster01-k8s-master-01 ~]# iptables -S -t nat | grep 10012
Warning: iptables-legacy tables present, use iptables-legacy to see them
[root@Cluster01-k8s-master-01 ~]#
OINyqTjxtyfSbsYSrQo9zFm6QV.png)
[root@Cluster01-k8s-worker-02 ~]# iptables -t nat -nvL OUTPUT
Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
5256K 351M cali-OUTPUT all – * * 0.0.0.0/0 0.0.0.0/0 /* cali:tVnHkvAo15HuiPy0 /
5256K 351M KUBE-SERVICES all – * * 0.0.0.0/0 0.0.0.0/0 / kubernetes service portals */
1351K 81M CNI-HOSTPORT-DNAT all – * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
是这一条吗?
KUBE-SERVICES all – * * 0.0.0.0/0 0.0.0.0/0 /* kubernetes service portals */