kubernetes-sigs / kind

Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
13.01k stars 1.51k forks source link

Kind cluster not able to pull public images from ghcr.io #3663

Open rohitagg2020 opened 2 weeks ago

rohitagg2020 commented 2 weeks ago

What happened:

I have created a kind cluster. But when I try to create a deployment (which pulls images from ghcr.io), it fails.

Error:

^ Pending: ErrImagePull (message: failed to pull and unpack image "ghcr.io/carvel-dev/kapp-controller@sha256:b83bd139c42777bb4428c2ae421f93675a7d6147dff3147471d1be112d9c1eec": 
failed to resolve reference "ghcr.io/carvel-dev/kapp-controller@sha256:b83bd139c42777bb4428c2ae421f93675a7d6147dff3147471d1be112d9c1eec": 
failed to do request: Head "https://ghcr.io/v2/carvel-dev/kapp-controller/manifests/sha256:b83bd139c42777bb4428c2ae421f93675a7d6147dff3147471d1be112d9c1eec": 
tls: failed to verify certificate: x509: certificate signed by unknown authority)

It has been working fine until last month. I thnk I have messed up my environment, because of which I am facing this issue.

Things I have tried:

But still, I am not able to get around the error. How can I get back to things working again?

What you expected to happen: Deployment to be created successfully. How to reproduce it (as minimally and precisely as possible): kubectl apply -f https://github.com/carvel-dev/kapp-controller/releases/latest/download/release.yml Anything else we need to know?: As this is a public image, I guess the ca certs are not being picked up when kind cluster is created. Environment:

stmcginnis commented 2 weeks ago

/remove-kind bug /kind support

Please fill in the full "Environment" details from the issue template.

Are you in an environment that uses a proxy?

You could try deleting any cluster you have, then delete the kind Docker network, then try creating again. It will try to recreate the network to make sure there isn't something odd with the existing setup.

You can also do kind create cluster --retain, then use docker ps to see the created containers. Then you can docker exec into the kind container(s) to perform troubleshooting.

BenTheElder commented 2 weeks ago

This looks like a MITM proxy causing issues.

rohitagg2020 commented 1 week ago

Are you in an environment that uses a proxy?

No

You could try deleting any cluster you have, then delete the kind Docker network, then try creating again. It will try to recreate the network to make sure there isn't something odd with the existing setup.

How can I do this? I did try docker network remove but it didnt help.

aojea commented 1 week ago

docker network rm kind

https://docs.docker.com/reference/cli/docker/network/rm/

rohitagg2020 commented 1 week ago

I already tried docker network rm kind and it didnt work.

tao12345666333 commented 1 week ago

What's your steps to create kind cluster?

I saw your post server version is Server Version: v1.27.9

And kind version is 0.23

I think maybe you have changed some configurations

rohitagg2020 commented 1 week ago

What's your steps to create kind cluster?

kind create cluster

I think maybe you have changed some configurations

I guess so, but I dont remember it now. Is there any default path from which kind configuration is loaded? cc: @tao12345666333

BenTheElder commented 1 week ago

no, you would've specified it https://kind.sigs.k8s.io/docs/user/configuration/