<p>I want to create a pod using <code>kubectl</code> CLI which will mount hostpath <code>/etc/os-release</code> inside pod container and display content of <code>/etc/os-release</code> file.
Is is possible to do it in using one-liner <code>kubectl</code> command?</p>

Mayank Sachan
<pre><code>kubectl run -i --rm busybox --image=busybox --overrides='{
               "apiVersion": "v1",
               "spec": {
                  "containers": [
                     {
                        "image": "busybox",
                        "name": "busybox",
                        "command": ["cat", "/etc/os-release"],
                        "resources": {},
                        "volumeMounts": [
                           {
                              "mountPath": "/etc/os-release",
                              "name": "release"
                           }
                        ]
                     }
                  ],
                  "volumes": [
                     {
                        "name": "release",
                        "hostPath": {
                           "path": "/etc/os-release",
                           "type": "File"
                        }
                     }
                  ],
                  "dnsPolicy": "ClusterFirst",
                  "restartPolicy": "Never"
               },
               "status": {}
            }'
NAME=Buildroot
VERSION=2019.02.10
ID=buildroot
VERSION_ID=2019.02.10
PRETTY_NAME="Buildroot 2019.02.10"
pod "busybox" deleted
</code></pre>
