-
Couldn't load subscription status.
- Fork 41.6k
kubeadm: added container runtime version check to preflight #134906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: carlory <baofa.fan@daocloud.io>
|
Skipping CI for Draft Pull Request. |
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carlory The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold |
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cri-api/README.md#v128
Checking RuntimeConfig is a little trick here. However, containerd version is not in cri info. I think this would be OK. |
|
This PR assumes that the container runtime is running on the node when we do init, join or upgrade operations. I'm unsure whether it is correct? If yes, I will add the same check for init/join operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, added a few minor comments.
|
|
||
| kubeletVersion, err := GetKubeletVersion(crc.exec) | ||
| if err != nil { | ||
| return nil, []error{errors.Wrap(err, "couldn't get kubelet version")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return nil, []error{errors.Wrap(err, "couldn't get kubelet version")} | |
| return nil, []error{errors.Wrap(err, "could not get kubelet version")} |
|
|
||
| ok, err := crc.runtime.IsRuntimeConfigImplemented() | ||
| if err != nil { | ||
| return nil, []error{errors.Wrap(err, "couldn't check if runtime config is available")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return nil, []error{errors.Wrap(err, "couldn't check if runtime config is available")} | |
| return nil, []error{errors.Wrap(err, "could not check if the runtime config is available")} |
| return nil, []error{errors.Wrap(err, "couldn't check if runtime config is available")} | ||
| } | ||
| if !ok { | ||
| if kubeletVersion.GreaterThan(versionutil.MustParseSemantic("v1.35.0")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if kubeletVersion.GreaterThan(versionutil.MustParseSemantic("v1.35.0")) { | |
| if kubeletVersion.GreaterThan(versionutil.MustParseSemantic("v1.35.0-0")) { |
to handle 1.35 pre-releases?
| "time" | ||
|
|
||
| "google.golang.org/grpc/codes" | ||
| "google.golang.org/grpc/status" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "google.golang.org/grpc/status" | |
| "google.golang.org/grpc/status" | |
separate import group for non-k8s imports.
| } | ||
| if !ok { | ||
| if kubeletVersion.GreaterThan(versionutil.MustParseSemantic("v1.35.0")) { | ||
| err := errors.New("CRI implementation should be updated to support RuntimeConfig. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| err := errors.New("CRI implementation should be updated to support RuntimeConfig. " + | |
| err := errors.New("You must update your container runtime to a version that supports the CRI method RuntimeConfig. " + |
we need to make it clear that that the user must update their container runtime.
| "For more information, see https://git.k8s.io/enhancements/keps/sig-node/4033-group-driver-detection-over-cri") | ||
| errorList = append(errorList, err) | ||
| } else { | ||
| warning := errors.New("CRI implementation should be updated to support RuntimeConfig. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
yes, think we assume the container runtime is running before these commands are executed. |
best to also mention what actions the users need to take for what releases and what this config used for. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR is related to:
Fixes kubernetes/kubeadm#3229
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: