当前位置:网站首页>Kubernetes服务类型浅析:从概念到实践
Kubernetes服务类型浅析:从概念到实践
2020-11-07 20:15:00 【InfoQ】

在Kubernetes中,服务总是能使其网络访问到一个或一组Pod上。服务将会根据标签选择Pod并且当对这些服务建立网络时,它会选择集群中所有与服务的selector相匹配的Pod,并选择其中的一个,然后将网络请求转发给它。

Kubernetes 服务vs Deployment
在K8S中我们应该如何区分Deployment和服务呢?
- Deployment主要负责让一组pod在集群中保持运行
- 服务主要负责在集群中启用对一组pod的网络访问
我们可以使用deployment而不使用服务,所以我们可以保持几个相同的Pod在K8S集群中运行。此外,Deployment的规模可以扩大和缩小,pod也可以复制。在Kubernetes中,单个pod可以直接通过网络请求单独访问,因此要跟踪pod会有些困难。
我们也可以使用一个服务类型而不需要deployment。如果我们这样做,将创建一个单一的pod,而不是像我们在deployment中那样一起创建所有pod。不过,我们还有另一种替代方案,即我们的服务能够根据分配给它们的标签进行选择,从而将网络请求路由到这些Pod。
我们如何发现Kubernetes服务呢?
在Kubernetes中,有两种方式可以发现服务:
原文链接:【https://www.infoq.cn/article/qCQWaB2ZzcUTc2LqXBpr】。未经作者许可,禁止转载。
版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://www.infoq.cn/article/qCQWaB2ZzcUTc2LqXBpr?utm_source=rss&utm_medium=article
边栏推荐
猜你喜欢

Awk implements SQL like join operation

Using thread communication to solve the problem of cache penetrating database avalanche

ajax 载入html后不能执行其中的js解决方法

阿里terway源码分析

chrome浏览器跨域Cookie的SameSite问题导致访问iframe内嵌页面异常

RECH8.0版本学习 days 12 rh134部分

11. Service update

嘉宾专访|2020 PostgreSQL亚洲大会中文分论坛:岳彩波

What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?

你真的会使用搜索引擎吗?
随机推荐
Microservice - how to limit and fuse service current
Exclusive interview with Yue Caibo
awk实现类sql的join操作
深入web workers (上)
C# 枚举权限 |和||,&和&&的区别
在pandas中使用pipe()提升代码可读性
k-vim安装及The ycmd server SHUT DOWN (restart with ':YcmRestartServer')这种错误的解决方法
If you want to forget the WiFi network you used to connect to your Mac, try this!
使用 Xunit.DependencyInjection 改造测试项目
Developing STM32 USB with cubemx
What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?
Vue: Axios uses this pointer
Didi's distributed ID generator (tinyid), easy to use
GrowingIO 响应式编程探索和实践
The most hard core of the whole network explains the computer startup process
Test the necessary skill points of siege lion! This article takes you to interpret the testing technology under Devops
Reflection on a case of bus card being stolen and swiped
Chinese sub forum of | 2020 PostgreSQL Asia Conference: Pan Juan
Shanghai Pudong Development Bank, which frequently receives penalty tickets, has been cheated by hundreds of millions of yuan in loans, and lacks of internal control?
From technology to management, the technology of system optimization is applied to enterprise management