Lost rancher-cluster.yml for RKE

You would need to recreate the rancher_cluster.yml and rancher_cluster.rkestate files.

rkestate file
kubectl --kubeconfig kube_config_cluster.yml get configmap -n kube-system full-cluster-state -o json | jq -r .data.“full-cluster-state” | jq -r . > rancher_cluster.rkestate

You need to manually create the rancher_cluster.yml using the data in the rkestate file.

Example config
https://rancher.com/docs/rke/latest/en/example-yamls/#minimal-cluster-yml-example

Then run a rke up --config rancher_cluster.yml

2 Likes