kubernetes / kubernetes

Production-Grade Container Scheduling and Management
https://kubernetes.io
Apache License 2.0
111.08k stars 39.66k forks source link

kubeadm upgrade can't work with customize pause image #105007

Closed TomatoAres closed 3 years ago

TomatoAres commented 3 years ago

What happened:

When I upgrade my k8s cluster 1.20.4->1.21.4 with customized configuration to ensure pause image doesn't upgrade,

apiVersion: kubeadm.k8s.io/v1beta2
...
nodeRegistration:
  criSocket: /var/run/dockershim.sock
  kubeletExtraArgs:
    ...
    pod-infra-container-image: registry.tke.com/library/pause:3.2

but upgrade step is failed in preflight:

[preflight] Some fatal errors occurred: [ERROR ImagePull]: failed to pull image registry.tke.com/library/pause:3.4.1:

I found this error occurs in this linkpreflight->CheckClusterHealth->CheckClusterHealth->createJob

And the job work with a constant--hard code version pause image.

And I

What you expected to happen:

I expected the pause image version could be customized by configuration

I don't want to pull a new version pause image which is not necessary.

How to reproduce it (as minimally and precisely as possible):

kubeadm upgrade apply kubernetes version 1.20.4->1.21.4without 3.4.1 pause image

Anything else we need to know?:

Environment:

k8s-ci-robot commented 3 years ago

@TomatoAres: 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 3 years ago

if you wish to conform kubeadm you can upload your custom image to your private registry and create a tag / alias for the version that kubeadm needs.

in your example kubeadm needs 3.4.1 you can upload your 3.2 and alias the tag to be 3.4.1.

IMPORTANT: kubeadm currently does not support custom pause images. in the long term the pause image will no longer be known in the kubelet and kubeadm and flags such as pod-infra-container-image will be removed. it will be only known in the container runtime configuration and by the CRI.

/kind support /close

k8s-ci-robot commented 3 years ago

@neolit123: Closing this issue.

In response to [this](https://github.com/kubernetes/kubernetes/issues/105007#issuecomment-919307782): >if you wish to conform kubeadm you can upload your custom image to your private registry and create a tag / alias for the version that kubeadm needs. > >in your example kubeadm needs `3.4.1` you can upload your `3.2` and alias the tag to be `3.4.1`. > >IMPORTANT: kubeadm currently does not support custom pause images. in the long term the pause image will no longer be known in the kubelet and kubeadm and flags such as pod-infra-container-image will be removed. it will be only known in the container runtime configuration and by the CRI. > >/kind support >/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.
neolit123 commented 3 years ago

/area kubeadm

neolit123 commented 3 years ago

/sig cluster-lifecycle