当前位置:网站首页>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的入口。
集群暴露在外网中的端口
边栏推荐
- H5, add a mask layer to the page, which is similar to clicking the upper right corner to open it in the browser
- Filtre de profondeur de la série svo2
- CDA data analysis -- common knowledge points induction of Excel data processing
- Gaode map test case
- XSS labs master shooting range environment construction and 1-6 problem solving ideas
- Log4j2
- HOW TO EASILY CREATE BARPLOTS WITH ERROR BARS IN R
- drools执行完某个规则后终止别的规则执行
- Fabric. JS 3 APIs to set canvas width and height
- Addition, deletion, modification and query of MySQL table (Advanced)
猜你喜欢

xss-labs-master靶场环境搭建与1-6关解题思路

CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节

Filtre de profondeur de la série svo2

SVO2系列之深度滤波DepthFilter

HOW TO ADD P-VALUES ONTO A GROUPED GGPLOT USING THE GGPUBR R PACKAGE

How to Visualize Missing Data in R using a Heatmap

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

Brush questions --- binary tree --2

Pytorch builds LSTM to realize clothing classification (fashionmnist)

H5, add a mask layer to the page, which is similar to clicking the upper right corner to open it in the browser
随机推荐
深入理解PyTorch中的nn.Embedding
【C语言】杨辉三角,自定义三角的行数
FastDateFormat为什么线程安全
全链路压测
初始JDBC 编程
GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
Yygh-9-make an appointment to place an order
Yygh-10-wechat payment
Natural language processing series (III) -- LSTM
Leetcode122 买卖股票的最佳时机 II
Applet link generation
BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
H5, add a mask layer to the page, which is similar to clicking the upper right corner to open it in the browser
CDA data analysis -- Introduction and use of aarrr growth model
GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
Jenkins user rights management
SCM power supply
SVO2系列之深度濾波DepthFilter
Log4j2
[QT] Qt development environment installation (QT version 5.14.2 | QT download | QT installation)