Open davidg-sainsbury opened 3 years ago
Any update on this? Thanks.
Created PR - https://github.com/goharbor/harbor-operator/pull/811
Would be nice to get this released as v1.1.2
@davidg-sainsbury did you manage to run Harbor with IAM role on EKS?
I'm trying to do the same thing, but even with your fix, I believe I'm hitting this issue: https://github.com/distribution/distribution/issues/3275
Switching to an IAM account with the same policies works just fine, but I get access denied errors when no credentials are specified. Unfortunately, it's not really easy to determine what kind of access the registry is trying to use.
@davidg-sainsbury did you manage to run Harbor with IAM role on EKS?
I'm trying to do the same thing, but even with your fix, I believe I'm hitting this issue: distribution/distribution#3275
Switching to an IAM account with the same policies works just fine, but I get access denied errors when no credentials are specified. Unfortunately, it's not really easy to determine what kind of access the registry is trying to use.
We switched to the helm version of harbor rather than using the operator before I had chance to test this. However, we are are experiencing the same issue as you and are waiting for the fix in the distribution engine - https://github.com/goharbor/harbor/pull/16435. As per your link to the issue, until distribution is using the newer AWS SDK you won't be able to use the AWS IAM permissions to access S3 from the harbor registry pods.
Thanks for the confirmation @davidg-sainsbury !
Thanks for the confirmation @davidg-sainsbury !
@sagikazarmark - harbor registry still has an issue with access to S3 via IAM roles with the latest pre-release of Harbor - v2.5.0-rc1 https://github.com/goharbor/harbor/issues/16490. ChartMusuem appears to be fixed.
Any further updates on this? Is STS : https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html perhaps a viabale workaround?
Hey folks, I'd like to know if this already fixed or not? I'm having trouble s3 storage backends using IaM roles and IRSA, but I'm not sure if this a problem on my end or generally still not solved. Appreciate any feedback.
It is an issue in Harbor operator, not in Harbor AFAIK, the instance should be inside the AWS cloud. If the Harbor is installed in EC2 VM with docker-compose, you should grant the IAM role to the EC2 instance. For pods in EKS, there is another approach you can find in the AWS document. When you configure Harbor using s3 storage with IAM roles, you just remove the accesskey and secretkey in harbor.yml, then it uses the IAM role by default.
storage_service:
s3:
region: us-west-2
regionendpoint:
bucket: photon-harbor-registry
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
multipartcopychunksize: 33554432
multipartcopymaxconcurrency: 100
multipartcopythresholdsize: 33554432
rootdirectory: /harbor-ci-1
Harbor operator should remove this access key/secret key check
@stonezdj it is not resolved for IRSA in EKS, which is still unsupported by Harbor as of writing.
Any chances to have IRSA support ? :( using 2.9.0
it issue occur when we use karpenter
Expected behavior and actual behavior:
The registry pod via a Kubernetes ServiceAccount and IAM policy should be able to access an S3 bucket as backend storage.
Steps to reproduce the problem:
ServiceAccount snippet:
IAM Policy
Versions: Please specify the versions of following systems.
Additional context: registry operator errors when trying to create the deployment:
If I create a secret (key=secret) modify the harbor-cluster config to include the
secretkeyref
for that secret the registry pod starts but still fails to access the S3 bucket as it appears it's not using the IAM policy via SA.In your CRD for
harborcluster
only bucket and region are required fields. required:However, in this PR https://github.com/goharbor/harbor-operator/pull/266 the
secretkeyref
is always expected but if that is the case then we can't use IAM roles as per the implementation of the S3 https://docs.docker.com/registry/storage-drivers/s3/