This message was deleted.
# rke2
a
This message was deleted.
c
From the quickstart page you linked:
• A kubeconfig file will be written to
/etc/rancher/rke2/rke2.yaml
.
Did you want to
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml
before running kubectl?
b
Sorry if this is a stupid question, but I thought the kubeconfig that rke-server starts with would be based on the rke2.yaml anyways? rather than the other way around
c
Are you confusing the rke2.yaml kubeconfig, and the config.yaml configuration file?
The admin kubeconfig at rke2.yaml is generated by RKE2 when it starts up. It won’t exist until the rke2-server service is started the first time.
b
I see, no I didn't want to export the kubeconfig before running rke2 as far as I'm aware
c
you don’t need to export that before running rke2
just before using the kubectl CLI, so it know where to find the kubeconfig. If you don’t do that, it will try to connect to kubernetes using plain-text on port 8080, which is why you got an error.
b
Oh I see
thanks, that makes sense
Sorry, a little bit out of my wheelhouse, I do a lot of TF and Ansible but I haven't configured my own k8s on prem before
I tried exporting KUBECONFIG to the rke.yaml but kubectl config view still shows an empty/default config, I read something about ~/.kube/config ?
nevermind, solved that issue by specifying kubeconfig in kubectl commands