<p>When I use k3d create a Kubernetes cluster, I can mount local folder <code>/Users/me/data</code> to the cluster <code>/data</code> using <code>volume</code></p>
<pre><code>k3d cluster create west --config=k3d-config.yaml
</code></pre>
<p><strong>k3d-config.yaml</strong></p>
<pre><code>apiVersion: k3d.io/v1alpha3
kind: Simple
kubeAPI:
  host: &quot;k8s-example.com&quot;
  hostIP: &quot;127.0.0.1&quot;
  hostPort: &quot;6440&quot;
network: hm-network
volumes:
  - volume: &quot;/Users/me/data:/data&quot;  # &lt;- this line helps mount
ports:
  - port: 40000:80
    nodeFilters:
      - loadbalancer
options:
  k3s:
    extraArgs:
      - arg: --cluster-domain=west.k8s-example.com
        nodeFilters:
          - server:*
</code></pre>
<p>Now I am using the Kubernetes cluster created by Rancher Desktop and hoping to do the same thing.</p>
<p>I am on macOS, and I found <a href="https://docs.rancherdesktop.io/how-to-guides/provisioning-scripts#macos--linux" rel="nofollow noreferrer">this document</a> which seems right document (?):</p>
<blockquote>
<p>On macOS and Linux, you can use lima override.yaml to write provisioning scripts.</p>
<p><code>~/Library/Application Support/rancher-desktop/lima/_config/override.yaml</code></p>
<p>You can also use override.yaml to override/modify a lima configuration
setting, for example, to create additional mounts as shown below.</p>
<pre><code> mounts:
  - location: /some/path 
    writable: true
</code></pre>
</blockquote>
<p>However, I am not entirely sure how to use this to mount my local folder <code>/Users/me/data</code> to the cluster <code>/data</code>.</p>
<p>Any guide would be appreciate!</p>

Hongbo Miao
<p>You can mount it as a hostpath inside a Pod:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - image: nginx
    name: nginx
    volumeMounts:
    - mountPath: /data
      name: some-path
  volumes:
  - name: some-path
    hostPath:
      path: /some/path
      type: Directory
</code></pre>
