AKS doesn't use agentpool's managed identity against ACR when configuring registry mirror in containerd #7271
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
What happened:
We are deploying applications in AKS clusters from artifacts stored in ghcr.io
In Azure, we are configuring a private AKS cluster, limiting access to internet through a firewall. To retrieve images, we deployed an ACR (Azure Container Registry), and we configure the ACR cache to cache images from ghcr.io. In addition, we use RBAC controls, and the agentpool managed identity has
ACRPull
andReader
roles on the ACR.For instance, our image is
ghcr.io/company/images/controller:1
, our acr isacr1.azurecr.io
, and we useimage: ac1.azurecr.io/company/images/controller:1
.The ACR cache rule is
company/images/*
->ghcr.io/company/images/*
This works as expected, images is pulled from ghcr into the acr when requested, and our pod starts.
To further simplify deployment, we want to keep the image reference in the deployments as
ghcr.io/company/images/controller:1
instead of the local ACR name. To do that, we configured containerd with a registry mirror as described in this issue's comment.The
hosts.toml
for domainghcr.io
is configured as follow:However, when doing so, the image pull fails, and apparently, the node tries indeed to pull the image from acr1, but anonymously, without using the managed identity of the agentpool, with the following error in the pod description:
(I did paste the error as I had it, without simplifying names as I did in the explanation)
What you expected to happen:
As pulling the image directly from
acr1.azurecr.io
is working, and as we configure containerd to rewrite imagesghcr.io
to the acr, we expect the same behavior, and the node being able to pull the image from acr1.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
I am trying to reproduce the issue in an environment with less dependencies and less complexity. I didn't manage so far, will try when times permits.
Environment:
cat /etc/os-release
): AKSUbuntu/images/2204gen2containerd/versions/202409.23.0The text was updated successfully, but these errors were encountered: