Rancher Server: v2.6.8
Kubernetes Cluster: RKE2
Version: v1.24.4+rke2r1
Hi there, I have created a RKE2 cluster via Rancher Server. I downloaded the kubeconfig file from Rancher UI, and I was trying to access the cluster with kubectl and kubeconfig. I was able to access the cluster via Rancher Server’s context. However, if I access that cluster directly using:
kubectl --kubeconfig /custom/path/kube.config --context <CLUSTER_NAME>-<NODE_NAME> get pods
as describe here: Access a Cluster with Kubectl and kubeconfig | Rancher Manager
I got an error “error: You must be logged in to the server (Unauthorized)”
Is there anyone know the reason why? And how to fix it?
Thanks!