Albert
Albert

Reputation: 1

ErrImageNeverPull server gave http response to https client

I have 1 master node and 1 worker node of Kubernetes. I created a local registry for my docker images and I pulled it to: myiplocal:5000/xxx in the master node.

When I create the deployment it is giving error:

Failed to pull image "myip:5000/xxx:latest": rpc error: code = Unknown desc = failed to pull and unpack image "myip:5000/xxx:latest": failed to resolve reference "myip:5000/xxx:latest": failed to do request: Head "https://myip:5000/v2/xxx/manifests/latest": http: server gave HTTP response to HTTPS client

I tried to pull it manually in my worker using docker pull myip:5000/xxx and it worked, so. Why it's not working when I deploy the .yaml?

.yaml important info:

 containers:
        - name: xxx
          image: myip:5000/xxx
          imagePullPolicy: IfNotPresent
          envFrom:
            - secretRef:
                name: xxx-secret

I created daemon.json in a worker using:

{
 "insecure-registries": [ "myip:5000" ]
}

The problem is that still gives me the error of https client.

Upvotes: 0

Views: 320

Answers (1)

vrnvav97
vrnvav97

Reputation: 53

Looks like your local registry is running on http url instead of https, and k8s is making https connection while fetching image,

Can you try accessing the local registry with both secured => https://myip:5000/ and, unsecured url => http://myip:5000/ on your browser, and check if this resolves

Upvotes: 1

Related Questions