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

disable scheduled stop service on minikube start #10123

Conversation

tharun208
Copy link
Contributor

@tharun208 tharun208 commented Jan 10, 2021

Signed-off-by: Tharun rajendrantharun@live.com

Fixes #9865

@priyawadhwa I am able to do the enable the service only when scheduled-stop is initiated. But I went through different docs and references to make systemd services to be in an idle state. Need your help on this part.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 10, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @tharun208. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tharun208
To complete the pull request process, please assign priyawadhwa after the PR has been reviewed.
You can assign the PR to them by writing /assign @priyawadhwa in a comment when ready.

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

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 10, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@tharun208 tharun208 force-pushed the fix/disable_schedule_stop_on_init branch 2 times, most recently from 2d60563 to b19614c Compare January 10, 2021 19:40
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 10, 2021
Signed-off-by: Tharun <rajendrantharun@live.com>
@tharun208 tharun208 force-pushed the fix/disable_schedule_stop_on_init branch from b19614c to 15c6618 Compare January 11, 2021 05:19
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 11, 2021
Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

Hey @tharun208 thanks for adding this. So disabling the service default would need to happen in two places:

  1. The kic base image for the docker driver
  2. The ISO for our VM drivers

For point 1 I think it may be as removing the ln command which links the service:

RUN ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \

(make sure you don't delete the chmod command that is included in that RUN statement)

To ensure this works locally, I would run:

make kic-base-image # To build the new version of the image
minikube start --base-image <name of new image> # To start minikube with your local kic image
minikube ssh -- sudo systemctl status scheduled-stop # To make sure the service is actually disabled

For the ISO, removing the same line here should do the trick:

ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \

@priyawadhwa
Copy link

Let's also wait for #10132 to merge before merging this

@priyawadhwa
Copy link

Hey @tharun208 are you still working on this?

@ilya-zuyev
Copy link
Contributor

This affects only windows, right? The updated function is used only in windows builds.

@priyawadhwa
Copy link

Hey @tharun208 this PR has been quiet for a few weeks now, I'm going to close it for now. Feel free to reopen whenever you have a chance to take a look at it!

@jiefenghe
Copy link
Contributor

jiefenghe commented Feb 19, 2021

Hey @tharun208 thanks for adding this. So disabling the service default would need to happen in two places:

  1. The kic base image for the docker driver
  2. The ISO for our VM drivers

For point 1 I think it may be as removing the ln command which links the service:

RUN ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \

(make sure you don't delete the chmod command that is included in that RUN statement)

To ensure this works locally, I would run:

make kic-base-image # To build the new version of the image
minikube start --base-image <name of new image> # To start minikube with your local kic image
minikube ssh -- sudo systemctl status scheduled-stop # To make sure the service is actually disabled

For the ISO, removing the same line here should do the trick:

ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \

Hi @priyawadhwa, I'm trying to continue tharun208's work. I have a few questions in terms of your comments:

  1. make kic-base-image doesn't work. It will say make: *** No rule to make target 'kic-base-image'. Stop.
  2. Why removing ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service /etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service will stop the service by default? Because any files under /etc/systemd/sytem/multi-user.target.wants will be booted automatically? Otherwise, I was thinking maybe I can add systemctl disable minikube-scheduled-stop.service in the file to disable it.
  3. Kic base image vs. ISO are two standards of image format?

@jiefenghe
Copy link
Contributor

Hey @tharun208 thanks for adding this. So disabling the service default would need to happen in two places:

  1. The kic base image for the docker driver
  2. The ISO for our VM drivers

For point 1 I think it may be as removing the ln command which links the service:

RUN ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \

(make sure you don't delete the chmod command that is included in that RUN statement)
To ensure this works locally, I would run:

make kic-base-image # To build the new version of the image
minikube start --base-image <name of new image> # To start minikube with your local kic image
minikube ssh -- sudo systemctl status scheduled-stop # To make sure the service is actually disabled

For the ISO, removing the same line here should do the trick:

ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \

Hi @priyawadhwa, I'm trying to continue tharun208's work. I have a few questions in terms of your comments:

  1. make kic-base-image doesn't work. It will say make: *** No rule to make target 'kic-base-image'. Stop.
  2. Why removing ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service /etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service will stop the service by default? Because any files under /etc/systemd/sytem/multi-user.target.wants will be booted automatically? Otherwise, I was thinking maybe I can add systemctl disable minikube-scheduled-stop.service in the file to disable it.
  3. Kic base image vs. ISO are two standards of image format?

I did more investigation and learnt that:

  1. the kic-base-image rule has been deleted from the Makefile. I'll try to add another rule as discussed in https://kubernetes.slack.com/archives/C1F5CT6Q1/p1613893823024200
  2. I ran systemctl disable minikube-scheduled-stop.service and noticed that it will remove the /etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service symblink. So your suggestion makes sense.

@tharun208 tharun208 deleted the fix/disable_schedule_stop_on_init branch March 23, 2021 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable minikube-scheduled-stop.service until a user schedules a stop
6 participants