主要记录最近遇到的一些开发问题,解决方法。 1. Kubernetes 服务仅在负载节点可用 正常情况下 NodePort 类型的 Service ,任意 Node 节点 IP + 端口,都可以访问。但是,也有可能仅负载的 Node 节点 IP + 端口可以访问。 首先,可以尝试配置转发相关参数: 1 2 3 4 5 6 cat <<EOF > /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward=1 vm.swappiness=0 EOF 1 sysctl