Helm AWS ECR OCI repository #2835
-
Hey there, just curious if anyone have tried using flux with ECR's private OCI helm repository? I'm trying to leverage on a private ECR helm repository with IAM role and i'm constantly facing with More Information: HelmRepository object
HelmRelease object
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 30 replies
-
The current implementation only supports credentials from secret as described in https://fluxcd.io/docs/guides/helmreleases/#helm-repository-authentication-with-credentials. If you want to use IAM role, you would have to automate updating a secret with the generated token somehow I imagine. |
Beta Was this translation helpful? Give feedback.
-
Hi sorry to tack onto an already answered discussion, but I'm currently trying to do this with a cronjob and while I can confirm the secret itself is being rotated and the new token is valid:
The source controller appears to use the old expired token until its restarted, at which point it reloads the new secret and can pull from ECR. Happy to open an issue somewhere but wasn't sure if this was expected given that the example provided I think creates a secret consumed by the image reflector vs the source controller here?
|
Beta Was this translation helpful? Give feedback.
-
Hello @stefanprodan, I am sorry but I was wondering if the above "cache" issue has been resolved? Will it work as expected now? |
Beta Was this translation helpful? Give feedback.
-
Hi! Should this work in Flux 0.35 now, without any workarounds (credentials/secrets)? I get the same error message ( Possibly history repeats: fluxcd/image-reflector-controller#174 ff. So I did some experiments: As I understand, the source-controller is responsible for fetching OCI repository artifacts. So I hacked together a modified image, including the AWS ECR credential helper (https://github.com/awslabs/amazon-ecr-credential-helper):
With that image, it works for me without juggling any credentials or secrets. So the solution would be to include the docker credential helper for AWS ECR (and possibly equvalents for GCE, Azure etc.), providing seamless integration. my .docker/config.json:
would most certainly "surprise" users in heterogeneous environments, and wildcard support for registries is not (yet?) available: docker/cli#2928 Any chance to have at least the binary(ies) included in a future release? The docker client configuration file might be added at install time with a |
Beta Was this translation helpful? Give feedback.
-
Starting with v0.35.0, Flux has native support to authenticate automatically using the EKS worker node IAM role or IAM Role for Service Accounts (IRSA). Docs here: https://fluxcd.io/flux/components/source/helmrepositories/#aws |
Beta Was this translation helpful? Give feedback.
-
Hi I followed steps to use IRSA to pull helm charts from ECR. Flux installed with terraform 0.0.19 My HelmRepository:
What am I missing ? |
Beta Was this translation helpful? Give feedback.
-
I must admit that this is also confusing me a lot. I can only get the HelmRepository to authenticate with the URL being Can somebody clarify, with some easily understandable examples, what the correct way to achieve using IAM roles for ECR-based Helm repo is? |
Beta Was this translation helpful? Give feedback.
Starting with v0.35.0, Flux has native support to authenticate automatically using the EKS worker node IAM role or IAM Role for Service Accounts (IRSA). Docs here: https://fluxcd.io/flux/components/source/helmrepositories/#aws