Skip to content

feat(shell): add nano and crictl to the shell image - #2706

Open
Quang Nguyen (nddq) wants to merge 1 commit into
mainfrom
feat/shell-add-nano-crictl
Open

feat(shell): add nano and crictl to the shell image#2706
Quang Nguyen (nddq) wants to merge 1 commit into
mainfrom
feat/shell-add-nano-crictl

Conversation

@nddq

@nddq Quang Nguyen (nddq) commented Sep 1, 2026

Copy link
Copy Markdown
Member

Description

retina shell ships no text editor and no tool to inspect the node's containers from the runtime's point of view. This PR adds two packages from the Azure Linux 3.0 base repo, the same tier every other package in the image comes from. Both are published for amd64 and aarch64.

  • cri-tools: provides crictl. It needs no extra capabilities — --mount-host-filesystem already mounts the host's /run, so the containerd socket is present in the container. The image ships an /etc/crictl.yaml that points at the containerd socket. Clusters on another CRI implementation override it with crictl --runtime-endpoint. Without --mount-host-filesystem the socket is absent and crictl is inert, so the package grants nothing the flag did not already grant. The install layer removes critest, a CRI conformance suite binary as large as crictl itself and with no use in a debug shell. The image also ships a symlink from /var/log/pods to /host/var/log/podscrictl logs opens the kubelet's log files itself, and they exist only on the host. The read-only /host mount covers the read, and the link dangles harmlessly when the flag is not set.
  • nano: lets you edit a config or scratch file inside the shell.
  • Docs: docs/06-Troubleshooting/shell.md gets a crictl section and names nano in the tool list. It documents that the host's /run mount is always read-write — pre-existing behavior from shell/manifests.go, only documented here.

nano over vim is deliberate. trivy.yaml scans retina-shell weekly on CRITICAL,HIGH. nano has 4 CVEs since 2010, none rated HIGH or CRITICAL. vim has 250, and Azure Linux bumps it for a CVE roughly every 12 days. Between releases, that parks HIGH findings in the scan that nobody can close without a release.

Related Issue

Supersedes #2705 — same change, reopened from an in-repo branch.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable. (N/A — package addition, no test surface.)

Screenshots (if applicable) or Testing Completed

Image built locally for amd64 and tested on a kind cluster (containerd v2.3.1). The test pod mirrors the --mount-host-filesystem spec from shell/manifests.go: host / read-only at /host, host /run at /run, and no added capabilities.

  • crictl version, crictl pods, crictl ps, and crictl inspect work against the live runtime with only the shipped /etc/crictl.yaml — no endpoint flags.
  • crictl logs returns the container's log lines out of the box, through the baked-in symlink and the read-only /host mount.
  • nano 6.4 and crictl 1.32.0 run in the built image; critest is absent.
  • Image size: 1.43GB → 1.48GB unpacked (+50MB). markdownlint-cli2 reports 0 issues on the changed doc.

Additional Notes

Two stale entries in the doc's Limitations section (bpftrace, nsenter) are left alone to keep this PR focused.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Retina Code Coverage Report

Total coverage no change

Increased diff

Impacted Files Coverage
pkg/controllers/daemon/namespace/namespace_controller.go 76.24% ... 78.46% (2.22%) ⬆️

@nddq
Quang Nguyen (nddq) force-pushed the feat/shell-add-nano-crictl branch 2 times, most recently from 3cc3d67 to 2eff20d Compare September 1, 2026 16:28
Both come from the Azure Linux base repo, the same tier every other
package in the image already comes from, and both are published for
amd64 and aarch64.

crictl gives container-level introspection on the node: which container
owns a network namespace, why one keeps restarting, what it logged
before it died. It needs no extra capabilities, because
--mount-host-filesystem already mounts the host's /run and the
containerd socket is therefore present. The image ships an
/etc/crictl.yaml pointing at containerd; other runtimes can override it
with --runtime-endpoint. Without --mount-host-filesystem the socket is
absent and crictl is inert, so this adds no new privilege surface.

cri-tools also installs critest, a CRI conformance suite binary as
large as crictl itself and with no use in a debug shell. The install
layer removes it, which halves the payload of the package.

nano covers editing a config or scratch file without leaving the shell.
It is chosen over vim for scan hygiene: nano has 4 CVEs on record since
2010, none rated HIGH or CRITICAL, while vim has 250 with 64% HIGH or
CRITICAL and takes a CVE-driven version bump in Azure Linux roughly
every 12 days. Between releases that would leave findings in the weekly
Trivy scan that no one can close.

crictl logs opens the kubelet's log files at /var/log/pods itself; the
CRI API does not stream log content. The files exist only on the host,
so the image ships a symlink from /var/log/pods to /host/var/log/pods.
The read-only /host mount is enough for the read, and the link dangles
harmlessly when --mount-host-filesystem is not set.

Docs gain a crictl section and a note that the host's /run is mounted
read-write even without --allow-host-filesystem-write.

Signed-off-by: Quang Nguyen <28567936+nddq@users.noreply.github.com>
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.

1 participant