How to safty release (uninstallation) all the containers
I do the installation by
sudo ./auplc-installer install
To many containers are auto launched. Why there so many containers launched. And how to uninstall/realease all of them
I run this command for that ,
sudo ./auplc-installer uninstall
But still may conatainers named k8s_... which installed by auplc-installer do not be released. Like virus.
(Ryzers) alex@GZ302EA:/media/alex/MD4T/ROBOT/aup-learning-cloud$ sudo ./auplc-installer uninstall
[sudo] password for alex:
release "jupyterhub" uninstalled
Removing K3s (requires sudo)...
+ id -u
+ [ 0 -eq 0 ]
+ K3S_DATA_DIR=/var/lib/rancher/k3s
+ /usr/local/bin/k3s-killall.sh
+ [ -s /etc/systemd/system/k3s.service ]
+ basename /etc/systemd/system/k3s.service
+ systemctl stop k3s.service
+ [ -x /etc/init.d/k3s* ]
+ killtree
+ kill -9
+ do_unmount_and_remove /run/k3s
+ set +x
+ do_unmount_and_remove /var/lib/kubelet/pods
+ set +x
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/f6087dfc-a9ae-4ae5-bf21-2e0879b88e67/volumes/kubernetes.io~projected/kube-api-access-7qs28
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/f1ae93c2-e99d-45c3-93d4-d13351676a1d/volumes/kubernetes.io~projected/kube-api-access-9mgfm
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/9aa0e379-354d-45a9-a5cd-4557b7bae6d7/volumes/kubernetes.io~projected/kube-api-access-f4mxf
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/5f0ac7b8-b984-4818-b089-8e6446faf2ba/volumes/kubernetes.io~projected/kube-api-access-87b2w
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/2af818c8-ed3f-4bf3-bc5c-9487482a6937/volumes/kubernetes.io~projected/kube-api-access-pthzz
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/20f5474b-9ce2-4ddc-9a2a-8e109195df2d/volumes/kubernetes.io~projected/kube-api-access-mlhnb
+ do_unmount_and_remove /var/lib/kubelet/plugins
+ set +x
+ do_unmount_and_remove /run/netns/cni-
+ set +x
+ ip netns show
+ grep cni-
+ xargs -r -t -n 1 ip netns delete
+ remove_interfaces
+ ip link show
+ grep master cni0
+ read ignore iface ignore
+ iface=vethc3f80a17
+ [ -z vethc3f80a17 ]
+ ip link delete vethc3f80a17
+ read ignore iface ignore
+ iface=veth7ec8f29c
+ [ -z veth7ec8f29c ]
+ ip link delete veth7ec8f29c
+ read ignore iface ignore
+ iface=vethed78f15d
+ [ -z vethed78f15d ]
+ ip link delete vethed78f15d
+ read ignore iface ignore
+ iface=veth0e4798e1
+ [ -z veth0e4798e1 ]
+ ip link delete veth0e4798e1
+ read ignore iface ignore
+ iface=veth559b417b
+ [ -z veth559b417b ]
+ ip link delete veth559b417b
+ read ignore iface ignore
+ iface=veth6eee05c5
+ [ -z veth6eee05c5 ]
+ ip link delete veth6eee05c5
+ read ignore iface ignore
+ iface=veth722c7d52
+ [ -z veth722c7d52 ]
+ ip link delete veth722c7d52
+ read ignore iface ignore
+ ip link delete cni0
+ ip link delete flannel.1
+ ip link delete flannel-v6.1
Cannot find device "flannel-v6.1"
+ ip link delete kube-ipvs0
Cannot find device "kube-ipvs0"
+ ip link delete flannel-wg
Cannot find device "flannel-wg"
+ ip link delete flannel-wg-v6
Cannot find device "flannel-wg-v6"
+ command -v tailscale
+ [ -n ]
+ rm -rf /var/lib/cni/
+ iptables-save
+ grep -v KUBE-
+ grep -v CNI-
+ grep -iv flannel
+ iptables-restore
+ ip6tables-save
+ grep -v KUBE-
+ grep -v CNI-
+ grep -iv flannel
+ ip6tables-restore
+ command -v systemctl
/usr/bin/systemctl
+ systemctl disable k3s
Removed "/etc/systemd/system/multi-user.target.wants/k3s.service".
+ systemctl reset-failed k3s
+ systemctl daemon-reload
+ command -v rc-update
+ rm -f /etc/systemd/system/k3s.service
+ rm -f /etc/systemd/system/k3s.service.env
+ trap remove_uninstall EXIT
+ [ -L /usr/local/bin/kubectl ]
+ rm -f /usr/local/bin/kubectl
+ [ -L /usr/local/bin/crictl ]
+ rm -f /usr/local/bin/crictl
+ [ -L /usr/local/bin/ctr ]
+ rm -rf /etc/rancher/k3s
+ rm -rf /run/k3s
+ rm -rf /run/flannel
+ clean_mounted_directory /var/lib/rancher/k3s
+ grep -q /var/lib/rancher/k3s /proc/mounts
+ rm -rf /var/lib/rancher/k3s
+ return 0
+ rm -rf /var/lib/kubelet
+ rm -f /usr/local/bin/k3s
+ rm -f /usr/local/bin/k3s-killall.sh
+ type yum
+ type rpm-ostree
+ type zypper
+ remove_uninstall
+ rm -f /usr/local/bin/k3s-uninstall.sh
K3s removed successfully.
Removing kubeconfig files from /root/.kube...
Removing kubeconfig for user: alex
Removing K3S local data
Removing dummy interface service...
Removing dummy interface...
(Ryzers) alex@GZ302EA:/media/alex/MD4T/ROBOT/aup-learning-cloud$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ae045c665e36 rocm/tensorflow "/bin/bash -c -- 'py…" About an hour ago Up About an hour k8s_alexnet-tf-gpu-container_alexnet-tf-gpu-pod_default_f6087dfc-a9ae-4ae5-bf21-2e0879b88e67_0
01dceac015fc rancher/mirrored-library-traefik "/entrypoint.sh --en…" About an hour ago Up About an hour k8s_traefik_traefik-788bc4688c-xzrrm_kube-system_20f5474b-9ce2-4ddc-9a2a-8e109195df2d_0
33e429452246 rancher/local-path-provisioner "local-path-provisio…" About an hour ago Up About an hour k8s_local-path-provisioner_local-path-provisioner-546dfc6456-7slqf_kube-system_f1ae93c2-e99d-45c3-93d4-d13351676a1d_0
8d3833c29fe1 rancher/mirrored-coredns-coredns "/coredns -conf /etc…" About an hour ago Up About an hour k8s_coredns_coredns-695cbbfcb9-w66nq_kube-system_5f0ac7b8-b984-4818-b089-8e6446faf2ba_0
43c79e1e4815 rancher/mirrored-pause:3.6 "/pause" About an hour ago Up About an hour k8s_POD_traefik-788bc4688c-xzrrm_kube-system_20f5474b-9ce2-4ddc-9a2a-8e109195df2d_0
dedd48a30c34 rancher/mirrored-metrics-server "/metrics-server --c…" About an hour ago Up About an hour k8s_metrics-server_metrics-server-c8774f4f4-j4ffw_kube-system_2af818c8-ed3f-4bf3-bc5c-9487482a6937_0
f3b74648b158 bad18bcf3410 "entry" About an hour ago Up About an hour k8s_lb-tcp-443_svclb-traefik-2ef624fb-cdz4k_kube-system_8f942197-4c7c-46b8-b14e-0fed176d88ba_0
cd08c49f04c9 rancher/klipper-lb "entry" About an hour ago Up About an hour k8s_lb-tcp-80_svclb-traefik-2ef624fb-cdz4k_kube-system_8f942197-4c7c-46b8-b14e-0fed176d88ba_0
45aaede48766 rancher/mirrored-pause:3.6 "/pause" About an hour ago Up About an hour k8s_POD_alexnet-tf-gpu-pod_default_f6087dfc-a9ae-4ae5-bf21-2e0879b88e67_0
3a166bd7b921 rocm/k8s-device-plugin "./k8s-device-plugin…" About an hour ago Up About an hour k8s_amdgpu-dp-cntr_amdgpu-device-plugin-daemonset-n5p42_kube-system_9aa0e379-354d-45a9-a5cd-4557b7bae6d7_0
ea5da820d354 rancher/mirrored-pause:3.6 "/pause" About an hour ago Up About an hour k8s_POD_svclb-traefik-2ef624fb-cdz4k_kube-system_8f942197-4c7c-46b8-b14e-0fed176d88ba_0
9f6e7152787a rancher/mirrored-pause:3.6 "/pause" 2 hours ago Up 2 hours k8s_POD_local-path-provisioner-546dfc6456-7slqf_kube-system_f1ae93c2-e99d-45c3-93d4-d13351676a1d_0
ef87140543b8 rancher/mirrored-pause:3.6 "/pause" 2 hours ago Up 2 hours k8s_POD_metrics-server-c8774f4f4-j4ffw_kube-system_2af818c8-ed3f-4bf3-bc5c-9487482a6937_0
e7ad66cebe2f rancher/mirrored-pause:3.6 "/pause" 2 hours ago Up 2 hours k8s_POD_amdgpu-device-plugin-daemonset-n5p42_kube-system_9aa0e379-354d-45a9-a5cd-4557b7bae6d7_0
0e3804c0e3da rancher/mirrored-pause:3.6 "/pause" 2 hours ago Up 2 hours k8s_POD_coredns-695cbbfcb9-w66nq_kube-system_5f0ac7b8-b984-4818-b089-8e6446faf2ba_0
(Ryzers) alex@GZ302EA:/media/alex/MD4T/ROBOT/aup-learning-cloud$
Hi, we use k3s—a lightweight Kubernetes distribution—for our infrastructure. Since it is still Kubernetes, you will see some containers starting up that are not part of aup-learning-cloud.
About the issue with images still running: I believe this is a bug within k3s uninstall script. The original cleanup script only covers restarting the Docker systemd unit. Once you manually restart that unit, you will find that all containers have stopped. We should consider adding this operation to our auplc-installer script.
Hi @alexhegit.
When auplc-installer sets up k3s with the --docker flag, all Pod containers are managed by Docker and show up in docker ps with a k8s_ prefix. The problem is that k3s's uninstall script only cleans up its own embedded containerd — it has no Docker API calls at all, so those containers are silently left behind. This has been a known upstream issue since 2019 (k3s-io/k3s#1469) and the k3s team hasn't fixed it.
For now you can clean them up manually:
docker rm -f $(docker ps -a -q --filter 'label=io.kubernetes.pod.name')
We've implemented the fix in #46 — auplc-installer uninstall will handle this automatically. Will merge once tested.