当前位置:网站首页>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
边栏推荐
- Advanced concurrent programming series 9 (lock interface analysis)
- Web API系列(三)统一异常处理
- Web API series (3) unified exception handling
- Test the necessary skill points of siege lion! This article takes you to interpret the testing technology under Devops
- yum [Errno 256] No more mirrors to try 解决方法
- After pulling four message queues into a group, they quarreled
- If you want to forget the WiFi network you used to connect to your Mac, try this!
- Using LWA and lync to simulate external test edge free single front end environment
- Exclusive interview with Yue Caibo
- What should be considered in the promotion plan outside the station?
猜你喜欢

Win7 how to quickly type CMD and get to the required directory

Do you really know how to use search engines?

confd

使用“1”个参数调用“DownloadString”时发生异常:“操作超时”

How to solve the problem of blank page in Google Chrome browser
![Yum [errno 256] no more mirrors to try solution](/img/3b/00bc81122d330c9d59909994e61027.jpg)
Yum [errno 256] no more mirrors to try solution

Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。

What should be considered in the promotion plan outside the station?

PHP安全:变量的前世今生

阿里terway源码分析
随机推荐
嘉宾介绍|2020 PostgreSQL亚洲大会中文分论坛:潘娟
微服務 - 如何進行服務限流和熔斷
Exclusive interview with Yue Caibo
awk实现类sql的join操作
Jenkins pipline stage setting timeout
[漫谈] 软件设计的目标和途径
傲視Kubernetes(一):Kubernetes簡介
Advanced concurrent programming series 9 (lock interface analysis)
REM: the solution of PC and mobile
Yum [errno 256] no more mirrors to try solution
STlink下载出现st-link usb communication error解决方法
聊聊Go代码覆盖率技术与最佳实践
Vue: Axios uses this pointer
And how to solve the conflict between pop-up menu and pop-up menu
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
在 Amazon SageMaker 管道模式下使用 Horovod 实现多 GPU 分布式训练
我是如何失去团队掌控的?
我们为什么需要软件工程——从一个简单的项目进行观察
Do you really know how to use search engines?
Bgfx compilation tutorial