Do I need to install kubectl after installing docker? - windows

Do I need to install kubectl after installing docker? Yet docker comes with its own version of kubeCtl?
I was watching this tutorial and I saw that kubectl was installed after installing docker. Even in the Kubernetes docs they say:
Note: Docker Desktop for Windows adds its own version of kubectl to
PATH. If you have installed Docker Desktop before, you may need to
place your PATH entry before the one added by the Docker Desktop
installer or remove the Docker Desktop's kubectl.
This, to me, seems to imply that it is not uncommon to install kubectl when you have installed one that comes with docker. Why is it so?

You may want to have different version of kubectl in certain scenarios. For example you may want to interact with a remote kuberneretes cluster from the same windows system with latest version of kubectl which may not be installed with docker desktop.
It's generally recommended to have a version of kubectl which matches with the Kubernetes API Server version.

Related

bind source path does not exist: /host_mnt

I have a ddev installation on macOS which I used for a while.
ddev 1.16.2
docker 20.10.0
macOS 11.0.1 - Intel
Today I upgraded to docker 20.10.0 and in the process to ddev 1.16.2.
When I start an existing site, that worked all the time I get
Creating ddev-mysite-db ... error
ERROR: for ddev-mysite-db Cannot create container for service db: invalid mount config for type "bind": bind source path does not exist: /host_mnt/Users/me/Documents/Development/WebSite/mysite/.ddev
This started to happen after I upgraded docker from the previous version. Upgrading ddev did not change too much.
Even when I create a new site, the same error message pops up so I am pretty much stuck.
At least for me it looks like the docker 20.10.0 breaks ddev. Any ideas how to deal with that are very much appreciated.
Docker/macOS are not allowing access to the directory ~/Documents.
Starting with macOS Catalina, ~/Documents is a "protected directory", so you have to allow docker access to it, and docker should prompt.
However, Docker Desktop for Mac's 3.0.0 release (which I imagine you're referring to) had a bug where it did not do this properly. I imagine you need to upgrade to version 3.0.1 which was released today. Just "Check for updates"
In Docker > Preferences > Experimental features you can try disabling gRPC, and make Docker use osxfs file sharing system.
Reference: https://github.com/docker/for-mac/issues/4859#issuecomment-689012097

docker-compose command not available for mac

I installed docker with the instructions here, downloading from docker-hub
https://docs.docker.com/docker-for-mac/install/
But when I run docker-compose I get this error
pyenv: docker-compose: command not found
The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv
Also, docker-compose is available under /Users
which docker-compose
/Users/<username>/.pyenv/shims/docker-compose
In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.
https://docs.docker.com/compose/install/
Is something wrong with my installation?
I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.
docker-compose is a utility that is now a parameter in mac docker
so instead of docker-compose up, its now docker compose up
if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.

How to use a docker executable of highest version installed by nix in bash?

Via nix I have a number of docker executables installed on my local machine.
Here is an example:
/nix/store/dbq6mzbsgwv1rnzc52qjbaf33gsfn51z-docker-19.03.4/bin/docker
/nix/store/dbq6mzbsgwv1rnzc52qjbaf33gsfn51z-docker-19.03.4/libexec/docker
/nix/store/dbq6mzbsgwv1rnzc52qjbaf33gsfn51z-docker-19.03.4/libexec/docker/docker
/nix/store/dbq6mzbsgwv1rnzc52qjbaf33gsfn51z-docker-19.03.4/share/bash-completion/completions/docker
/nix/store/fhhly0rgbygghhfmwmdkacrh6cvg6hvg-user-environment/bin/docker
/nix/store/fhhly0rgbygghhfmwmdkacrh6cvg6hvg-user-environment/libexec/docker
/nix/store/fhhly0rgbygghhfmwmdkacrh6cvg6hvg-user-environment/share/bash-completion/completions/docker
I want to able to reuse the docker installed by nix for my dev work. One of the reasons is that the inhouse toolchain relies on a particular version of docker. If I install Docker for Mac I will run into runtime exception.
Is there neat nix command line trick such I can get the path to the highest version of docker? e.g. in the example above I want to use the docker executable under dbq6mzbsgwv1rnzc52qjbaf33gsfn51z-docker-19.03.4. Ideally, I would like to use something like $(nix find-path docker)/bin/docker to invoke the 19.03.04 docker.
I tried nix run docker or nix dump-path docker but of course they are not the right subcommands.
I want to avoid maintaining another BASH variable to hold a hardcoded path to 19.03.04 docker, because my project might upgrade the docker runtimes from time to time.

