Skip to Content
Google SRE工作手册
book

Google SRE工作手册

by Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne
September 2020
Intermediate to advanced
526 pages
8h 23m
Chinese
China Electric Power Press Ltd.
Content preview from Google SRE工作手册
配置规范
357
如第
14
章中所述,虽然简单性是设计的基础,但脱离简单性的能力也很重要。对模
板的覆盖是一个有用的脱离途径,用于修改通常特别低层级的特定细节。
例如:
templates.MyTemplate {
tier: 'frontend',
spec+: {
sessionAffinity: 'ClientIP',
},
}
这是将现有模板转换为
Jsonnet
的典型工作流程:
1.
YAML
变体之一转换为
JSON
2.
通过
Jsonnet
格式化程序运行上述
JSON
3.
手动添加
Jsonnet
构造函数,用于抽象并实例化代码(如示例中所示)。
该示例说明了如何在保留某些不同字段的同时删除重复项。随着差异变得更细微(例
如,字符串略有不同)或难以表达(例如,配置具有结构差异,如数组中的额外元素,
或在数组的所有元素普遍共有的差异),使用配置语言变得更具吸引力。
通常,针对不同配置的公共性进行抽象可以促进关注点的分离,会有与编程语言中
的模块化相同的优势。你可以在许多不同的用例中利用这种抽象性:
一个团队可能需要创建几乎(但不完全)相同的多个版本的配置。例如,管理跨
各种环境(生产
/
预发布
/
开发
/
测试)的部署,调整不同体系结构上的部署,
或者根据不同地区进行的调整。
一个组织可能拥有一个基础设施团队,他们维护着供应用程序团队使用的可重用
组件(
API
服务框架、缓存服务器或
MapReduce
)。对于每个组件,基础设施团
队都可以维护一个模板,该模板定义了大规模运行此组件所需的
Kubernetes ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python数据分析(第2版)

Python数据分析(第2版)

Posts & Telecom Press, Armando Fandango
Google系统架构解密: 构建安全可靠的系统

Google系统架构解密: 构建安全可靠的系统

Heather Adkins, Betsy Beyer, Paul Blankinship, Piotr Lewandowski, Ana Oprea, Adam Stubblefield
编写整洁的Python代码(第2版)

编写整洁的Python代码(第2版)

Posts & Telecom Press, Mariano Anaya

Publisher Resources

ISBN: 9787519845858