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

Docker for Mac overwrites/deletes existing kubectl binary #2368

Closed
recollir opened this issue Jan 6, 2018 · 8 comments

Comments

@recollir
Copy link

commented Jan 6, 2018

Expected behavior

When activating Kubernetes in Docker for Mac an existing kubectl binary in /usr/local/bin should not be touched or at least saved and then "re-installed" after Kubernetes is disabled. Docker could also check if the existing kubectl binary is "compatible" with the Kubernetes version that is activated. Or install it with a different name.

Actual behavior

Docker for Mac overwrites/deletes an existing kubectl binary when activating/disabling Kubernetes.

Information

  • Version 17.12.0-ce-mac45 (21669), Channel: edge, dfde464b63

Steps to reproduce the behavior

https://www.youtube.com/watch?v=pDgLlr8czQY

  1. Ensure that Kubernetes is disabled in Docker for Mac
  2. Install a kubectl binary under /usr/local/bin (e.g. brew install kubernetes-cli)
  3. Check kubectl (e.g. kubectl version)
  4. Activate Kubernetes in Docker for Mac
  5. Check kubectl again (the version might have changed
  6. Disable Kubernetes in Docker for Mac
  7. Check kubectl - you will find that it was deleted
  8. If homebrew was used to install kubectl, it still thinks that it is installed
@DonMartin76

This comment has been minimized.

Copy link

commented Jan 12, 2018

I can also add that an installation of kubectl via homebrew is also botched when un-ticking the "Kubernetes" check box in Docker for mac's Preferences. This is very annoying, as I tend to uncheck the Kubernetes box when I don't need it, and when I'm on battery, as the local Kubernetes cluster eats quite a lot of battery.

@guillaumerose

This comment has been minimized.

Copy link
Member

commented Jan 12, 2018

Sorry for that. We wrote a fix for that a month ago, but as you said, it's broken. Let me check this.

@guillaumerose

This comment has been minimized.

Copy link
Member

commented Jan 18, 2018

In the next release, it will be better : I change the mechanism to backup kubectl symlink and restore it if you disable Kubernetes.

I hope it will be better for you. For the compatibility question, I don't know a good solution. If someone has an idea, feel free to answer here.

@unguiculus

This comment has been minimized.

Copy link

commented Jan 18, 2018

I'd prefer it if Docker didn't touch an existing kubectl at all. At least I would like to have an option to disable it. I prefer to always use kubectl installed by Homebrew.

@afirth

This comment has been minimized.

Copy link

commented Jan 23, 2018

Thanks for your efforts here @guillaumerose. I'm unclear on the internals here, but got unpleasantly bitten by this when all my existing kube stuff broke on switching to edge. Agree with @unguiculus , why can't docker just add a new kubectl profile like everyone else? If docker needs a special kubectl binary, maybe don't call it kubectl? Otherwise this can't coexist with people running production kube clusters.

@SchwarzM

This comment has been minimized.

Copy link

commented Jan 24, 2018

I think what docker is looking for is:
https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/

Which will seamlessly integrate into kubectl if needed / wanted but will be a standalone executable (which can be named however one wants).

@docker-desktop-robot

This comment has been minimized.

Copy link
Collaborator

commented May 9, 2018

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@SchwarzM

This comment has been minimized.

Copy link

commented May 9, 2018

/remove-lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.