当前位置:网站首页>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
边栏推荐
- 失眠一个整晚上
- 频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
- 深入浅出大前端框架Angular6实战教程(Angular6、node.js、keystonejs、
- Implementation of nginx version of microservice architecture
- Exclusive interview with alicloud database of | 2020 PostgreSQL Asia Conference: Wang Xu
- 深入web workers (上)
- 技术债务是对业务功能缺乏真正的理解 -daverupert.com
- Solution to st link USB communication error in stlink Download
- yum [Errno 256] No more mirrors to try 解决方法
- Code Review最佳实践
猜你喜欢
Business facade and business rule
.NETCore3.1+ Vue.js Low code workflow engine
HMS core push service helps e-commerce app to carry out refined operation
awk实现类sql的join操作
From technology to management, the technology of system optimization is applied to enterprise management
8. Swarm creates maintenance and horizontal extension service
Classroom exercises
傲視Kubernetes(一):Kubernetes簡介
全网最硬核讲解计算机启动流程
A kind of super parameter optimization technology hyperopt
随机推荐
awk实现类sql的join操作
利用线程通信、解决缓存穿透数据库雪崩
vscode 配置
Opencv computer vision learning (10) -- image transform (Fourier transform, high pass filter, low pass filter)
嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王旭
8. Swarm creates maintenance and horizontal extension service
想要忘记以前连接到Mac的WiFi网络,试试这个方法!
HandlerMethodArgumentResolver使用和原理
graph generation model
Talk about sharing before paying
Implementation of nginx version of microservice architecture
Why do we need software engineering -- looking at a simple project
bgfx编译教程
[note] error while loading pyv8 binary: exit code 1 solution
如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题
Introduction to Jenkins (2) declarative pipeline
Business Facade 与 Business Rule
K-vim installation and the ycmd server shut down (restart with ': ycmrestartserver')
The JS solution cannot be executed after Ajax loads HTML
使用 Xunit.DependencyInjection 改造测试项目