Skip to main content

Teardown

Follow these steps to delete your Liquid Metal workload cluster and reset your Liquid Metal platform environment.

Delete the Liquid Metal workload cluster

caution

Do not delete a CAPI-created workload cluster with kubectl delete -f cluster.yaml.

Delete the cluster using kubectl and the cluster name:

kubectl delete cluster $CLUSTER_NAME

This may take a moment as the CAPMVM controller reconciles all the MicroVMs.

Output:

cluster.cluster.x-k8s.io "lm-demo" deleted

Stop the management cluster

Use kind to delete the cluster:

kind delete cluster --name lm-management

Stop flintlockd

Use systemctl to stop and disable the service:

sudo systemctl stop flintlockd.service
sudo systemctl disable flintlockd.service

Remove the service file:

sudo rm /etc/systemd/system/flintlockd.service

Reload the daemon:

sudo systemctl daemon-reload

Check that the service is no longer there:

systemctl status flintlockd.service

Output:

Unit flintlockd.service could not be found.

Stop containerd

Use systemctl to stop and disable the service:

sudo systemctl stop containerd-dev.service
sudo systemctl disable containerd-dev.service

Remove the service file:

sudo rm /etc/systemd/system/containerd-dev.service

Reload the daemon:

sudo systemctl daemon-reload

Check that the service is no longer there:

systemctl status containerd-dev.service

Output:

Unit containerd-dev.service could not be found.

Clean up devpools

Use the dmsetup command to remove any leftover thin devices:

sudo dmsetup ls | awk '/flintlock/ {print $1}' | xargs sudo dmsetup remove -f
caution

The above command filters for devices matching flintlock. If you use device-mapper to manage other devices, and are abundantly cautious you may want, to remove flintlock- devices individually.

Verify that all have been cleared:

sudo dmsetup ls

Output:

No devices found

Detach the loop devices:

losetup | awk '/containerd-dev/ {print $1}' | xargs -I {} sudo losetup -d {}

Delete the sparse files:

sudo rm /var/lib/containerd-dev/snapshotter/devmapper/{data,metadata}

Remove the virtual network, bridge and tap device

Use virsh to destroy and undefine the network:

sudo virsh net-destroy liquid-metal
sudo virsh net-undefine liquid-metal

Check that it is no longer there:

virsh net-list

Output:

 Name       State    Autostart   Persistent
---------------------------------------------
default active yes yes

Bring the tap down and delete it:

sudo ip link set tap0 down
sudo ip link delete tap0

Verify that the tap and bridge are gone:

ip link show tap0
ip link show lmbr0

Both should return:

Device "X" does not exist.

Clean up files

Remove any leftover files or directories:

sudo rm -rf \
/var/lib/containerd-dev \
/run/containerd-dev \
/etc/containerd/config-dev.toml \
/etc/opt/flintlockd \
/var/lib/flintlock