当前位置:网站首页>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的入口。
集群暴露在外网中的端口
边栏推荐
- Time format display
- Depth filter of SvO2 series
- Natural language processing series (II) -- building character level language model using RNN
- 高德地图测试用例
- Small guide for rapid formation of manipulator (VII): description method of position and posture of manipulator
- Orb-slam2 data sharing and transmission between different threads
- 机械臂速成小指南(七):机械臂位姿的描述方法
- Deep understanding of P-R curve, ROC and AUC
- Larvel modify table fields
- Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)
猜你喜欢

ES集群中节点与分片的区别

【C语言】十进制数转换成二进制数

HR wonderful dividing line

Lekao: contents of the provisions on the responsibility of units for fire safety in the fire protection law

深入理解P-R曲线、ROC与AUC

甜心教主:王心凌

还不会安装WSL 2?看这一篇文章就够了

GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R

Read the Flink source code and join Alibaba cloud Flink group..

Take you ten days to easily finish the finale of go micro services (distributed transactions)
随机推荐
【工控老马】西门子PLC Siemens PLC TCP协议详解
Jenkins voucher management
Heap (priority queue)
ThreadLocal的简单理解
Natural language processing series (III) -- LSTM
conda常用命令汇总
Full link voltage measurement
HR wonderful dividing line
Leetcode922 按奇偶排序数组 II
YYGH-BUG-05
Log4j2
JZ63 股票的最大利润
Codeforces 771-div2 C (trouble, permutation is not very good)
Orb-slam2 data sharing and transmission between different threads
Lombok common annotations
排序---
Small guide for rapid formation of manipulator (VII): description method of position and posture of manipulator
Leetcode14 longest public prefix
HOW TO ADD P-VALUES TO GGPLOT FACETS
PyTorch中repeat、tile与repeat_interleave的区别