1、port
port是k8s集群外部(node节点)拜访service的端口,即通过clusterIP: port能够拜访到某个service。
2、nodePort
nodePort是内部拜访k8s集群中service的端口,通过nodeIP: nodePort能够从内部(浏览器/其余集群)拜访到某个service。
3、targetPort
targetPort是pod的端口,从port和nodePort来的流量通过kube-proxy流入到后端pod的targetPort上,最初进入容器(一个pod中能够有多个容器)。
4、containerPort
containerPort是pod外部容器的端口,targetPort映射到containerPort。
port、nodePort、targetPort是在service中配置。 containerPort是在pod中配置