Lost rancher-cluster.yml for RKE

I’m running a Rancher v2.2.9 HA cluster, rancher was installed through helm (they followed https://rancher.com/docs/rancher/v2.x/en/installation/ha/)

Now I want to make and check our snapshots can be restored, but I don’t have the rancher-cluster.yml for the cluster. I do have the admin kubeconfig.yml

Is there any way I can generate it from the cluster? Are there other alternatives on how to proceed?

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

Thank you! I was able to recreate .rkestate and the minimal cluster config was enough

I did create a script building both files.