On my laptop I have Linux Mint OS. Details as below:
Mint version 19,
Code name : Tara,
PackageBase : Ubuntu Bionic
Cinnamon (64-bit)
I have installed kubectl binary using curl from this reference site: https://kubernetes.io/docs/tasks/tools/install-kubectl/ commands used for kubectl installation:
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
installed minikube on local linux machine using the link: https://github.com/kubernetes/minikube/releases command used for minikube installation:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.29.0/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
Downloaded this VirtualBox 5.2.18 for Linux Ubuntu 18.04 / Debian 10 AMD64 from https://www.virtualbox.org/wiki/Downloads THen I lanuched virtualbox manager. There is no virtual machine created.
Then followed quickstart guide on my local Linux Mint machine: https://github.com/kubernetes/minikube/blob/v0.29.0/README.md
On my local Linux mint machine under downloads directory, the moment I run command "minikube start" :
xxxxxxxx:~/Downloads$ minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
171.87 MB / 171.87 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.
Though I am running minikue start command on my local Linux machine, it says its starting minikube in virtualmachine inside Oracle virtualbox manager.
My first question is HOW? Is there any specific setting that is being done behind the scenes to have minikube getting started in VM installed on my operating system (in this case I am on Linux mint 19)
minikube getting started in VM
If I double click on minikube running on VM, then it opens up a screen where it asks me logging to minikube. Please see below screenshot.
My second question is: I haven't set any credentials for minikube. What could be the credentials? Is there any way to set credentials?
UPDATE 1
As per comment by @Rico , for his 2nd point, he said "to connect to minikube VM you can run minikube ssh" isn't it same like what I showed in 2nd attached screenshot in my issue? I mean double click on minikube VM running inside oracle virtualbox manager and that pops up screen asking for login credentials.
However, I tried to use command: minikube ssh on my local machine after starting minikube.
xxxxxxxxxxxxxx:~$ minikube ssh
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$ ls
$ pwd
/home/docker
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/coredns 1.2.2 367cdc8433a4 4 weeks ago 39.2MB
k8s.gcr.io/kubernetes-dashboard-amd64 v1.10.0 0dab2435c100 5 weeks ago 122MB
k8s.gcr.io/kube-apiserver-amd64 v1.10.0 af20925d51a3 6 months ago 225MB
k8s.gcr.io/kube-controller-manager-amd64 v1.10.0 ad86dbed1555 6 months ago 148MB
k8s.gcr.io/kube-scheduler-amd64 v1.10.0 704ba848e69a 6 months ago 50.4MB
k8s.gcr.io/etcd-amd64 3.1.12 52920ad46f5b 6 months ago 193MB
k8s.gcr.io/kube-addon-manager v8.6 9c16409588eb 7 months ago 78.4MB
k8s.gcr.io/k8s-dns-kube-dns-amd64 1.14.8 80cc5ea4b547 8 months ago 50.5MB
k8s.gcr.io/pause-amd64 3.1 da86e6ba6ca1 9 months ago 742kB
k8s.gcr.io/echoserver 1.4 a90209bb39e3 2 years ago 140MB
$
It didn't ask me any credentials. So should I say that "Minikube uses boot2docker as its base image, so the default SSH login to the VM ends up being docker:tcuser"
UPDATE 2
As per @Rico: "basically when you do minikube ssh it connects to the VM using private/public key authentication" - I agree. It didn't ask me any credentials when I did "minikube ssh" command from my host machine.
also as per point 1: "with command 'minikube start' it starts the VM that has all the kubernetes components in it" - So for this I went ahead and tried to run any kubectl command after ssh ing into minikube and its saying command not found.
$ kubectle get pods
-bash: kubectle: command not found
However it does recognize docker command
$ docker --version
Docker version 17.12.1-ce, build 7390fc6
I also tried to find VM details
$ uname -a
Linux minikube 4.15.0 #1 SMP Thu Sep 27 17:28:06 UTC 2018 x86_64 GNU/Linux
The short answer, minkube downloads a VM image to your host machine, in this case, Mint Linux for you then it starts the VM that has all the kubernetes components in it.
Credentials can be from any user in the VM OS. To connect to the minikube VM you can run minikube ssh
from your host. From there you can run something like sudo adduser
to add any user you like and set the credentials that you'd like too.
Note: when you run minikube ssh
you connect to the VM using ssh and it uses private/public key ssh authentication.
Thanks Shivraj and Rico for the posting questions and replies. They were badly needed.
To your problem Shivraj, please fire the kubectl commands on host machine.
I have also done a similar setup on my laptop with minikube creating a Linux VM for me. Docker images are running within the VM and kubectl is on the host machine.
I am following the link below; issuing kubectl commands on my host and is working perfectly fine.
Hope it helps.
As a based image Minikube uses boot2docker, and default login details are docker:tcuser
, you can also login using minikube ssh
and tokens created by Minikube will be used to login without prompting for your login details. You should first remove the old cluster minikube delete
and create a new one minikube start
.
You do not need to have VirtualBox installed as Minikube will stat it's own VM. Of course, you can specify which VM driver should be used, using minikube start --vm-driver=virtualbox
.
Please read the instructions provided on kubernetes.io regarding Minikube installation.