Skip to Content
Kubernetes编程
book

Kubernetes编程

by Michael Hausenblas, Stefan Schimanski
June 2021
Intermediate to advanced
335 pages
5h 50m
Chinese
China Electric Power Press Ltd.
Content preview from Kubernetes编程
189
8
自定义
API
服务器
自定义
API
服务器可以用作为
CustomResourceDefinitions
的替代品。它可以
Kubernetes
的原生
API
服务器一样为
API
组和资源提供服务。与
CRD
相比,
使用自定义
API
服务器时你拥有更大的自由度,没有太多限制。
本章会首先列出一些不适用
CRD
的应用场景,然后介绍通过自定义
API
服务
器来扩展
Kubernetes API
接口的聚合模式。最后,你会学到如何用
Golang
现一个自定义
API
服务器。
8.1
自定义
API
服务器的适用场景
自定义
API
服务器可以用来替代
CRD
。它不但可以做任何
CRD
可以做到的
事情,而且还提供了近乎无限的灵活性。当然,这也伴随着一定的代价:开
发和使用的复杂性。
让我们看看截至本书编写时(
Kubernetes 1.14
是此时的稳定版),
CRD
所存
在的一些局限性:
使用
etcd
作为它们的存储介质(也可以是别的存储方案,总之与
Kubernetes API
服务器所使用的一致)。
不支持
protobuf
,只支持
JSON
190
8
仅支持两种子资源类型:
/status
/scale
(参考“
4.3.4
子资源”)。
不支持平滑删除
1
。终结器可以模拟这个过程,但是它不允许自定义平滑
删除时间。
显著增加
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

解密金融数据

解密金融数据

Justin Pauley
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton

Publisher Resources

ISBN: 9787519854799