dockerkubernetesnginxnexuscontainerd

Cant pull image from nexus repository when i upgrade kubernetes cluster to v1.24


We are unable to pull the container image from the Nexus repository on Kubernetes versions 1.24 and above. However, on Kubernetes version 1.23, we can successfully pull the container image from the same repository. As a result, we have been using Kubernetes version 1.23 across our clusters. However, when using Kubernetes version 1.23, we encountered the same issue of not being able to pull the container image from our Nexus repository when creating Fargate profiles.

Currently, we manage Nexus with nginx.

Interestingly, when we place the container image in a private repository on Docker Hub, we can successfully pull the container image from Fargate profiles.

We suspect this issue might be related to Kubernetes transitioning from Docker to containerd as the runtime starting from v1.24.

Could you please help us with some insights on how to troubleshoot and resolve this problem?


Solution

  • The issue was the nginx. We use nginx and $http_user_agent variable to direct docker request to docker repository on nexus. After kubernetes v1.24 runtime is changed to containerd and request of pulling image coming with $http_user_agent=containerd added containerd in nginx.conf

    if ($http_user_agent ~ containerd ) {
        proxy_pass http://localhost:5000;
    }
    

    resolve the issue. 5000 port is the docker repository port.