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

Fix to prevent accepting addons flag when --no-kubernetes #15003

Merged
merged 4 commits into from
Jun 14, 2023
Merged

Fix to prevent accepting addons flag when --no-kubernetes #15003

merged 4 commits into from
Jun 14, 2023

Conversation

kpiljoong
Copy link
Contributor

@kpiljoong kpiljoong commented Sep 22, 2022

Fixes #13487

Disallow accepting addons flag when no kubernetes. Also, a new output string is added.

Before:

$ minikube start --no-kubernetes
$ minikube addons enable ingress
💡  ingress is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub.
You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
💡  After the addon is enabled, please run "minikube tunnel" and your ingress resources would be available at "127.0.0.1"
    ▪ Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
    ▪ Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
    ▪ Using image k8s.gcr.io/ingress-nginx/controller:v0.49.3
🔎  Verifying ingress addon...

❌  Exiting due to MK_ADDON_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/
minikube/kubeconfig /var/lib/minikube/binaries/v0.0.0/kubectl apply -f /etc/kubernetes/addons/ingress-deploy.yaml: Process exited with status 1
stdout:

stderr:
sudo: /var/lib/minikube/binaries/v0.0.0/kubectl: command not found
 get kube-client to validate ingress addon: client config: context "minikube" does not exist: client config: context "minikube" does not exist]

After

$ minikube start --no-kubernetes
$ minikube addons enable ingress      

❌  Exiting due to MK_USAGE: You cannot enable addons on a cluster without Kubernetes, to enable Kubernetes on your cluster, run: minikube start --kubernetes-version=stable

Before

$ minikube start --no-kubernetes --addons ingress
😄  minikube v1.26.1 on Microsoft Windows 10 Pro 10.0.19043 Build 19043
✨  Using the docker driver based on existing profile
👍  Starting minikube without Kubernetes in cluster minikube
🚜  Pulling base image ...
🏃  Updating the running docker "minikube" container ...
🐳  Preparing Docker 20.10.17 ...
🏄  Done! minikube is ready without Kubernetes!

After

$ minikube start --no-kubernetes --addons ingress
😄  minikube v1.27.0 on Microsoft Windows 10 Pro 10.0.19043 Build 19043
✨  Using the docker driver based on existing profile

❌  Exiting due to MK_USAGE: You cannot enable addons on a cluster without Kubernetes, to enable Kubernetes on your cluster, run: minikube start --kubernetes-version=stable

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 22, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 22, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @kpiljoong!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 22, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @kpiljoong. 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 k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 22, 2022
@kpiljoong
Copy link
Contributor Author

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 22, 2022
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

@kpiljoong I like this PR thank you, this makes a lot of sense !

one thing i could think of is, in the future, if we have an addon that does NOT require kubernetes, they should be allowed. but I believe all of our current addons do require kubernetes which is fine for this PR

// It places here because cluster config is required to get the old version.
if cmd.Flags().Changed(config.AddonListFlag) {
if k8sVersion == constants.NoKubernetesVersion || viper.GetBool(noKubernetes) {
exit.Message(reason.Usage, "Cannot enable addons without Kubernetes")
Copy link
Member

Choose a reason for hiding this comment

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

how about add a message here that tells user what to do.
"You can not enable this addon with a cluster without Kubernetes, to re-configure your cluster with Kubernetes run this command
minikube start --no-kubernetes=false
"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better. I appreciate it. I just re-request a review.

Copy link
Member

Choose a reason for hiding this comment

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

The problem is --no-kubernetes=false won't actually re-enable Kubernetes. I'd recommend we change the command to --kubernetes-version=stable

@kpiljoong kpiljoong requested review from medyagh and removed request for klaases September 25, 2022 19:23
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 15, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please 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 Mar 15, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 14, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

@medyagh medyagh reopened this May 17, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kpiljoong
Once this PR has been reviewed and has the lgtm label, please assign afbjorklund for approval. For more information see the Kubernetes Code Review Process.

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

@medyagh
Copy link
Member

medyagh commented May 17, 2023

@kpiljoong sorry for the long wait on this PR, this got lost in the review list, do you mind rebasing this PR so I could review it again?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2023
@spowelljr spowelljr removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 13, 2023
@medyagh
Copy link
Member

medyagh commented Jun 13, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 13, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15003) |
+----------------+----------+---------------------+
| minikube start | 52.4s    | 52.4s               |
| enable ingress | 27.3s    | 27.7s               |
+----------------+----------+---------------------+

Times for minikube start: 50.2s 50.7s 55.5s 52.8s 52.9s
Times for minikube (PR 15003) start: 51.9s 51.0s 52.8s 51.8s 54.6s

Times for minikube ingress: 27.3s 27.7s 27.3s 27.3s 27.2s
Times for minikube (PR 15003) ingress: 27.2s 27.7s 27.7s 28.3s 27.8s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15003) |
+----------------+----------+---------------------+
| minikube start | 23.9s    | 24.4s               |
| enable ingress | 21.0s    | 21.1s               |
+----------------+----------+---------------------+

Times for minikube start: 22.6s 22.6s 24.4s 25.0s 24.7s
Times for minikube (PR 15003) start: 23.6s 25.6s 22.4s 25.3s 25.3s

Times for minikube ingress: 20.8s 20.8s 21.8s 20.8s 20.8s
Times for minikube (PR 15003) ingress: 21.3s 20.9s 20.8s 21.3s 21.3s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15003) |
+----------------+----------+---------------------+
| minikube start | 22.5s    | 22.2s               |
| enable ingress | 32.2s    | 29.1s               |
+----------------+----------+---------------------+

Times for minikube start: 22.9s 23.5s 20.0s 23.1s 23.2s
Times for minikube (PR 15003) start: 20.6s 23.6s 20.6s 23.0s 23.1s

Times for minikube ingress: 31.4s 47.3s 31.3s 18.3s 32.4s
Times for minikube (PR 15003) ingress: 32.3s 19.4s 31.3s 31.3s 31.3s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
QEMU_macOS TestFunctional/serial/InvalidService (gopogh) 0.00 (chart)
Docker_macOS TestNoKubernetes/serial/StartWithK8s (gopogh) 0.68 (chart)
QEMU_macOS TestFunctional/parallel/CertSync (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/CpCmd (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/DashboardCmd (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/DockerEnv/bash (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/FileSync (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageBuild (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageListTable (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageLoadDaemon (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageLoadFromFile (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageReloadDaemon (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageSaveToFile (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ImageCommands/ImageTagAndLoadDaemon (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/NodeLabels (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/NonActiveRuntimeDisabled (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ServiceCmd/DeployApp (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ServiceCmd/HTTPS (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ServiceCmd/JSONOutput (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ServiceCmd/List (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/ServiceCmd/URL (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/StatusCmd (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/TunnelCmd/serial/AccessThroughDNS (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/TunnelCmd/serial/DNSResolutionByDig (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/TunnelCmd/serial/WaitService/Setup (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/UpdateContextCmd/no_clusters (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/UpdateContextCmd/no_minikube_cluster (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/parallel/Version/components (gopogh) 6.94 (chart)
QEMU_macOS TestFunctional/serial/CacheCmd/cache/cache_reload (gopogh) 6.94 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@medyagh medyagh merged commit cc91ebf into kubernetes:master Jun 14, 2023
@medyagh medyagh changed the title Fix to prevent accepting addons flag when no kubernetes Fix to prevent accepting addons flag when --no-kubernetes Jun 14, 2023
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output message if user tries to enable addons with --no-kubernetes
8 participants