How to get Complete Kubernetes Version from RKE(Rancher)? How to detect RKE Cluster? #4953
-
I have a RKE Cluster after I export the cluster.yaml via CLI and Query the cluster via CLI with kubectl version command, ending up with below information
Expected : GitVersion:"v1.26.8-rancher1-1" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Are you sure you're actually using RKE2 on the cluster in question? The output you provided does not look like what I would expect from this distribution. Here is what I see: brandond@dev01:~$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.3", GitCommit:"aef86a93758dc3cb2c658dd9657ab4ad4afc21cb", GitTreeState:"clean", BuildDate:"2022-07-13T14:30:46Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.17+rke2r1", GitCommit:"22a9682c8fe855c321be75c5faacde343f909b04", GitTreeState:"clean", BuildDate:"2023-08-24T04:20:55Z", GoVersion:"go1.20.7 X:boringcrypto", Compiler:"gc", Platform:"linux/amd64"} Note: |
Beta Was this translation helpful? Give feedback.
As per the logic in employed https://github.com/rancher/kubernetes-provider-detector/blob/master/providers/rke.go, it seems like there will not be any distribution info for the RKE in Server Version Info. We can rely on the following annotations of node ("rke.cattle.io/external-ip","rke.cattle.io/internal-ip") to decide RKE cluster.
Thanks for all the help!