<p>I'm trying to move local folder into kubernetes volume by following command:</p>
<pre><code>kubectl cp /* mynamespace/mypod-xxxx-xxxx:/var/www/my-content
</code></pre>
<p>Unfortunately, I got following error message:</p>
<blockquote>
<p>error: one of src or dest must be a remote file specification</p>
</blockquote>
<p>even I've configured volume mount as follow:</p>
<pre><code>      volumeMounts:
        - mountPath: &quot;/var/www/my-content&quot;
          name: mycontent
  volumes:
    - name: mycontent
      persistentVolumeClaim:
        claimName: mypvc
</code></pre>
<p>Please let me know which I missed something to configure it.</p>

PPShein
<p>There is an issue in <code>*</code> which is not currently supported by kubectl cp.
To solve this issue just remove * and use the full directory name like</p>
<pre><code>kubectl cp /folder_name/ mynamespace/mypod-xxxx-xxxx:/var/www/my-content

</code></pre>
<p>but in this case a folder will be created  like  <code>/var/www/my-content/folder_name</code>.
you have to adjust this in your code or you can name your local folder name like my-content and copy to <code>/var/www/</code>.</p>
