Image Pull Fails in Restricted Egress¶
Hypothesis triage for image pulls under restricted egress:
flowchart TD
S["Pods in ImagePullBackOff under restricted egress"] --> H1{"Image reference or pull secret broken?"}
H1 -- yes --> R1["Fix image ref, tag, or pull secret"]
H1 -- no --> H2{"ACR private endpoint DNS resolves publicly?"}
H2 -- yes --> R2["Fix private DNS zone linkage"]
H2 -- no --> H3{"Firewall, UDR, or proxy blocks registry endpoints?"}
H3 -- yes --> R3["Allow ACR and MCR FQDNs on the egress path"]
H3 -- no --> H4{"Proxy intercepts TLS or misses no-proxy exclusions?"}
H4 -- yes --> R4["Correct TLS handling and bypass CIDRs"]
H4 -- no --> EV["Diagnose: prove image vs network first, confirm egress model"]
EV --> RES["Resolution per matched cause"]
RES --> PREV["Prevention: validate egress rules with each cluster change"] Symptom¶
Pods stay in ImagePullBackOff or ErrImagePull after deployment in a cluster that uses restricted egress, forced tunneling, Azure Firewall, proxy routing, or private endpoints.
Possible Causes¶
- Wrong image reference, missing tag, or broken pull secret.
- Azure Container Registry private endpoint exists, but private DNS is missing or still resolves publicly.
- Firewall, UDR, or proxy blocks required ACR, Microsoft Container Registry, or other AKS dependency endpoints.
- Required
mcr.microsoft.comor related artifact FQDNs are not allowed. - Proxy interception blocks TLS or misses the correct
no-proxyexclusions. - Private endpoints, pod CIDRs, or service CIDRs are not bypassed correctly in the proxy path.
Diagnosis Steps¶
-
Prove whether the failure is an image or authentication problem before chasing networking.
-
Confirm the cluster egress model and networking plugin.
az aks show \ --resource-group "$RG" \ --name "$CLUSTER_NAME" \ --query "{outboundType:networkProfile.outboundType,networkPlugin:networkProfile.networkPlugin}" \ --output yamlCommand Purpose az aks showShow the outbound type and network plugin. --resource-groupResource group that contains the AKS cluster. --nameName of the AKS cluster. --querySelects the outbound type and network plugin. --outputOutput format for the result. -
Inspect the registry exposure model.
az acr show \ --resource-group "$ACR_RG" \ --name "$ACR_NAME" \ --query "{loginServer:loginServer,publicNetworkAccess:publicNetworkAccess}" \ --output yaml az network private-endpoint-connection list \ --id "/subscriptions/<subscription-id>/resourceGroups/$ACR_RG/providers/Microsoft.ContainerRegistry/registries/$ACR_NAME" \ --output tableCommand Purpose az acr showShow the registry login server and public access. --resource-groupResource group that contains the registry. --nameName of the container registry. --querySelects the login server and public network access. --outputOutput format for the result. az network private-endpoint-connection listList private endpoint connections on the registry. --idResource ID of the container registry. --outputOutput format for the result. -
Check whether core platform pods show a wider egress problem.
-
Compare the failing image hostname with the allowed FQDNs and any proxy bypass list for private endpoints, pod CIDRs, and service CIDRs.
Resolution¶
- Fix the image name, tag, or pull secret first when the error is authentication- or manifest-related.
- Add or repair the ACR private endpoint and its private DNS zone links when the registry should stay private.
- Allow the required AKS, MCR, and ACR FQDNs through firewall, UDR, or proxy controls.
- Add proxy bypass entries for private endpoints, pod CIDRs, service CIDRs, and registry private DNS names.
- Prefer ACR private endpoints for restricted-egress clusters rather than relying on public registry paths.
Prevention¶
- Standardize registry patterns for restricted-egress clusters before onboarding workloads.
- Keep the required outbound dependency list under change control with the network team.
- Validate proxy
no-proxycoverage whenever private endpoints or CIDR ranges change. - Treat image pull failures as both application onboarding checks and platform egress checks.