Install kubeadm in macOS

How to install kubeadm for Kubernetes in macOS. When tempting to use
brew install kubeadm
I get this error
Error: No available formula with the name "kubeadm"
==> Searching for a previously deleted formula (in the last month)..
NB : In macOS I can't use apt-get
Not sure about MAC OS
The supported platforms on their list are:
Ubuntu 16.04+
Debian 9
CentOS 7
RHEL 7
Fedora 25/26 (best-effort)
HypriotOS v1.0.1+
Container Linux (tested with 1800.6.0)
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
KubeAdm is not for Desktop local environment.
You can install Docker For MAC that will install the minikube environment for you.
You are not able to directly install kubeadm and set up kubernetes cluster locally on MAC OS because of docker.
Unfortunately for MAC we should have VirtualBox where Docker will run + boot2docker.
And the best option here(as #Ijaz Ahmad Khan mentioned) is to use Docker Desktop for Mac
You can use below guide to correctly configure your cluster: How to Install Kubernetes on Mac
At the moment kubernetes server components doesn't ship any Darwin OS(MAC OS) binaries so the control plane component can't directly run under MACOS. Although they ship kubectl for Darwin OS which can use any API Server to connect to and deploy the applications.
However I was able to run the Hyperkube Binary inside the container that can support the all control plane components but this would all be under docker container so that isn't essentially a Darwin OS supported Control Plane.
You can try this if you just want to use local installs:
https://github.com/kubernetes/kubernetes/tree/master/cluster/images/hyperkube
also If you are really looking to do everything in MAC , then possibly Install Hyperkit driver and that will allow you do pretty much the same thing to pull up the control plane images and built it up.
Damn, since this is 3 years old question, might be too late but you can use cluster on MacOS with using brew install kind.
Kind is short for Kubernetes IN Docker.
Here the documentation on more details about kind.
https://kind.sigs.k8s.io/

How to download Docker CLI only for Windows 7

I'm using Windows 7 Pro and have existing shared Docker engine running on a Linux. I would like to use my workstation (with development environment) to access shared Docker engine.
Does someone know how to retrieve Docker client only for Windows 7 ? I have no admin privilege, so I can't install Docker Toolbox.
Older Clients can be found here https://download.docker.com/win/static/stable/x86_64/
And here a some newer Builds by Stefan Scherer (Docker employee) https://github.com/StefanScherer/docker-cli-builder.
Just download docker.exe and add it to your windows path variable.
Then set your DOCKER_HOST variable to define against which Docker daemon you want to speak.
The official Downloads have finally been published:
Mac CLI binaries are available at
https://download.docker.com/mac/static/stable/
Windows CLI (and daemon) binaries at https://download.docker.com/win/
Linux CLI packages are available for each distro as docker-cli (deb and rpm) packages: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/
From: https://github.com/docker/cli/issues/2281#issuecomment-947699400
Although docker provides a REST-like API, there aren't many clients for it. A quick google turned up one on github, but ymmv. Even if you did find one, you're likely to run into the same problems involved in running docker-ce locally anyway.
There are a handful of gui clients that you could run on that engine and access with a browser, but if you are specifically after a cli you're SOL with this.
If you have an ssh client (git bash, or putty, or something), and you can arrange to run a bastion container on the engine, then you could run a container to ssh into and use that as if it's your local machine. You'd still have to scp resources onto it, but you'll eventually have to solve that problem anyway. Something like:
sudo docker container run --interactive --tty -v /var/run/docker.sock:/var/run/docker.sock image
Where 'image' is a linux image with an ssh server and appropriate keys, git, and docker installed. You could mount a local volume for persistence, or you could just keep everything in git.

Resources