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

Add architecture to the binaries and images in the cache #9593

Closed
afbjorklund opened this issue Nov 1, 2020 · 3 comments · Fixed by #13539
Closed

Add architecture to the binaries and images in the cache #9593

afbjorklund opened this issue Nov 1, 2020 · 3 comments · Fixed by #13539
Assignees
Labels
co/generic-driver kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@afbjorklund
Copy link
Collaborator

afbjorklund commented Nov 1, 2020

When supporting remote clusters of a different architecture, we need to add the arch in addition to the OS:

~/.minikube/cache/linux/v1.19.3
├── kubeadm
├── kubectl
└── kubelet

Simplest would be to add it after the OS, but we could support both in order to preserve existing user caches ?

~/.minikube/cache/linux
├── amd64
│   └── v1.19.3
│       ├── kubeadm
│       ├── kubectl
│       └── kubelet
└── arm64
    └── v1.19.3
        ├── kubeadm
        ├── kubectl
        └── kubelet

For instance when running an amd64 host, towards a arm64 machine. Either local hardware or cloud instance.

  • Raspberry Pi

  • AWS Graviton

Same thing for the images, if not using the preload (the preloaded-tarball files already include the arch, though)

~/.minikube/cache/images
├── gcr.io
│   └── k8s-minikube
│       └── storage-provisioner_v3
├── k8s.gcr.io
│   ├── coredns_1.7.0
│   ├── etcd_3.4.13-0
│   ├── kube-apiserver_v1.19.2
│   ├── kube-controller-manager_v1.19.2
│   ├── kube-proxy_v1.19.2
│   ├── kube-scheduler_v1.19.2
│   └── pause_3.2
└── kubernetesui
    ├── dashboard_v2.0.3
    └── metrics-scraper_v1.0.4

~/.minikube/cache/images/amd64
~/.minikube/cache/images/arm64
@afbjorklund afbjorklund changed the title Add architecture to the binaries in the cache Add architecture to the binaries and images in the cache Nov 1, 2020
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Nov 1, 2020

Also, this code needs to be parameterized:

                        src, err := download.Binary(name, cfg.KubernetesVersion, "linux", runtime.GOARCH)
                        if err != nil {
                                return errors.Wrapf(err, "downloading %s", name)
                        }
                       if _, err := download.Binary(bin, version, "linux", runtime.GOARCH); err != nil {
                                return errors.Wrapf(err, "caching binary %s", bin)
                        }
func archTag(hasTag bool) string {
        if runtime.GOARCH == "amd64" && !hasTag {
                return ":"
        }
        return "-" + runtime.GOARCH + ":"
}
var defaultPlatform = v1.Platform{
        Architecture: runtime.GOARCH,
        OS:           "linux",
}

Basically split host arch and cluster (node?) arch.

Using runtime.GOARCH is a good default, but it needs to be possible to override.

It is still OK to hardcode the OS (for now...), since Kubernetes only runs on Linux.

@afbjorklund afbjorklund added kind/feature Categorizes issue or PR as related to a new feature. co/generic-driver priority/backlog Higher priority than priority/awaiting-more-evidence. labels Nov 1, 2020
@afbjorklund afbjorklund changed the title Add architecture to the binaries and images in the cache Add architecture (amd64/arm64/etc) to the binaries and images in the cache Nov 15, 2020
@afbjorklund afbjorklund changed the title Add architecture (amd64/arm64/etc) to the binaries and images in the cache Add architecture to the binaries and images in the cache Nov 15, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 13, 2021
@priyawadhwa priyawadhwa added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 18, 2021
@afbjorklund afbjorklund added this to the v.1.19.0-candidate milestone Feb 26, 2021
@medyagh medyagh modified the milestones: v.1.19.0, v1.20.0-candidate Mar 2, 2021
@sharifelgamal sharifelgamal added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Apr 12, 2021
@sharifelgamal sharifelgamal removed this from the 1.23.0-candidate milestone Jun 14, 2021
@spowelljr spowelljr added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Oct 6, 2021
@sharifelgamal sharifelgamal added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Jan 6, 2022
@sharifelgamal sharifelgamal added this to the 1.26.0-candidate milestone Jan 6, 2022
@sharifelgamal
Copy link
Collaborator

Ok, this has become more of an issue recently, since if someone accidentally runs an amd64 minikube binary on an arm machine, it corrupts their cache. Let's fix this one and for all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/generic-driver kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants