- The Kubernetes Workshop
- Zachary Arnold Sahil Dua Wei Huang Faisal Masood Melony Qin Mohammed Abu Taleb
- 509字
- 2021-06-11 18:18:00
API Groups
An API group is a collection of resources that are logically related to each other. For example, Deployments, ReplicaSets, and DaemonSets all belong to the apps API group: apps/v1.
Note
You will learn about Deployments, ReplicaSets, and DaemonSets in detail in Chapter 7, Kubernetes Controllers. In fact, this chapter will talk about many API resources that you will encounter in later chapters.
The --api-group flag can be used to scope the output to a specific API group, as we will see in the following sections. Let's take a closer look at the various API groups in the following sections.
Core Group
This is also called the legacy group. It contains objects such as pods, services, nodes, and namespaces. The URL path for these is /api/v1, and nothing other than the version is specified in the apiVersion field. For example, consider the following screenshot where we are getting information about a pod:

Figure 4.25: API group of a pod
As you can see here, the apiVersion: v1 field indicates that this resource belongs to the core group.
Resources showing a blank entry in the kubectl api-resources command output are part of the core group. You can also specify an empty argument flag (--api-group='') to only display the core group resources, as follows:
kubectl api-resources --api-group=''
You should see an output as follows:

Figure 4.26: Listing out the resources in the core API group
Named Group
This group includes objects for whom the request URL is in the /apis/$NAME/$VERSION format. Unlike the core group, named groups contain the group name in the URL. For example, let's consider the following screenshot where we have information about a Deployment:

Figure 4.27: The API group of a Deployment
As you can see, the highlighted field showing apiVersion: apps/v1 indicates that this resource belongs to the apps API group.
You can also specify the --api-group='<NamedGroup Name>' flag to display the resources in that specified named group. For example, let's list out the resources under the apps API group by using the following command:
kubectl api-resources --api-group='apps'
This should give the following response:

Figure 4.28: Listing out the resources in the apps API group
All of these resources in the preceding screenshot are clubbed together because they are part of the apps named group, which we specified in our query command.
As another example, let's look at the rbac.authorization.k8s.io API group, which has resources to determine authorization policies. We can look at the resources in that group by using the following command:
kubectl api-resources --api-group='rbac.authorization.k8s.io'
You should see the following response:

Figure 4.29: Listing out the resources in the rbac.authorization.k8s.io API group
System-Wide
This group consists of system-wide API endpoints, such as /version, /healthz, /logs, and /metrics. For example, let's consider the output of the following command:
kubectl version --short --v=6
This should give an output similar to this:

Figure 4.30: Request URL for the kubectl version command
As you can see in this screenshot, when you run kubectl --version, this goes to the /version special entity, as seen in the GET request URL.
- Application Development with Qt Creator(Second Edition)
- 解析QUIC/HTTP3:未來(lái)互聯(lián)網(wǎng)的基石
- 數(shù)據(jù)通信網(wǎng)絡(luò)實(shí)踐:基礎(chǔ)知識(shí)與交換機(jī)技術(shù)
- C++黑客編程揭秘與防范
- 異構(gòu)基因共表達(dá)網(wǎng)絡(luò)的分析方法
- TCP/IP入門經(jīng)典(第5版)
- 無(wú)人機(jī)通信
- PLC、現(xiàn)場(chǎng)總線及工業(yè)網(wǎng)絡(luò)實(shí)用技術(shù)速成
- 物聯(lián)網(wǎng)通信技術(shù)
- 網(wǎng)絡(luò)基礎(chǔ)與網(wǎng)絡(luò)管理項(xiàng)目化教程
- Unity Artificial Intelligence Programming
- 面向5G-Advanced的關(guān)鍵技術(shù)
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 物聯(lián)網(wǎng)的機(jī)遇與利用
- Cisco無(wú)線局域網(wǎng)配置基礎(chǔ)