<p>I have a pod, which is querying an AWS service using Boto. This pod runs in kubernetes cluster in EKS.</p>
<p>When running on a real cluster, we use ServiceAccount/Role/RoleBinding to give the Pod permission to acquire an IAM role.</p>
<p>But when I run it locally, using <code>kind</code>, I want it to use credentials that are in my <code>~/.aws</code> directory.</p>
<p>So I mount the volumes as follows:</p>
<pre><code>    volumes:
    - hostPath:
        path: /var/run/datadog
        type: &quot;&quot;
      name: dsdsocket
    - hostPath:
        path: /Users/me/.aws
        type: DirectoryOrCreate
      name: aws
</code></pre>
<p>And use them in the pod as follows:</p>
<pre><code>      volumeMounts:
      - mountPath: /var/run/datadog
        name: dsdsocket
        readOnly: true
      - mountPath: /root/.aws
        name: aws
        readOnly: true
</code></pre>
<p>I have checked that there are credentials in <code>~/.aws/credentials</code></p>
<p>But the directory just shows up as empty inside the pod:</p>
<pre><code>root@the_pod:/app# ls -al /root/.aws
total 8
drwxr-xr-x 2 root root 4096 Apr 12 19:33 .
drwx------ 1 root root 4096 May  9 17:22 ..
</code></pre>
<p>NOTE: I have tried mounting the actual credentials file in <code>~/.aws/credentials</code> too, but it doesnt mount either.</p>
<p>Any ideas what i am doing wrong?</p>

feroze
<p>I guess you need to use <a href="https://kind.sigs.k8s.io/docs/user/configuration/#extra-mounts" rel="nofollow noreferrer">extra mounts</a> while creating the kind cluster, it is used to pass through storage on the host to a kind node for persisting data, mounting through code, etc.</p>
<pre class="lang-yaml prettyprint-override"><code>kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  # add a mount from /path/to/my/files on the host to /files on the node
  extraMounts:
  - hostPath: /path/to/my/files/
    containerPath: /files
    # optional: if set, the mount is read-only.
    # default false
    readOnly: true
    propagation: HostToContainer

</code></pre>
<p>Creating a kind cluster with a custom config file:</p>
<pre class="lang-sh prettyprint-override"><code>$ kind create cluster --config=kind-config.yaml
</code></pre>
