<p>I need to map a volume while starting the container, I am able to do it so with yaml file. </p>

<p>Is there an way volume mapping can be done via command line without using yaml file? just like<br>
<code>-v</code> option in docker?</p>

<blockquote>
  <p>without using yaml file</p>
</blockquote>

<p>Technically, yes: you would need a json file, as illustrated in "<a href="https://stackoverflow.com/q/37555281/6309">Create kubernetes pod with volume using <code>kubectl run</code></a>"</p>

<p>See <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#run" rel="nofollow noreferrer"><code>kubectl run</code></a>.</p>

<pre><code>kubectl run -i --rm --tty ubuntu --overrides='
{
  "apiVersion": "batch/v1",
  "spec": {
    "template": {
      "spec": {
        "containers": [
          {
            "name": "ubuntu",
            "image": "ubuntu:14.04",
            "args": [
              "bash"
            ],
            "stdin": true,
            "stdinOnce": true,
            "tty": true,
            "volumeMounts": [{
              "mountPath": "/home/store",
              "name": "store"
            }]
          }
        ],
        "volumes": [{
          "name":"store",
          "emptyDir":{}
        }]
      }
    }
  }
}
'  --image=ubuntu:14.04 --restart=Never -- bash
</code></pre>
