Member-only story
How to find out the apiVersion
Sometimes we don’t know what should I write in the apiVersion
of the resource like Deployment, Service etc. All Kubernetes resource APIs are written differently depending on which API APIGROUP they belong to apiVersion
.
Cases:
- If you belong to a particular API GROUP then we use
apiVersion: (APIGROUP)/(APIVERSION)
- If it does not belong to a specific API GROUP it means that belongs to Core group so we use
apiVersion: v1
Check the correspondence between resources and API GROUP
We can check this with using command kubectl api-resources
. This is not implemented in the old kubectl
for example v1.12, We must remember that running this command will show us information from the current context. If we have several clusters, switch between them.
Result of kubectl command: