Skip to content

fix(urunc-cleanup): remove unnecessary k3s volume mount and redundant label removal - #994

Open
saitejagirada wants to merge 3 commits into
urunc-dev:mainfrom
saitejagirada:fix/cleanup-remove-unnecessary-k3s-mount-and-redundant-label
Open

fix(urunc-cleanup): remove unnecessary k3s volume mount and redundant label removal#994
saitejagirada wants to merge 3 commits into
urunc-dev:mainfrom
saitejagirada:fix/cleanup-remove-unnecessary-k3s-mount-and-redundant-label

Conversation

@saitejagirada

Copy link
Copy Markdown

Description

Two small fixes for the urunc-cleanup deployment:

  1. Remove unnecessary k3s volume mount: The urunc-cleanup DaemonSet's k3s overlay mounts /var/lib/rancher/k3s/agent/etc/containerd/ into the pod, but the reset code path in install.sh never accesses any files under /etc/containerd/. It only uses kubectl (API calls) and nsenter (host PID namespace syscalls). The mount was a copy-paste from the urunc-deploy overlay where it is needed for the install/cleanup paths that modify containerd config via tomlq. Removing it reduces the attack surface of the privileged cleanup pod.

  2. Remove redundant kubectl label call: The reset) case block at line 395 runs kubectl label node "$NODE_NAME" urunc.io/urunc-runtime-, then calls reset_runtime() which runs the same command again at line 308. The duplicate is removed from reset_runtime(), keeping the label removal in the reset) case block where it logically belongs.

Related issues

How was this tested?

  • Verified both kubectl kustomize deployment/urunc-deploy/urunc-cleanup/base/ and kubectl kustomize deployment/urunc-deploy/urunc-cleanup/overlays/k3s/ build successfully after changes
  • Confirmed k3s overlay output is now identical to the base (no containerd volumes)
  • Ran bash -n deployment/urunc-deploy/scripts/install.sh — syntax OK
  • Traced the full reset code path: main("reset") → kubectl label → reset_runtime() → restart_cri_runtime() → host_systemctl → wait_till_node_is_ready() — confirmed zero filesystem operations on /etc/containerd/

LLM usage

An LLM (Google Antigravity / Claude Opus 4.6) assisted with code path analysis and tracing. All findings were independently verified by reading the source code and running kustomize builds.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

The urunc-cleanup DaemonSet runs install.sh with the 'reset' action,
which only uses kubectl API calls and nsenter syscalls to restart the
CRI runtime. It never accesses any files under /etc/containerd/.

The k3s overlay was mounting the host's containerd config directory
into the cleanup pod, but this was a copy-paste artifact from the
urunc-deploy overlay where the mount is actually needed for the
install and cleanup code paths that modify containerd configuration.

Removing the unnecessary host-path volume mount from the privileged
cleanup pod reduces the attack surface without any behavioral change.
Verified by tracing the full reset code path and confirming zero
filesystem operations on /etc/containerd/.

Signed-off-by: saitejagirada <saitejagirada@gmail.com>
The reset code path in install.sh removes the node label
urunc.io/urunc-runtime at line 395 in the reset) case block, and
then calls reset_runtime() which removes the same label again at
line 308. The second call is redundant and produces a warning since
the label has already been removed.

Remove the duplicate kubectl label command from reset_runtime() to
keep the label removal solely in the reset) case block where it
logically belongs.

Signed-off-by: saitejagirada <saitejagirada@gmail.com>
Signed-off-by: saitejagirada <saitejagirada@gmail.com>
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 0a0ffd6
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a8e55c2d0f6510008ff0e6a

@saitejagirada
saitejagirada marked this pull request as ready for review August 26, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

urunc-cleanup: unnecessary k3s volume mount and redundant label removal in reset path

1 participant