3

So I am trying to deploy rancher on my K3S cluster.
I installed it using the documentation and helm: Rancher documentation While I am getting access using my loadbalancer. I cannot find the secret to insert into the setup.

They discribe the following command for getting the token:

kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}{{ "\n" }}'

When I run this I get the following error

Error from server (NotFound): secrets "bootstrap-secret" not found

And also I cannot find the bootstrap-secret inside the namespace cattle-system.
So can somebody help me out where I need to look?

kevingoos
  • 3,785
  • 4
  • 36
  • 63
  • It seems, you need to specify the password while installing it with HELM https://rancher.com/docs/rancher/v2.6/en/installation/resources/bootstrap-password/#specifying-the-bootstrap-password-in-helm-installs – Suresh Vishnoi Feb 16 '22 at 09:46

1 Answers1

10

I was with the same problem. So I figured it out with the following commands:

  1. I installed the helm chart with "--set bootstrapPassword=Changeme123!", for example:

    helm upgrade --install
    --namespace cattle-system
    --set hostname=rancher.example.com
    --set replicas=3
    --set bootstrapPassword=Changeme123!
    rancher rancher-stable/rancher

  2. I forced a hard reset, because even if I had setted the bootstrap password in the installation helm chart command, I was not able to login. So, I used the following command to hard reset:

    kubectl -n cattle-system exec $(kubectl -n cattle-system get pods -l app=rancher | grep '1/1' | head -1 | awk '{ print $1 }') -- reset-password

So, I hope that can help you.