kube-aws-iam-controller
kube-aws-iam-controller copied to clipboard
Update supported SDKs for JS support
The merge of https://github.com/aws/aws-sdk-js/pull/2559 adds support to the JS AWS SDK.
Haven't tried it out yet, but will be doing so shortly. But, theoretically, it should work based on the change notes/pull request.
Signed-off-by: Michael Irwin [email protected]
I tried this before and it didn't work. However this prompted me to try again and I was able to make it work when setting ALL of these environment variables:
- name: AWS_SDK_LOAD_CONFIG
value: "true"
# must be set for the AWS SDK/AWS CLI to find the credentials file.
- name: AWS_SHARED_CREDENTIALS_FILE # used by js SDK
value: /meta/aws-iam/credentials.process
- name: AWS_CONFIG_FILE
value: /meta/aws-iam/credentials.process
- name: AWS_REGION
value: eu-central-1
I have not check why AWS_SHARED_CREDENTIALS_FILE AND AWS_CONFIG_FILE must be set, but it doesn't work without from my testing.
We need a dedicated section for JS with this information similar to what we have for the other SDKs.
Sounds great! I can add a dedicated JS section as well.
As a separate question... have you considered extending the controller to serve as a webhook to automatically add the secret mount and add the env vars? Would be awesome to make it mostly invisible to users. Curious on your thoughts...
Sounds great! I can add a dedicated JS section as well.
Thanks!
As a separate question... have you considered extending the controller to serve as a webhook to automatically add the secret mount and add the env vars? Would be awesome to make it mostly invisible to users. Curious on your thoughts...
Definitely makes sense. We have not invested in this because we're looking more into adopting the solution from EKS at this point, but we would welcome contributions adding this. One thing which I'm not 100% sure about is if some of the environment variables will conflict cross SDKs, then it's harder to just inject the settings in a webhook, because you need to know which SDK is in use.
We have not invested in this because we're looking more into adopting the solution from EKS at this point, but we would welcome contributions adding this.
Yeah... we started with this route, but are running clusters not in EKS (either in AWS with a k8s platform or potentially even on-prem). And, trying to figure out how to get all of the pieces working has been tricky, which is why I looked for others and found this one. It's pretty straight forward and easy to understand what's going on.
One thing which I'm not 100% sure about is if some of the environment variables will conflict cross SDKs
Yeah... that was one of my worries too. Might be something that could be tested to figure out.
Anywho... I'll stop chatting about that here as it deserves its own issue/discussion thread. I'll update the MR for ya shortly 👍
Alrighty... I've added the snippet for the JS SDK. I didn't include a link to an example repo, as I couldn't find one. But, I did find a docker image for a js example and didn't see anything crazy in the app.js that would warrant reminders/additional setup.
@mikesir87 I pushed the example repo here: https://github.com/mikkeloscar/kube-aws-iam-controller-js-example
And added the link to the repo. Thanks for making and pushing that 👍
:+1: