https://rancher.com/ logo
Title
e

enough-guitar-28913

04/18/2023, 11:06 PM
What is the Kubernetes ServerVersion() values set in rancher ? Basically I want to know what is the Version Info{} when I invoke
client.Discovery().ServerVersion()
. Has anyone tried this before ?
c

creamy-pencil-82913

04/18/2023, 11:18 PM
it’ll just tell you whatever the underlying Kubernetes cluster version is. Not the Rancher version.
it’s the same thing you’d get from
kubectl version -o yaml
e

enough-guitar-28913

04/18/2023, 11:23 PM
In that case, how can we know the rancher version programmatically ? Any hints here would be very helpful
it’ll just tell you whatever the underlying Kubernetes cluster version is. Not the Rancher version.
I was assuming it would return something like this
Server Version: v1.21.1-rancher
c

creamy-pencil-82913

04/18/2023, 11:26 PM
depends if you’re using rke, or rke2, or k3s…