Skip to main content

Remove a self-installed TopoLVM

From Kubernetes 1.37, TopoLVM is part of the Cluster Stack. The upgrade removes a TopoLVM you installed yourself only if it is the release csi-local in the kube-system namespace, the way described it. An install under another release name or in another namespace stays in the cluster and conflicts with the built-in TopoLVM.

Remove such an install yourself, right before you upgrade, and apply the upgrade as soon as it is gone. If you already upgraded, the same steps repair the cluster. Your volumes and the data on the servers are not touched either way.

Check your install 

List the TopoLVM workloads in the cluster:

				$ kubectl get deployment,daemonset -A -l app.kubernetes.io/name=topolvm \
    -o custom-columns='NAMESPACE:.metadata.namespace,KIND:.kind,NAME:.metadata.name,INSTANCE:.spec.selector.matchLabels.app\.kubernetes\.io/instance'
			

On 1.36, an install that follows the Syself docs looks like this, and the upgrade migrates it for you:

text
				NAMESPACE     KIND         NAME                           INSTANCE
kube-system   Deployment   csi-local-topolvm-controller   csi-local
kube-system   DaemonSet    csi-local-topolvm-node         csi-local
			

On 1.37, the built-in TopoLVM looks like this:

text
				NAMESPACE     KIND         NAME                            INSTANCE
kube-system   Deployment   topolvm-controller              cluster-addon
kube-system   Deployment   topolvm-controller-autoscaler   cluster-addon
kube-system   DaemonSet    topolvm-node                    cluster-addon
			

Any other row is an install the upgrade does not remove. Note its NAMESPACE and its INSTANCE, which is the Helm release name. You need both below.

What the old install does on 1.37 

What breaks depends on where the old install lives and which chart version it came from.

Old install After the upgrade to 1.37
Another release name in kube-system, syself/topolvm 1.4.0 Volumes work. The old controller pods stay in CrashLoopBackOff.
Another release name in kube-system, 1.3.0 or older No PVC can be created in the cluster, on any StorageClass. The error is failed calling webhook "pvc-hook.topolvm.io". It starts a few minutes into the upgrade, before any node is replaced.
Any release name in another namespace Existing volumes work. A new local-* PVC stays Pending with Logical Volume "..." already exists in volume group.
The release name topolvm in kube-system The upgrade does not start. The cluster stays on 1.36, and local volumes keep working.

Remove the old install 

These steps delete only the workloads of the old driver. Your PersistentVolumes, the LogicalVolume objects, and the data on the servers stay as they are.

Caution

Delete only the kinds listed in the commands below. Never delete the LogicalVolume objects or the logicalvolumes.topolvm.io CustomResourceDefinition, and never run kubectl delete -f on the rendered chart. The LogicalVolume objects are the record of every local volume, and deleting the CustomResourceDefinition deletes all of them.

Replace <namespace> and <release> with the values from Check your install.

Delete the PVC webhook 

The syself/topolvm chart 1.3.0 and older installed a webhook for PVCs. Check for it:

				$ kubectl get mutatingwebhookconfiguration | grep topolvm
			

If it lists a webhook, delete it by the name shown:

				$ kubectl delete mutatingwebhookconfiguration <name>
			

Delete the old workloads 

				$ kubectl -n <namespace> delete deployment,daemonset,service,serviceaccount,configmap \
    -l app.kubernetes.io/instance=<release>,app.kubernetes.io/name=topolvm
$ kubectl -n <namespace> delete poddisruptionbudget <release>-topolvm-controller
			

If your release name is topolvm, skip the second command. Its PodDisruptionBudget is named topolvm-controller, and the built-in TopoLVM takes it over.

Delete the old permissions, for an install outside kube-system 

Skip this step for an install in kube-system. Its Roles and ClusterRoles have the names the built-in TopoLVM uses, and the upgrade takes them over.

				$ kubectl -n <namespace> delete role,rolebinding \
    -l app.kubernetes.io/instance=<release>,app.kubernetes.io/name=topolvm
$ kubectl delete clusterrole,clusterrolebinding \
    -l app.kubernetes.io/instance=<release>,app.kubernetes.io/name=topolvm
			

Upgrade, or let the upgrade continue 

On 1.36, now. Between the removal and the upgrade the cluster has no local storage driver. Mounted volumes keep working, but a pod with a local volume can neither start nor finish terminating, so do not restart those workloads in between. The built-in TopoLVM runs about a minute after you apply the upgrade, and waiting pods continue by themselves.

On a cluster where the upgrade was waiting, it continues by itself within a few minutes.

Confirm the result 

Run the command from Check your install again once the cluster is on 1.37. It lists only the built-in workloads.

After removing it on 1.37 

If you removed the old install after the upgrade, the built-in TopoLVM settles within minutes:

  • The topolvm-node pod restarts once. The old node plugin removes a socket both plugins share when it stops, and the built-in pod restarts to register again. A pod with a new local volume that is scheduled in that minute reports did not have enough free storage and then starts.
  • A PVC that was Pending binds by itself. The provisioner retries with a growing delay, so it can take up to 15 minutes.

If the old install used cert-manager, its Certificates, Issuers, and Secrets named <release>-topolvm-* stay in the cluster. Nothing uses them, and you can delete them.

When to contact Syself support 

Contact Syself support before you upgrade if any of these describes your cluster:

  • You installed TopoLVM with helm install, not with helm template and kubectl apply.
  • You added or changed device classes.
  • A GitOps tool such as Argo CD or Flux applies your TopoLVM install.