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编程
68
3
3.2.3
规格与状态
最后,几乎所有的顶级对象都包含
spec
status
字段。这主要来源于
Kubernetes
的声明式
API
设计:
spec
是用户期望的对象状态,
status
是这种
期望带来的当前结果,
status
字段的值通常由系统中的控制器负责填充。参
考“
1.4
控制器和
Operator
”了解更多
Kubernetes
中控制器相关的信息。
Kubernetes
系统中只有很少对象不是按上述的方式来使用
spec
status
的,
比如核心组中的
Endpoint
,或者
ClusterRole
这样的
RBAC
对象。
3.3
客户端集合
在“
3.1.4
创建并使用客户端对象”的例子中,我们看到
kubernetes.
NewForConfig(config)
会返回一个客户端集合。一个客户端集合可以让客户
端访问多个
API
组和资源。
k8s.io/client-go/kubernetes
中的
kubernetes.
NewForConfig(config)
所返回的客户端集合可以用于访问
k8s.io.api
中定义的
所有
API
组和资源,包括
Kubernetes API
服务器提供的几乎所有资源,除了
APIServices
(用于聚合服务器)和
CustomeResourceDefinition
(见第
4
章“ 使
用自定义资源”)等少量例外情况。
在第
5
章“自动代码生成”中,我们将解释这些客户端集合是如何根据对
API
类型(在这个例子中就是
k8s.io/api
)生成出来的。第三方使用自
定义
API
的项目可能会需要比
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