<p>I would like to use a <code>Secret</code> inside a <code>ConfigMap</code>. Is this possible? </p>

<p><strong>Example:</strong></p>

<p>An example where this might be required is if you would like to write from <a href="https://docs.fluentd.org/output/s3" rel="nofollow noreferrer">Fluentd to S3</a>. In the configuration you have to add your AWS credentials.</p>

<p><strong>Alternatives:</strong> </p>

<p>Using <strong>environment variables</strong> on the cluster itself. I do not like this idea, because the variable would still contain the secret as plain text.</p>

<p>Passing the password during set-up. If you are using <strong>deployment tools</strong> it might be possible to pass the secret during the deployment of your application. This is also not a nice solution since you are still passing the secret as plain text to the deployment tool. An advantage of this approach is that you do not accidentally check-in your secret to git. </p>

User12547645
<p>Try to <a href="https://medium.com/merapar/securing-iam-access-in-kubernetes-cfbcc6954de" rel="nofollow noreferrer">avoid</a> making use of aws credentials in kubernetes.</p>

<p>As you can <a href="https://docs.fluentd.org/output/s3#parameters" rel="nofollow noreferrer">see</a> <code>aws_key_id</code> and <code>aws_sec_key</code> are the optional fields.</p>

<p>Make use of <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html" rel="nofollow noreferrer">AWS IAM role</a> and assign it to the kubernetes nodes.</p>

<p>And then try to run your fluentd application without aws credentials in its <a href="https://docs.fluentd.org/output/s3#example-configuration" rel="nofollow noreferrer">config</a>.</p>

<p>Just give it a try.</p>

<p>Hope this helps.</p>

<p><strong>Update:</strong></p>

<p><a href="https://medium.com/merapar/securing-iam-access-in-kubernetes-cfbcc6954de" rel="nofollow noreferrer">This</a> article explain different ways to use aws iam for kubernetes.</p>

<p><a href="https://github.com/jtblin/kube2iam" rel="nofollow noreferrer">Kube2iam</a> and many <a href="https://medium.com/building-ibotta/moving-from-kube2iam-to-kiam-a000639b839e" rel="nofollow noreferrer">other</a> tools like this, might help. Give it a try.</p>
