Skip to content
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

kubeadm: check if all images already exist #129474

Closed

Conversation

afbjorklund
Copy link

@afbjorklund afbjorklund commented Jan 3, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Less lines in the output of kubeadm, if the user has followed instructions and done kubeadm config images pull

Which issue(s) this PR fixes:

Fixes kubernetes/kubeadm#3145

Special notes for your reviewer:

This does not actually change anything about the pulling of images, just exists early if nothing really needs doing.

Does this PR introduce a user-facing change?

Check if all images required by kubeadm already exists, before outputting a message about pulling.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 3, 2025
@k8s-ci-robot
Copy link
Contributor

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 3, 2025
@k8s-ci-robot k8s-ci-robot added area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 3, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: afbjorklund
Once this PR has been reviewed and has the lgtm label, please assign carlory for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is reducing the number of output lines really that much of a problem?
overall i'm not a fan of this change, as is.

a smarter integration would be to instead of having a preliminary RunImagesExistCheck before RunPullImagesCheck, is to improve RunPullImagesCheck to do the following:

  • determine what images need to be pulled (must support concurrency.
  • if no pulls are needed print message about it.
  • if some pulls need to be done print the old message about slow internet and the 'config images' command. then do the pull (must support concurrency).

but if this is only about reducing the number of lines, i don't think there is a good argument. the current implementation and UX works fine. it might have been a problem if the list of images is larger.

@@ -75,6 +75,10 @@ func runPreflight(c workflow.RunData) error {
return nil
}

if err := preflight.RunImagesExistCheck(utilsexec.New(), data.Cfg(), data.IgnorePreflightErrors()); err == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this type of calls ignore early errors from the CRI client.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was assuming that they would be repeated below.

if err := preflight.RunImagesExistCheck(utilsexec.New(), initConfig, data.IgnorePreflightErrors()); err == nil {
fmt.Println("[upgrade/preflight] All images required for setting up a Kubernetes cluster exist")
return nil
}
fmt.Println("[upgrade/preflight] Pulling images required for setting up a Kubernetes cluster")
fmt.Println("[upgrade/preflight] This might take a minute or two, depending on the speed of your internet connection")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line can be removed, but it helps newbie users who anticipate a progress but are on slow internet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good line, since it can take several minutes - with all the progress output staying in the runtime.

@afbjorklund
Copy link
Author

afbjorklund commented Jan 4, 2025

is reducing the number of output lines really that much of a problem?

It is not, but then again every line added leads to the problem of the output (and the serial log) getting ignored...

i.e. cloud-init calls kubeadm init, and then that output goes into the lima serial.log for troubleshooting (if needed)


The warnings about the containerd config (for 2.0) is also just spam, and everything is working fine now regardless.

level=warning msg="Configuration migrated from version 2, use containerd config migrate to avoid migration

level=warning msg="Ignoring unknown key in TOML for plugin" error="strict mode: fields in the document are missing in the target struct key=sandbox_image plugin=io.containerd.cri.v1.runtime

detected that the sandbox image "" of the container runtime is inconsistent with that used by kubeadm.It is recommended to use "registry.k8s.io/pause:3.10" as the CRI sandbox image.

But opened up some issues about it anyway, so was thinking that kubeadm could also cut down on the "logging"...


but if this is only about reducing the number of lines, i don't think there is a good argument.
the current implementation and UX works fine.

Let's close it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if all images already exist, before pulling the images
3 participants