https://pulumi.com logo
#kubernetes
Title
# kubernetes
l

limited-rainbow-51650

04/01/2021, 12:01 PM
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

brave-planet-10645

04/01/2021, 12:49 PM
Do you mean the versions of kubernetes API or the versions of the group/resource (so
autoscaling/v1
)?
l

limited-rainbow-51650

04/01/2021, 1:41 PM
@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

brave-planet-10645

04/01/2021, 2:28 PM
GKE and EKS seem to have an output for the version (
masterVersion
and
platformVersion
respectively). Can you use that?
l

limited-rainbow-51650

04/01/2021, 2:37 PM
b

brave-planet-10645

04/01/2021, 2:39 PM
It's an assumption but yes
4 Views