k8s 集群 firewalld 端口放行
k8s 端口列表
控制面
| 协议 | 方向 | 端口范围 | 目的 | 使用者 |
|---|---|---|---|---|
| TCP | 入站 | 6443 | Kubernetes API 服务器 | 所有 |
| TCP | 入站 | 2379-2380 | etcd 服务器客户端 API | kube-apiserver、etcd |
| TCP | 入站 | 10250 | kubelet API | 自身、控制面 |
| TCP | 入站 | 10259 | kube-scheduler | 自身 |
| TCP | 入站 | 10257 | kube-controller-manager | 自身 |
工作节点
| 协议 | 方向 | 端口范围 | 目的 | 使用者 |
|---|---|---|---|---|
| TCP | 入站 | 10250 | kubelet API | 自身、控制面 |
| TCP | 入站 | 10256 | kube-proxy | 自身、负载均衡器 |
| TCP | 入站 | 30000-32767 | NodePort Services† | 所有 |
calico 端口列表
| Configuration | Host(s) | Connection type | Port/protocol |
|---|---|---|---|
| Calico 网络 (BGP) | All | Bidirectional | TCP 179 |
| 启用了 IP-in-IP 的 Calico 网络(默认) | All | Bidirectional |
IP-in-IP, often represented by its protocol number |
| 启用了 VXLAN 的 Calico 联网 | All | Bidirectional | UDP 4789 |
| 启用了 Typha 的 Calico 网络 | Typha agent hosts | Incoming | TCP 5473 (default) |
| 启用了 IPv4 Wireguard 的 Calico 网络 | All | Bidirectional | UDP 51820 (default) |
| 启用了 IPv6 Wireguard 的 Calico 网络 | All | Bidirectional | UDP 51821 (default) |
| flannel 网络 (VXLAN) | All | Bidirectional | UDP 4789 |
| All | kube-apiserver host | Incoming | Often TCP 443 or 6443* |
| etcd datastore | etcd hosts | Incoming |
Officially TCP 2379 but can vary |
firewalld 规则
k8sZone (active)
target: ACCEPT
icmp-block-inversion: no
interfaces:
sources: 192.168.174.100 192.168.174.101 192.168.174.102 192.168.174.103 192.168.174.104 192.168.174.105 192.168.174.106 10.233.64.0/18 10.233.0.0/18
services:
ports: 179/tcp 6443/tcp 2379/tcp 2380/tcp 10250/tcp 10257/tcp 10259/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
10.233.64.0/18 pod 网络
10.233.0.0/18 svc 网络

浙公网安备 33010602011771号