-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
download crictl at preload and runtime #18362
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
Hi @ComradeProgrammer. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
c654883
to
46cd29d
Compare
46cd29d
to
69da930
Compare
69da930
to
ef27662
Compare
ef27662
to
10bfc7a
Compare
10bfc7a
to
0efd831
Compare
revised. now we use ssh to run crictl --version to check the crictl version, and we also use checkcache |
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.
We need something like PreloadExists
to check if the crictl binary exists before trying to download it. Right now if we try starting with a Kubernetes version that doesn't have a matching crictl version (v1.30.0-beta.0 for example) the entire start fails due to the crictl download failing (as crictl v1.30.0 doesn't exist yet).
❌ Exiting due to K8S_INSTALL_FAILED: Failed to update cluster: update primary control-plane node: transferring crictl: downloading crictl: download failed: https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.30.0/crictl-v1.30.0-linux-arm64.tar.gz: getter: &{Ctx:context.Background Src:https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.30.0/crictl-v1.30.0-linux-arm64.tar.gz Dst:/Users/powellsteven/.minikube/cache/linux/arm64/v1.30.0-beta.0/crictl.download Pwd: Mode:2 Umask:---------- Detectors:[0x106c5af40 0x106c5af40 0x106c5af40 0x106c5af40 0x106c5af40 0x106c5af40 0x106c5af40] Decompressors:map[bz2:0x140005a0fa0 gz:0x140005a0fa8 tar:0x140005a0f50 tar.bz2:0x140005a0f60 tar.gz:0x140005a0f70 tar.xz:0x140005a0f80 tar.zst:0x140005a0f90 tbz2:0x140005a0f60 tgz:0x140005a0f70 txz:0x140005a0f80 tzst:0x140005a0f90 xz:0x140005a0fc0 zip:0x140005a0fe0 zst:0x140005a0fc8] Getters:map[file:0x140024f7830 http:0x140024e2aa0 https:0x140024e2af0] Dir:false ProgressListener:0x106be2e80 Insecure:false DisableSymlinks:false Options:[0x103788bd0]}: bad response code: 404
╭───────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ 😿 If the above advice does not help, please let us know: │
│ 👉 https://github.com/kubernetes/minikube/issues/new/choose │
│ │
│ Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue. │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
So we should check for the existance of the binay first, and it it doesn't exist, log that we're not downloading matching crictl version due to it not existing and continue on using whatever version is already on the machine.
aa9cc4f
to
9907803
Compare
Fixed. Now it is checked whether the download results in 404, and if so, no errors will be returned and whatever version is already on the machine will be used |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ComradeProgrammer 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 |
6ec8370
to
e53ddb1
Compare
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
e53ddb1
to
4305e2f
Compare
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
54c3c0b
to
fa495bf
Compare
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.
it is much better if we convert this PR into two PRS
1- adding the critcle to the preload genreation
2- Folow up PR that will use that, so we can test it and see if it is making anything slower
@@ -86,3 +87,32 @@ func Binary(binary, version, osName, archName, binaryURL string) (string, error) | |||
} | |||
return targetFilepath, nil | |||
} | |||
|
|||
// CrictlBinary download the crictl tar archive to the cache folder and untar it |
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.
is this for only when --preload is false? if yes please add it to the comment
sm := sysinit.New(k.c) | ||
|
||
if err := bsutil.TransferBinaries(cfg.KubernetesConfig, k.c, sm, cfg.BinaryMirror); err != nil { | ||
return errors.Wrap(err, "downloading binaries") |
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.
shouldnt this be tranferring crictlc? make it more specific, so when the error bubles up we find it easier
@@ -945,6 +946,27 @@ func (k *Bootstrapper) UpdateNode(cfg config.ClusterConfig, n config.Node, r cru | |||
|
|||
klog.Infof("kubelet %s config:\n%+v", kubeletCfg, cfg.KubernetesConfig) | |||
|
|||
sm := sysinit.New(k.c) | |||
|
|||
if err := bsutil.TransferBinaries(cfg.KubernetesConfig, k.c, sm, cfg.BinaryMirror); err != nil { |
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.
why this is added ? I thought this was downloading critctl, why this was needed to be added here?
FIX #18359
Before:
minikube use the crictl installed in the kic image
After:
sudo crictl --version
is executed on the host to check whether the version of crictl corresponds to k8s version~/.minikube
then the cached binary will be usede.g. under such circumstance, after starting minikube cluster, use minikube ssh and we can see that
@spowelljr @medyagh