Skip to main content

rancher 패스워드 초기화 방법

rancher를 설치하고 나서 root사용자 패스워드 초기화가 필요한 경우 수행하면 됩니다.

작업방법

  1. rancher pod 정보 확인
    $> kubectl get pod -A | grep rancher
    cattle-system                  rancher-c56764479-nt7nb                             1/1     Running   3 (3d2h ago)    45d
    

  2. rancher pod가 어느노드에서 떴는지 확인
    $> kubectl describe pod rancher-c56764479-nt7nb -n cattle-system
    Name:                 rancher-c56764479-nt7nb
    Namespace:            cattle-system
    Priority:             1000000000
    Priority Class Name:  rancher-critical
    Node:                 test2/192.168.0.25
    Start Time:           Thu, 21 Sep 2023 00:51:03 +0900
    Labels:               app=rancher
                          pod-template-hash=c56764479
                          release=rancher
    Annotations:          cni.projectcalico.org/containerID: f44aa8d23b68a7376bc29e0bc66605670dc5a87daa9c668bd4f241aa4b63b492
                          cni.projectcalico.org/podIP: 10.233.64.107/32
                          cni.projectcalico.org/podIPs: 10.233.64.107/32
    Status:               Running
    IP:                   10.233.64.107
    IPs:
      IP:           10.233.64.107
    Controlled By:  ReplicaSet/rancher-c56764479
    

  3. rancher 컨테이너 정보 확인 (test2노드에서 실행)
    $> crictl ps | grep rancher
    a68dc79ee1d8c       81ee0878ffcdc       26 minutes ago      Running             rancher                              3                   f44aa8d23b68a       rancher-c56764479-nt7nb
    

  4. rancher 컨테이너로 패스워드 초기화 (test2노드에서 실행)
    $> crictl exec a68dc79ee1d8c reset-password
    W1104 17:53:31.241158     386 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
    New password for default admin user (user-q2kl4):
    123123

reference