<p><strong>The scenario</strong>:</p>
<p>We have a K8s cluster on EKS using Fargate nodes. I am storing our credentials/secrets in AWS SecretManager and want our workers deployed on AWS Fargate to access these secrets directly.</p>
<p><strong>The issue</strong>:</p>
<p>The python code inside the containers throw the following error, as it cannot find any aws credentials):<br />
<code>botocore.exceptions.NoCredentialsError: Unable to locate credentials</code></p>
<p>It is quite similar to the issue raised <a href="https://stackoverflow.com/questions/60068942/pod-on-fargate-from-eks-does-not-have-access-to-aws-default-credentials/60073089#60073089">here</a> and I already went ahead to add a service account as proposed in the answer to that question.</p>
<p>Specifically, I followed the <a href="https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html" rel="nofollow noreferrer">guide here</a>.</p>
<p>However, the last step does not return the expected output for me. There is no AWS environment variable being injected into any of the pods.</p>
<p>I also tried following the workshop here:https://www.eksworkshop.com/beginner/110_irsa/deploy/
but still not getting the expected output.</p>
<p>I will appreciate if anyone can point me in the right direction here. Thanks in advance!</p>

<p>I believe 🤔 you are missing the cluster create steps as described <a href="https://aws.amazon.com/blogs/opensource/introducing-fine-grained-iam-roles-service-accounts/" rel="nofollow noreferrer">here</a>. Specifically:</p>
<ul>
<li>Set up the OIDC ID provider (IdP) in AWS.</li>
</ul>
<p>If you like to inject things into your Pods automatically consider creating a <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/" rel="nofollow noreferrer">MutatingAdmissionWebhook</a> which basically responds to with <code>JSONPatch</code> that K8s applies to whatever object you specify.</p>
<p><a href="https://medium.com/ovni/writing-a-very-basic-kubernetes-mutating-admission-webhook-398dbbcb63ec" rel="nofollow noreferrer">This is</a> a detailed walkthrough on how to create one.</p>
