Skip to Content
Kubernetes即学即用(第二版)
book

Kubernetes即学即用(第二版)

by Brendan Burns, Joe Beda, Kelsey Hightower
June 2021
Intermediate to advanced
300 pages
5h 4m
Chinese
China Electric Power Press Ltd.
Content preview from Kubernetes即学即用(第二版)
260
18
所有这些组件的只有一个团队,因此这可以为团队的扩展奠定基础,最终,
可能每个组件都会由一个团队(或子团队)来负责。
因此,对于涉及两个服务的前端应用程序来说,文件系统的布局应如下:
frontend/
service-1/
service-2/
各个应用程序的配置都存储在各自的目录中。这些配置就是直接代表集群当
前状态的
YAML
文件。通常最好将服务名称和对象类型保存到同一个文件中。
虽然
Kubernetes
允许在同一个文件中创建具有多个对象的
YAML
文件,但
通常我们应该把这种方式视为反模式。只有当多个对象在概念上等价时,才
应该保存到同一个文件中。在决定
YAML
文件中应该保存什么时,请考虑
定义类或结构的设计原则。如果将对象分组到一起并不能形成一个概念,那
么就不应该将它们放在一个文件中。
因此,扩展前面的示例,文件系统大致如下所示:
frontend/
frontend-deployment.yaml
frontend-service.yaml
frontend-ingress.yaml
service-1/
service-1-deployment.yaml
service-1-service.yaml
service-1-configmap.yaml
...
18.2.2
管理周期性的版本
在上一节中,我们介绍了应用程序布局中各个层的文件结构,但是如何管理
应用程序的发布呢?你最好能够随时回顾历史,看看之前应用程序是什么样
子。同样,在配置不断向前迭代的同时,最好可以保证随时能够部署稳定的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PyTorch深度学习

PyTorch深度学习

Posts & Telecom Press, Vishnu Subramanian
Python数据分析

Python数据分析

Posts & Telecom Press, Ivan Idris
Python贝叶斯分析(第2版)

Python贝叶斯分析(第2版)

Posts & Telecom Press, Osvaldo Martin
Python高级编程(第2版)

Python高级编程(第2版)

Posts & Telecom Press, Michał Jaworski, Tarek Ziadé

Publisher Resources

ISBN: 9787519856762