Skip to content

Only run minikube image build on control plane by default #11192

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

Closed
afbjorklund opened this issue Apr 25, 2021 · 3 comments · Fixed by #12149
Closed

Only run minikube image build on control plane by default #11192

afbjorklund opened this issue Apr 25, 2021 · 3 comments · Fixed by #12149
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. 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 Apr 25, 2021

Currently there is a lot of duplicated code, between minikube image load and minikube image build.

One of these includes selecting which minikube nodes (machines) to run on, in the selected profile that is.

This might have some issues with multi-node:

For load, it will load the image to all the nodes in the cluster (which makes sense, without a registry)
For build, it will build the image on each and every node - which might make less sense, for some builds

For save, it would the save the image from each node in the cluster - which doesn't make so much sense.
The regular assumption is that the same image (name:tag) contains the same content, so only save once ?

The suggestion is to build/save on the Control Plane.

See #11130 (comment) for minikube image save


This is the single-node workflow:

  1. Build image on control plane

When the save functionality is in place, that would be a simple method of loading the new image to the other nodes:

  1. Build image on control plane
  2. Save image from control plane, to the host cache
  3. Load image on worker nodes, from the host cache

When having a registry deployed, or when using an external registry, this becomes the usual cluster workflow:

  1. Build image on control plane
  2. Push image from control plane, to the registry
  3. Pull image on worker nodes, from the registry
    or)
    3a) Save image from registry, in the host cache
    3b) Load image on worker nodes, from the host cache

It would be possible to select another node in the cluster.

  -n, --node='': The node to build on. Defaults to the primary control plane.

Steps 1+2 would be one single command, build.
Same with steps 3, that's also a one-liner load.

As always you have the option of building directly on the host (external to minikube), and saving and pushing from there...
But that would mean that you would always have to transfer the image (even for single-node), instead of rapid turnaround.

@afbjorklund afbjorklund added kind/feature Categorizes issue or PR as related to a new feature. triage/discuss Items for discussion labels Apr 25, 2021
@medyagh
Copy link
Member

medyagh commented May 5, 2021

I agree this is a bug ! that is a good idea to build on only on control plane and then load on other thing

@sharifelgamal sharifelgamal added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. kind/bug Categorizes issue or PR as related to a bug. and removed triage/discuss Items for discussion kind/feature Categorizes issue or PR as related to a new feature. labels May 5, 2021
@sharifelgamal sharifelgamal added this to the 1.23.0-candidate milestone Jun 14, 2021
@sharifelgamal sharifelgamal changed the title Need node selection for image build and image save Only run minikube image build on control plane by default Jun 14, 2021
@sharifelgamal
Copy link
Collaborator

Ideally, we could add a --all flag for when we want to build an image on all nodes instead of just the control plane

@sharifelgamal sharifelgamal added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jun 14, 2021
@sharifelgamal sharifelgamal self-assigned this Jun 28, 2021
@sharifelgamal sharifelgamal removed their assignment Jul 20, 2021
@afbjorklund
Copy link
Collaborator Author

Commands:

minikube image build --tag myimage .
minikube image save myimage
minikube image load myimage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. 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.

3 participants