-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws.profile
not respected in ecr-credential-provider
template.
#2885
Comments
Hi @nairb774 - did you see this documented somewhere? If so, that needs to be corrected. The credential provider uses the default profile. Do you have a use case in mind for wanting a separate profile? |
Few things make me think that the
In that section has the
The documentation wasn't very clear, but I was able to locate #2377 which added the CredentialProviderConfig and that template seems to explicitly try to set the bottlerocket/packages/kubernetes-1.22/credential-provider-config-yaml Lines 18 to 21 in 6ef1139
I was attempting to see if this might be a partial path for implementing something like described in #1624. Basically a way to "hide" the IAM permissions needed by the kubelet from other programs running on the box. Partially for security, and partially for trying to prevent crafty engineers from depending on policies being attached to the instance. Hope that helps some. Edit: Using |
Sorry, you are absolutely right. Let me look in to what's happening here... |
I believe this may be an order of operations issue. When the So my hunch at this point is, if you set the aws config settings first, then the kubernetes credential provider settings, when the template is rendered it will pick up the Will do more testing to verify if this is true or not, and if so, see what can be done to have updates to either setting trigger the re-rendering. |
I attempted forcing a rerendering by updating the creds provider settings (add image pattern) and it didn't seem to pickup the profile name. Knowing nothing about the implementation, I'd guess the available config was being pruned or something before rendering, but the code didn't seem to have any implementation for that. |
I tested applying the AWS config settings first, then the credential provider settings. Profile was not picked up. I then tested applying credential provider settings, then AWS config. Same results. So it looks like the issue is regardless of order, when the credential-provider-config template is rendered, it never has a value for the And ordering-wise, I believe it is an issue that applying the setting for So either those issues need to be sorted out, or the profile setting deprecated. It was only added as a convenience so someone could take their own Removal, or deprecation with a big note in the settings documentation stating it is unused, might be the most straightforward thing to do, but would love to hear arguments for or against that idea. :) |
Also tested rebooting an instance to see if the settings would get rendered correctly on fresh initialization. No luck. |
Image I'm using:
Bottlerocket OS 1.12.0 (aws-k8s-1.22)
What I expected to happen:
Using settings like the following should result in the
AWS_PROFILE
environment variable being set tokubelet
within the/etc/kubernetes/kubelet/credential-provider-config.yaml
file on the host. Additionally the desired role isn't being used for pulling images.The expanded
settings.aws.config
is as follows:What actually happened:
The credential helper file is missing the needed environment variable. This is the output as seen with the above configuration:
How to reproduce the problem:
Use the EKS BottlerocketOS image with the additional settings shown above to observe the incorrect configuration generation. Obviously the role referenced in the
kubelet
profile should exist with sufficient permissions to allow the instance role to assume it, and be useful for container image pulling. Given this looks to, at a minimum, just be a templating issue the whole setup might not be entirely necessary.The text was updated successfully, but these errors were encountered: