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编程
Kubernetes API
基础
33
2.1.2 API
术语
在开始讨论
API
逻辑之前,我们先来定义一下在
Kubernetes API
服务器的上
下文中所使用的一些术语:
型别(
Kind
一个实体的类型。每个对象都有一个名为
Kind
的字段(在
JSON
中以小
写的
kind
表示,在
Golang
中以首字母大写的
Kind
表示)。这个字段用
于告诉客户端(比如
kubectl
)它所代表的东西,比如一个
Pod
。一共有
三种类型的型别:
Object
用于表示系统中的持久化的实体对象,比如,
Pod
Endpoint
这类对象需要名字,并且它们中的大部分都从属于某个命名空间。
List
是一种或多种实体的列表集。这些列表对象包含少量的公共信息,
比如
PodList
NodeList
。当你执行 kubectl get pods 时就会得到
这样的一个对象。
其他特殊用途的型别会用于某些对象上的特定动作或者用于一些非持
久化的实体,比如
/binding
/scale
Kubernetes
使用
APIGroup
APIResource
来提供服务发现结果,使用
Status
来返回出错结果。
Kubernetes
程序中,每一种型别都对应一种
Golang
的类型。所以,与
Golang
其他的类型一样,型别名字都是以单数形式出现,并以大写字母开头。
API
一组逻辑上相关的
Kind
。比如所有的批对象,
Job
ScheduledJob
都属
batch
这个
API
组。
版本
每个
API
组都允许多个版本共存,并且它们大部分也确实如此。比如有个 ...
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