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 start and stop command to kind. #2715

Open
joshrosso opened this issue Apr 11, 2022 · 10 comments
Open

Add start and stop command to kind. #2715

joshrosso opened this issue Apr 11, 2022 · 10 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@joshrosso
Copy link

What would you like to be added:

Add a start and stop command to kind.

This would be a light abstraction on docker kill or docker stop and docker start. It would also do some validation that start/stop is supported for the cluster (e.g. is it multi-node? etc).

note, I've not considered podman support, but imagine this could be possible

Why is this needed:

For the sake of local resources, I sometimes use docker kill to turn down running (single-node) kind clusters and docker start to bring them back up. It could be nice to do this entirely through kind.

Curious if the kind project would be interested in a contribution around this functionality! No worries if not, thanks for your consideration 😄!

@BenTheElder
Copy link
Member

For the sake of local resources, I sometimes use docker kill to turn down running (single-node) kind clusters and docker start to bring them back up. It could be nice to do this entirely through kind.

Are you sure this is working properly? What host environment?

IIRC in the past we did not do this because it didn't actually work correctly. That may not be true today due to various fixes ...

@aojea
Copy link
Contributor

aojea commented Apr 19, 2022

IIRC it works for single node, but it will fail for multi-node if the runtime assign different IPs to the node

@tao12345666333
Copy link
Member

We did have some attempts before, but unfortunately not all problems were solved in the end, more details can refer to #408 and #484

@BenTheElder BenTheElder added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Apr 21, 2022
@BenTheElder
Copy link
Member

seems like this is on the backlog until #1689 is fixed

@jaredallard
Copy link

jaredallard commented May 9, 2022

In case it's interesting we solved this in our fork of KinD for single node clusters by letting Docker assign a stable IP address and then using it to prevent issues with IP address changes. (getoutreach#4 and getoutreach#5)

It's not perfect but it works.

One of these days I want to pitch the few changes we made in PRs here, but just haven't gotten to It so hopefully some of that code is useful for anyone wanting to implement a start/stop until it's done here.

@BenTheElder
Copy link
Member

Thanks for sharing!

One of these days I want to pitch the few changes we made in PRs here, but just haven't gotten to It so hopefully some of that code is useful for anyone wanting to implement a start/stop until it's done here.

If you do, please see our contributing guide https://kind.sigs.k8s.io/docs/contributing/getting-started/
In particular we'd prefer to discuss approach in detail before moving to feature PRs.

Also FWIW there's promising alternatives in #2671 (though, that reallly should have been discussed more up front as well, and probably same thing for the changes being PRed to kubeadm).

@cjc7373
Copy link

cjc7373 commented Oct 25, 2024

Since multi-node cluster (with a single control plane node) is working after restarting docker. I think it is enough to just call docker stop/start to implement this?

@BenTheElder
Copy link
Member

I think it is enough to just call docker stop/start to implement this?

You can ~kind get nodes | xargs docker stop ... for now but we also have podman where this won't work for multi-node clusters IIRC, nerdctl where I'm not sure, and in all cases where HA doesn't work

#2272 #1689 amongst others

@jaredallard
Copy link

jaredallard commented Oct 25, 2024

Note if you start and stop a kind node in Docker, the IP will change for the container, which breaks the cluster. At least that was the case when I last worked in an environment using KinD in 2023, so that's what required the changes I originally made shared.

Sorry I never got around to starting a discussion around those changes before I stopped working there 😿

@BenTheElder
Copy link
Member

Note if you start and stop a kind node in Docker, the IP will change for the container, which breaks the cluster. At least that was the case when I last worked in an environment using KinD in 2023

That shouldn't have been breaking kind even in 2023. It was mitigated in may 2022. #2775

There are other issues though, with podman (and maybe nerdctl) and with multiple-control-plane nodes / "HA" (see above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

6 participants