kops icon indicating copy to clipboard operation
kops copied to clipboard

allow ecr pull-through-cache

Open karancode opened this issue 3 years ago • 11 comments

  • Adds ecr:BatchImportUpstreamImage to the nodes IAM. fixes #13456

karancode avatar Apr 04 '22 08:04 karancode

Hi @karancode. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Apr 04 '22 08:04 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign olemarkus after the PR has been reviewed. You can assign the PR to them by writing /assign @olemarkus in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 04 '22 08:04 k8s-ci-robot

Can you add some documentation on how to make use of this feature? I assume one also need to configure mirrors for containerd.

olemarkus avatar Apr 04 '22 12:04 olemarkus

/ok-to-test

olemarkus avatar Apr 04 '22 12:04 olemarkus

Hi @olemarkus thanks for the review.

Can you add some documentation on how to make use of this feature?

If anyone is using the aws ecr pull through cache then they need to create cache rules and for k8s(nodes) to be able to use those rules, they just need this additional iam policy. There is no other special config required. Using pull through cache, quay/amzn-ecr-public repos can be pulled directly just by using the ecr endpoint aws_account_id.dkr.ecr.region.amazonaws.com/quay/repository_name/image_name:tag

Let me know if I should add above to the readme?

I assume one also need to configure mirrors for containerd.

Sorry I am not sure about this. Let me check.

karancode avatar Apr 06 '22 04:04 karancode

Hi @olemarkus thanks for the review.

Can you add some documentation on how to make use of this feature?

If anyone is using the aws ecr pull through cache then they need to create cache rules and for k8s(nodes) to be able to use those rules, they just need this additional iam policy. There is no other special config required. Using pull through cache, quay/amzn-ecr-public repos can be pulled directly just by using the ecr endpoint aws_account_id.dkr.ecr.region.amazonaws.com/quay/repository_name/image_name:tag

Let me know if I should add above to the readme?

So if I understand this correctly, this is only useful for your own images if you explicitly change the image name? You cannot use it as a normal containerd image? Where the Pod would have the original image specified, but containerd would try to pull it from the given endpoint?

olemarkus avatar Apr 18 '22 07:04 olemarkus

@olemarkus sorry for late. So basically, it is just for pulling an external image and caching the image to our private ECR repo. I think it will be the same for docker/containerd. 🤔

karancode avatar Apr 22 '22 16:04 karancode

/retest-required

karancode avatar May 07 '22 17:05 karancode

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 05 '22 18:08 k8s-triage-robot

@karancode: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kops-bazel-test 2c13ca3ff2da87c9dcc701cde28f38c0170a50a9 link true /test pull-kops-bazel-test
pull-kops-e2e-cni-cilium-ipv6 2c13ca3ff2da87c9dcc701cde28f38c0170a50a9 link false /test pull-kops-e2e-cni-cilium-ipv6
pull-kops-e2e-cni-amazonvpc 2c13ca3ff2da87c9dcc701cde28f38c0170a50a9 link true /test pull-kops-e2e-cni-amazonvpc
pull-kops-e2e-aws-karpenter 2c13ca3ff2da87c9dcc701cde28f38c0170a50a9 link true /test pull-kops-e2e-aws-karpenter
pull-kops-test 2c13ca3ff2da87c9dcc701cde28f38c0170a50a9 link true /test pull-kops-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

k8s-ci-robot avatar Aug 31 '22 08:08 k8s-ci-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Sep 30 '22 09:09 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Oct 30 '22 09:10 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Oct 30 '22 09:10 k8s-ci-robot

@olemarkus I suspect this should work with specifying aws_account_id.dkr.ecr.region.amazonaws.com/quay as a registry mirror for containerd.

I tried it for Docker Hub hosted image (aws_account_id.dkr.ecr.region.amazonaws.com/docker) and kubelet tried to pull images from the correct URL but I was getting a 401 error. I suspect the said IAM permission is needed on the nodes.

Update: I'll try to find some time and try this by attaching the needed IAM permission externally.

ScOut3R avatar Dec 06 '22 05:12 ScOut3R