kubernetes / registry.k8s.io

This project is the repo for registry.k8s.io, the production OCI registry service for Kubernetes' container image artifacts
https://registry.k8s.io
Apache License 2.0
397 stars 69 forks source link

kubeadm init clone project to local compilation error #266

Closed devbiu closed 11 months ago

devbiu commented 11 months ago

What happened?

download kubernetes-1.24.17.tar.gz to local environment use commond

KUBE_BUILD_PLATFORMS=linux/amd64 make all GOFLAGS=-v GOGCFLAGS="-N -l" 

compile kubeadm config images list view require images as follow

image

because only the tag in the docker is 1.24.17 image, use the tag command to modify the tag of the image

image

enable corresponding images and tags

subsequent execution commond

kubeadm init

alter still asks me to pull images

image

What did you expect to happen?

kubernetes install success

How can we reproduce it (as minimally and precisely as possible)?

KUBE_BUILD_PLATFORMS=linux/amd64 make all GOFLAGS=-v GOGCFLAGS="-N -l" 
kubeadm init

Anything else we need to know?

No response

Kubernetes version

```console $ kubectl version # Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.17", GitCommit:"22a9682c8fe855c321be75c5faacde343f909b04", GitTreeState:"clean", BuildDate:"2023-10-16T11:32:47Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"} ```

Cloud provider

red Hat Linux

OS version

```console # On Linux: $ cat /etc/os-release # red Hat Enterprise Linux release 8.3 $ uname -a # Linux xxxxx x86_64 x86_64 x86_64 GNU/Linux ```

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

k8s-ci-robot commented 11 months ago

There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

Please see the group list for a listing of the SIGs, working groups, and committees available.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 11 months ago

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
neolit123 commented 11 months ago

/kind support /transfer registry.k8s.io

note there are number of similar issues. it's not a kubeadm bug, but a problem with your internet or registry.k8s.io https://github.com/kubernetes/registry.k8s.io/issues https://github.com/kubernetes/registry.k8s.io/issues/262

BenTheElder commented 11 months ago

It looks like your local DNS server is refusing requests?

devbiu commented 11 months ago

It looks like your local DNS server is refusing requests?

because the local network cannot connect to the Internet

So I imported the required image in advance so that it cannot be downloaded remotely

and using image pull policy IfNotPresent

So should I no longer pull images from remote locations?

neolit123 commented 11 months ago

So I imported the required image in advance so that it cannot be downloaded remotely

did you import them in the k8s.io namespace?

devbiu commented 11 months ago

So I imported the required image in advance so that it cannot be downloaded remotely

did you import them in the k8s.io namespace?

This is okay for me I mistakenly understood that the runtime of kubadm is docker, but the actual runtime is containerd. So after I imported the image into the k8s namespace k8s.io through ctr, modified its tag through the command as follows

image

I re-executed

kubeadm init --v=5 

and was able to find the image.

Thank you for your answer

devbiu commented 11 months ago

What puzzles me is why the runtime is containerd instead of docker. As far as I know, lower versions of kubernetes import the image into docker instead of ctr. Can you explain it to me?

neolit123 commented 11 months ago

What puzzles me is why the runtime is containerd instead of docker. As far as I know, lower versions of kubernetes import the image into docker instead of ctr. Can you explain it to me?

docker is no longer supported by default by kubeadm and core kubernetes. there is a new container runtime "shim" called cri-dockerd that is needed. if you used kubeadm config images pull ..., then kubeadm would use crictl to download the images in the container runtime it found. probably in your case it only found the containerd socket.

closing as not a bug /close

k8s-ci-robot commented 11 months ago

@neolit123: Closing this issue.

In response to [this](https://github.com/kubernetes/registry.k8s.io/issues/266#issuecomment-1767787801): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 11 months ago

@neolit123: Closing this issue.

In response to [this](https://github.com/kubernetes/registry.k8s.io/issues/266#issuecomment-1767786734): > >> What puzzles me is why the runtime is containerd instead of docker. As far as I know, lower versions of kubernetes import the image into docker instead of ctr. Can you explain it to me? > >docker is no longer supported by default by kubeadm and core kubernetes. there is a new container runtime "shim" called cri-dockerd that is needed. >if you used `kubeadm config images pull ...`, then kubeadm would use `crictl` to download the images in the container runtime it found. probably in your case it only found the containerd socket. > >closing as not a bug >/close > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.