How to Restore the fleet-local namespace if it gets deleted accidently
Article Number: 000020994
Environment
Rancher 2.x
Situation
The fleet-local namespace in the local cluster is showing a Pending state in the Rancher dashboard, or a Terminating state with kubectl.
Resolution
Prepare to clean up the related helm chart, to let Rancher reinstall it again.
Requirements:
- A kubeconfig for the Rancher (local) management cluster
- The helm CLI
If you don't have a kubeconfig for the local cluster, the steps here can be used to retrieve one from the control plane node in the cluster.
1. Check that the kubeconfig is set for the correct cluster
export KUBECONFIG=/path/to/kubeconfig.yaml
kubectl get nodes
2. Delete the fleet chart using helm
helm uninstall fleet -n cattle-fleet-system
3. Perform a rollout restart of the Rancher deployment, this will trigger the recreation of fleet-local and its associated contents
kubectl rollout restart deploy/rancher -n cattle-system
Note, this may cause a small interruption for users as the websocket tunnel to Rancher will be re-established.
4. Check the fleet/fleet-crd apps are installed and active