当前位置:网站首页>kubenetes中port、targetPort、nodePort、containerPort的区别与联系
kubenetes中port、targetPort、nodePort、containerPort的区别与联系
2022-07-02 09:43:00 【Ostrich5yw】
kubenetes中port、targetPort、nodePort、containerPort的区别与联系
首先给出一张kubenetes结构图:

containerPort
containerPort是在pod控制器中定义的、pod中的容器需要暴露的端口。
Pod中容器暴露的端口targetPort
targetPort是pod上的端口,从port/nodePort下来的数据,经过kube-proxy流入到后端pod的targetPort上,最后进入容器。
Pod暴露的端口port
port是暴露在cluster (集群网络)上的端口,提供了集群内部客户端访问service的入口,即clusterIP:port。mysql容器暴露了3306端口(参考DockerFile),集群内其他容器通过33306端口访问mysql服务,但是外部流量不能访问mysql服务,因为mysql服务没有配置NodePort。
service暴露在集群中的端口
nodePort
nodePort提供了集群外部客户端访问service的一种方式,即nodeIP:nodePort提供了外部网络访问k8s集群中service的入口。
集群暴露在外网中的端口
边栏推荐
猜你喜欢

二分刷题记录(洛谷题单)区间的甄别

YYGH-BUG-04

Jenkins voucher management

Sort---

机械臂速成小指南(七):机械臂位姿的描述方法

Natural language processing series (III) -- LSTM

How does Premiere (PR) import the preset mogrt template?

Tas (file d'attente prioritaire)

Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)

conda常用命令汇总
随机推荐
PyTorch中repeat、tile与repeat_interleave的区别
Leetcode14 longest public prefix
ORB-SLAM2不同线程间的数据共享与传递
PyTorch nn.RNN 参数全解析
HOW TO ADD P-VALUES ONTO A GROUPED GGPLOT USING THE GGPUBR R PACKAGE
GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
mysql表的增删改查(进阶)
YYGH-BUG-04
自然语言处理系列(二)——使用RNN搭建字符级语言模型
Take you ten days to easily finish the finale of go micro services (distributed transactions)
Leetcode739 daily temperature
conda常用命令汇总
mysql索引和事务
二分刷题记录(洛谷题单)区间的甄别
Codeforces 771-div2 C (trouble, permutation is not very good)
Leetcode122 买卖股票的最佳时机 II
Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement
Seriation in R: How to Optimally Order Objects in a Data Matrice
The most understandable f-string tutorial in history, collecting this one is enough
【C语言】杨辉三角,自定义三角的行数