How to create a CriCtl pod with a volume mount?

1/3/2022

I am trying to create a pod using CriCtl and a pod-config.json file. I am following the example from the official docs to run a pod. This is what my pod-config file looks like:

{
    "metadata": {
        "name": "nginx-sandbox",
        "namespace": "default",
        "attempt": 1,
        "uid": "hdishd83djaidwnduwk28bcsb"
    },
    "log_directory": "/tmp",
    "linux": {},
    "mounts": [
        {
            "destination": "/docker",
            "type": "bind",
            "source": " /etc/docker",
            "options": [
                "rbind",
                "ro"
            ]
        }
    ]
}

Paste the above snippet in a file and run crictl runp <filename>

On doing a crictl inspectp <podID> I can't see the mount in the pod's mount field.

I am pretty sure this is an error in my inputting the mount information, but I can't seem to find any examples to do that.

What would be the right way of specifying mounts in a crictl pod-config file?

-- Harshdeep Gupta
containerd
containers
kubernetes

0 Answers