List Kubernetes resources by apiVersion

5/7/2020

Is there a easy way to list all kubernetes objects related to an API version? Lets say, API version apps/v1beta1 is getting deprecated and I want to know if I have any objects in my cluster using this version, how can I find such objects?

-- Harshal Shah
kube-apiserver
kubernetes

2 Answers

5/11/2020

The reason I asked this question was that I was upgrading my kubernetes cluster from v1.15 to v1.16 and this brings a lot of breaking changes

The kubepug tool allowed me to easily find a list of resources that I need to change to be able to upgrade seamlessly from 1.15 to 1.16

-- Harshal Shah
Source: StackOverflow

5/8/2020

you can do something similar like this

kubectl get pod -o=custom-columns=NAME:.metadata.name,API-version:.metadata.owner_references[].api_version

by using kubectl just print respective data and api version

-- Harsh Manvar
Source: StackOverflow