当前位置:网站首页>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的入口。
集群暴露在外网中的端口
边栏推荐
- The blink code based on Arduino and esp8266 runs successfully (including error analysis)
- Gaode map test case
- YYGH-BUG-04
- 基于Arduino和ESP8266的连接手机热点实验(成功)
- Leetcode14 最长公共前缀
- Le tutoriel F - String le plus facile à comprendre de l'histoire.
- Lombok common annotations
- Maximum profit of jz63 shares
- B high and beautiful code snippet sharing image generation
- 全链路压测
猜你喜欢

MySQL与PostgreSQL抓取慢sql的方法

Deep understanding of P-R curve, ROC and AUC

MSI announced that its motherboard products will cancel all paper accessories
![[geek challenge 2019] upload](/img/04/731323142161a4994c14fedae38b81.jpg)
[geek challenge 2019] upload

From scratch, develop a web office suite (3): mouse events

Brush questions --- binary tree --2

GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT

K-Means Clustering Visualization in R: Step By Step Guide

Take you ten days to easily finish the finale of go micro services (distributed transactions)

H5, add a mask layer to the page, which is similar to clicking the upper right corner to open it in the browser
随机推荐
YYGH-BUG-04
堆(优先级队列)
Filtre de profondeur de la série svo2
[QT] Qt development environment installation (QT version 5.14.2 | QT download | QT installation)
倍增 LCA(最近公共祖先)
求16以内正整数的阶乘,也就是n的阶层(0=<n<=16)。输入1111退出。
Map和Set
From scratch, develop a web office suite (3): mouse events
lombok常用注解
深入理解PyTorch中的nn.Embedding
5g era, learning audio and video development, a super hot audio and video advanced development and learning classic
Leetcode922 sort array by parity II
高德地图测试用例
Time format display
Lekao: contents of the provisions on the responsibility of units for fire safety in the fire protection law
字符串回文hash 模板题 O(1)判字符串是否回文
From scratch, develop a web office suite (3): mouse events
On data preprocessing in sklearn
甜心教主:王心凌
drools决策表的简单使用