Uninstalling
Work through these steps in order. The management cluster cleans up the Proxmox VE objects of the clusters it created. The appliance holds the only copy of the management cluster's state.
- Delete the clusters.
- Remove the management cluster.
- Remove the appliance.
- Remove the Proxmox VE interface entry, where it was added.
Delete the clusters
Delete every cluster from its page (Delete, then type its name), or with kubectl:
kubectl annotate clusters.cluster.x-k8s.io --all --all-namespaces kubehenge.dev/allow-deletion=true
kubectl delete clusters.cluster.x-k8s.io --all --all-namespacesThe annotation lifts the guard that refuses deleting a cluster with kubectl alone (details).
Deleting a cluster deletes its VMs and persistent volumes and takes it out of Rancher where it was registered. Kubehenge's controller then removes its Proxmox VE pool, user, token and volume owner VM (details). A cluster is gone when it no longer shows in the list.
Deleting the cluster that runs Rancher takes every cluster registered there out of Rancher first.
Remove the management cluster
In the appliance
On the Administration page, Remove Kubehenge takes the word remove, and the state passphrase where one is required. It refuses while any cluster exists or a run of the management cluster is going on. A wrong passphrase stops it before anything is deleted. It then:
- deletes the VM templates in the template pool,
kubehenge-templates. - switches automatic upgrades of the management cluster off (upgrading.md). It deletes what the appliance kept for them and the user
kubehenge-upgrader@pvewith its token. - destroys the management cluster with OpenTofu, with every Proxmox VE object its module made (below). It lifts the protection of the management VMs first.
- switches the backups of its etcd off and deletes the access key and talosconfig the appliance kept for them. The snapshots stay in the target.
- keeps the backup volume: the VM
kubehenge-backups, taggedbackups, with its one disk. It is protected and sits in no pool. Tick Delete the backup volume in the Remove Kubehenge dialog, and the removal lifts its protection and deletes it too, with the appliance's copy.
A removal that stopped part way can be run again. When the management cluster no longer answers, the removal goes on if Proxmox VE holds none of its VMs (the pool kubehenge-management). Otherwise it names the VMs and refuses. Start them, or remove them in Proxmox VE after qm set <vmid> --protection 0 on each.
After removal in the appliance
The page follows the log. The appliance stays and returns to its first run with the last settings filled in. The state is deleted. Its key stays, since the remaining backups are sealed with it. Removal needs the same privileges on / as the setup.
With Terraform/OpenTofu
Delete the clusters first. Then delete the templates in the template pool (kubehenge template delete, or delete the VMs), because Proxmox VE refuses to delete a pool that still holds VMs.
Lift the protection on each VM in the pool kubehenge-management, in the shell of its node as root, then destroy:
qm set <vmid> --protection 0
tofu destroyDestroy removes every Proxmox VE object the module made (below). The proxmox_objects output lists them, to check against afterwards.
The backup volume's VM is protected, so Proxmox VE refuses to destroy it. To keep the backups, take it out of the state first:
tofu state rm proxmox_virtual_environment_vm.backups
tofu destroyTo delete them too, set backup_volume = { protection = false }, run tofu apply, then tofu destroy. To delete a kept volume later, in the shell of its node as root:
qm set <vmid> --protection 0
qm destroy <vmid>What the module made
The names below are the defaults. The users, groups and roles start with the management cluster's name, kubehenge unless another was set.
- the management cluster's VMs, and the Talos disk image on each node.
- the pools:
kubehenge-managementfor the management cluster,kubehengefor the workload clusters andkubehenge-templatesfor the VM templates. - the VM
kubehenge-backups, the backup volume. It is protected and sits in no pool (above). - the users, each with its API token:
kubehenge-cluster-api@pvefor Cluster APIkubehenge-provisioner@pvefor Kubehenge's controllerkubehenge-management-csi@pvefor the management cluster's CSI pluginkubehenge-management-zones@pvefor reading where the management VMs runkubehenge-ha@pvewhere Proxmox VE HA is onkubehenge-etcd-restore@pvewhere etcd restores are onkubehenge-template-builder@pvewhere the weekly template build is on
- the groups:
kubehenge-clusters, which every cluster's user joins, andkubehenge-clusters-audit, for the HA rule labels, unless they were switched off for every cluster. - the roles, each named
kubehenge-…, and the permissions that grant them.
Remove the appliance
Remove the management cluster first. Without the appliance its state is gone. Everything the setup made then has to be found and deleted by hand (the list).
In the shell of the node the appliance runs on, as root:
pct set <ctid> --protection 0
pct stop <ctid>
pct destroy <ctid> --purgeThe appliance is the container tagged kubehenge. The installer protects it, so Proxmox VE refuses to destroy it until --protection 0. --purge also takes it out of backup jobs, replication jobs and HA.
Starting over
For a lost state passphrase, or to set up again from nothing:
- Delete every cluster in the interface and wait until the management cluster has cleaned up their Proxmox VE objects.
- In Proxmox VE, delete what the setup made:
- the VMs in the pools
kubehenge-management(the management cluster) andkubehenge-templates(the VM templates), then the poolskubehenge-management,kubehenge-templatesandkubehenge. The management VMs are protected: runqm set <vmid> --protection 0on each first. - the VM
kubehenge-backups, which sits in no pool, unless you keep the backups. It is protected: runqm set <vmid> --protection 0first. - the users
kubehenge-cluster-api@pve,kubehenge-provisioner@pve,kubehenge-management-csi@pve,kubehenge-management-zones@pveand those of the settings that were on. Their API tokens go with them.kubehenge-template-builder@pve(template refresh)kubehenge-ha@pve(Proxmox VE HA)kubehenge-etcd-restore@pve(etcd restores)kubehenge-upgrader@pve(automatic upgrades of the management cluster)
- the groups
kubehenge-clustersand, where HA rule labels were on,kubehenge-clusters-audit. - the roles named
kubehenge-…. - the Talos disk image,
talos-<version>-<id>-nocloud-amd64.qcow2, on the Talos image storage of each node that ran the management cluster.
- the VMs in the pools
- Remove the appliance and install it again.
Remove the Proxmox VE interface entry
On every node where the Kubernetes entry was added (when installing the appliance, or by the entry's own installer), as root:
sh /usr/local/sbin/kubehenge-pve-entry --removeThis takes the line out of Proxmox VE's page template and removes the entry's script, its setting, the apt hook and the installed copy itself. Reload Proxmox VE's interface in the browser afterwards.
What stays on Proxmox VE
These stay on Proxmox VE after removal:
- The Debian container template the installer downloaded, on the storage it named.
pveam list <storage>shows it,pveam removedeletes it. - Backups of the appliance in your backup storages. They hold the management cluster's state, encrypted with the state's key, which they hold too.
- API tokens you made for Terraform/OpenTofu or for
kubehenge template create. Remove them withpveum user token remove. - ACLs and roles you added to share clusters, on the workload pool, storages and bridges.
- Templates outside the template pool, if you created any with another
--pool. - Redirect URLs registered with identity providers for the interface's OpenID sign-in and the shared Headlamp.
- The storages' content types you enabled for Kubehenge, such as
importonlocal.