From 12997d20372671c4f27d01ba2dc56b05d32c6fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Tue, 21 Apr 2026 21:33:56 +0000 Subject: [PATCH] modified: README.md new file: manifests/alpine-deployment.yaml new file: manifests/debian-deployment.yaml --- README.md | 33 ++++++++++++++++++++++++++++++++ manifests/alpine-deployment.yaml | 10 ++++++++++ manifests/debian-deployment.yaml | 20 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 manifests/alpine-deployment.yaml create mode 100644 manifests/debian-deployment.yaml diff --git a/README.md b/README.md index 41a132d..db26efb 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Kubernetes is an open‑source platform that automates the deployment, scaling, - [Failed unmounting var-lib-rancher.mount on reboot](#failed-unmounting-var-lib-ranchermount-on-reboot) - [klipper-lb](#klipper-lb) - [troubleshooting](#troubleshooting) + - [Containerd state](#containerd-state) - [host cli](#host-cli) - [host cli - check port usage](#host-cli---check-port-usage) - [kill all connections](#kill-all-connections) @@ -786,6 +787,38 @@ rm -rf /var/lib/rancher/k3s/agent/etc/klipper-lb systemctl restart k3s-agent ``` +### Containerd state + +This procedure simulates a fresh node joining the cluster. +It deletes all containerd runtime state but does not remove the node from the cluster. + +1. Stop k3s (server or agent) +1. Delete containerd state + + ```bash + sudo rm -rf /var/lib/rancher/k3s/agent/containerd + sudo rm -rf /var/lib/containerd + ``` + +1. Start k3s + + **What this does:** + +- Removes all images, snapshots, and container metadata +- Forces k3s to repull every image through CRI → mirrors → Harbor +- Simulates a fresh node rebuild +- Node identity, certificates, and cluster membership remain intact +- Workloads are rescheduled normally +- This is the correct method to validate offline rebuild capability and ensure Harbor mirrors are complete. + +If all container images are provided locally (Example: through Harbor proxy caches), then the entire containerd image store becomes fully ephemeral. +This means: + +- /var/lib/rancher/k3s/agent/containerd +- /var/lib/containerd + +contain no unique or irreplaceable data. so it can be ignored on backups. + ## host cli ### host cli - check port usage diff --git a/manifests/alpine-deployment.yaml b/manifests/alpine-deployment.yaml new file mode 100644 index 0000000..2b28c3d --- /dev/null +++ b/manifests/alpine-deployment.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Pod +metadata: + name: alpine +spec: + containers: + - name: alpine + image: docker.io/library/alpine:latest + command: ["sh", "-c", "echo OK && sleep 3600"] + restartPolicy: Never \ No newline at end of file diff --git a/manifests/debian-deployment.yaml b/manifests/debian-deployment.yaml new file mode 100644 index 0000000..433ab8b --- /dev/null +++ b/manifests/debian-deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: debian + labels: + app: debian +spec: + replicas: 1 + selector: + matchLabels: + app: debian + template: + metadata: + labels: + app: debian + spec: + containers: + - name: debian + image: debian:latest + command: ["sleep", "infinity"]