Kubernetes 101: APIs groups and versions for kubernetes resources in Yaml files
When we issue a command to the kubernetes cluster, we are interacting with the API server, which is the entry point to the kubernetes cluster.
The kubernetes APIs are divided into different groups depending on their role in the kubernetes cluster.
Displaying resources and their API group:
We can display the kubernetes objects and the API group they belong to using the below command:
We get the Name of the resource and its API version and also the Kind (we use "kind" in theYaml configuration files).
API Group/Version:
We can check the latest information about the API groups in the kubernetes page as below:
It is what we use in the configuration Yaml file, for example:
The format of the "api-version" is "Group/Version", as we can see in the below examples ( taken from the Yaml configuration files)
The above hierarchy of the "service" is reflected in the configuration Yaml file used for the kubernetes service object:
It is what we use in the configuration Yaml file, for example:
The Kubernetes APIs hierarchy:
For the API we have the "core API":
And we have also the "named API":
Named API: apps/v1
Core API: v1
Digging inside the kubernetes components:
We can investigate the "services" resources for example, using the below command:
We can investigate the "services" resources for example, using the below command:
We dig deeper into the "services.spec":
We can go even deeper into the "services.spec.type":
Comments