原文:https://zhuanlan.zhihu.com/p/589599203?utm_id=0
此外我们还可以将 Node 的端口映射到宿主机,通过配置文件中的 extraPortMappings 属性可以实现该功能,如下所示配置可以将 control-plane 节点 80 端口映射到宿主机的 80 端口上:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 80
hostPort: 80
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
protocol: udp # Optional, defaults to tcp