Managed Kubernetes
Latest
Frequently Asked Questions
Solutions
How Tos
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
How-To Query Container Mounts Using Crictl or Nerdctl
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
You want to list the mounts from each container without needing to exec into the container.
Environment
- Platform9 Managed Kubernetes - All Versions
- Containerd
Procedure
- List the containers running on the node using the crictl or nerdctl utility pre-installed on the node.
Javascript
x
# /opt/pf9/pf9-kube/bin/crictl -r unix:///run/containerd/containerd.sock psCONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID68484121d71d1 0e9462c49c897 22 hours ago Running pf9-addon-operator 0 31ce653d2a519......... # /opt/pf9/pf9-kube/bin/nerdctl -n k8s.io ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES62d00aca415d gcr.io/etcd-development/etcd:v3.4.14 "/usr/local/bin/etcd" 25 hours ago Up etcd.......- Find the PID of the container
Javascript
# /opt/pf9/pf9-kube/bin/crictl -r unix:///run/containerd/containerd.sock inspect --output go-template --template '{{.info.pid}}' <container_ID>28389 # /opt/pf9/pf9-kube/bin/nerdctl -n k8s.io inspect <container_ID> --format '{{.State.Pid}}'21129- Query the /proc filesystem to find the mount information for each container.
Javascript
# cat /proc/28389/mountinfo749 656 0:169 / / rw,relatime master:116 - overlay overlay rw,seclabel,lowerdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3360/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3359/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3358/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3277/fs:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3276/fs,upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3512/fs,workdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3512/work750 749 0:171 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw751 749 0:172 / /dev rw,nosuid - tmpfs tmpfs rw,seclabel,size=65536k,mode=755......VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message