I would like to automate our deployments, but want...
# kubernetes
l
I would like to automate our deployments, but want our abstractions to take into account the changes between versions of Kubernetes, e.g. APIs being promoted which leads to other resource versions, different annotations etc. What is the best way to find out against which version of Kubernetes we are working? So far I looked in the Kubernetes
Provider
class but that doesn’t expose the info. Is there a standard way of getting this using the
pulumi-kubernetes
provider?
👍 1
b
Do you mean the versions of kubernetes API or the versions of the group/resource (so
autoscaling/v1
)?
l
@brave-planet-10645 I guess the code in the k8s provider have various levels for certain resources like
v1alpha1
,
v1beta1
and
v1
to support setting these up on different versions of k8s. Now, it is usually based on the main k8s version (e.g. 1.16, 1.17, …) that one has to find out which versions of the resources and annotations one has to use. So I’m in need of the main k8s version.
b
GKE and EKS seem to have an output for the version (
masterVersion
and
platformVersion
respectively). Can you use that?
l
b
It's an assumption but yes