Does anyone know how to dynamically get the kubern...
# kubernetes
g
Does anyone know how to dynamically get the kubernetes server/API version when instantiating a provider that has serverSideApply enabled? I'd like to know the version of the API so I know which version of a resource to create, e,g. I need to use
<http://flowcontrol.apiserver.k8s.io/v1beta3|flowcontrol.apiserver.k8s.io/v1beta3>
on k8s >=1.29 I'd like to avoid carte-blanche changing this to v1beta3 on all the other clusters I have with this project that are on 1.28.
Copy code
Retry #0; creation failed: no matches for kind "FlowSchema" in version "flowcontrol.apiserver.k8s.io/v1beta2"
g
Maybe you can check with the k8s sdk and do something equivalent to :
k api-resources --api-group=<http://flowcontrol.apiserver.k8s.io|flowcontrol.apiserver.k8s.io>
and see what
apiversion
is available ?
if you use helm, you can do that with the helm api
g
I just decided to use the kubernetes python lib and look it up
Untitled.py