In this lecture, we'll install Minikube
and the Kube control tool on Windows.
Of course you can skip this lecture
if you have no Windows device.
Now to install Minikube, which is this tool
which creates this local playground cluster,
you could say, on our system,
we can follow the official installation instructions
to which you also find a link attached to this lecture.
Now on these instructions,
we first of all, want to verify
whether we have the right setup.
So for that, we can copy this command here
and execute that in the command prompt.
This will take a short while,
and if you see output like this,
a hypervisor has been detected,
then you already got everything set up what you need.
If you instead see something like this,
it means that your system supports virtualization,
which is what we need here,
but that a hypervisor hasn't been set up yet.
In that case, you need to install a hypervisor first.
I will install one
even though I already have the requirement met
because I wanna use the VirtualBox as a hypervisor
instead of the built-in one my Windows version ships with,
because I also used the VirtualBox in the last lecture
and VirtualBox will basically work on any system,
including Windows 10 Home,
which doesn't have a built-in hypervisor otherwise.
So that's why I will use VirtualBox,
even though technically I wouldn't need to install it.
If your system doesn't meet the requirements here,
you unfortunately can't install Minikube
and there isn't too much you can do about that.
So, now what we checked this,
on the Windows tab here,
we now first of all wanna installed a Kube control tool.
And we actually need that tool always,
even if we don't install Minikube locally,
because it's the Kube control tool
which helps us communicate with the cluster
and which allows us to send instructions to the cluster,
just as explained in the last lectures.
So therefore, we should start
by installing the Kube control tool.
And to install this on Windows,
we again can follow the instructions
we find on the official installation page.
Now there are different ways of setting it up locally.
And I personally prefer using Chocolatey.
So you can visit this package manager page.
It's a package manager for Windows,
which makes installing third party tools very easy.
And it's free to use,
so we can just install this Chocolatey tool.
You don't need to subscribe to the newsletter for this,
and then basically execute this command here in PowerShell,
run this command there and hit Enter.
And this will now install this Chocolatey tool
locally on your system,
which can again, take a short while.
And once this has been installed,
you're already done with this step.
You can go back and install the Kube control tool
by running choco install kubernetes-cli
and you can run this command
in the regular command prompt now.
And then simply copy in the command here.
And this now installs to Kube control tool
with help of that Chocolatey package manager tool.
Make sure to type yes here for running this setup script.
And this now should successfully install Kube control.
To verify whether it worked,
you can now copy this command and execute that.
And if everything worked,
you should see some output like this.
The exact details of course might differ,
but you shouldn't get an error.
And that proves that it works.
Now that is the Kube control tool installed on your machine,
which we will always need,
even if we're not using Minikube.
Because we only use Minikube
to have this local development cluster,
Kube control is then just our communication device
for talking to that cluster.
Now next, let's make sure
we also follow these other steps here.
In the command prompt, type cd $USERPROFILE$
here in the command prompt to go to your user folder.
Run mkdir for make directory .kube
to create a new folder named .kube in there.
And then go to this .kube folder in the windows Explorer
and create a new text document there
without a file extension, just config.
You can still edit this with any text editor,
though at the moment, we don't need to do anything there.
Now we got Kube control installed,
now let's install Minikube.
Actually, I got the steps here.
We first of all need a hypervisor
and I will use a VirtualBox as explained before,
since this is available on Windows 10 Home, on macOS
and I wanna use one at the same virtualization tool.
So one at the same tool creating that virtual machine,
which holds the cluster on all different systems.
On the VirtualBox homepage,
simply click on Windows hosts here
to download the VirtualBox installer,
which again can take a couple of seconds.
And once that installer was downloaded,
simply walk through it to set up VirtualBox
on your Windows system.
So here I will go through it.
You can keep all the defaults here,
though of course, you can also switch the place
where this is installed.
And I will actually do this,
click Next,
choose whatever you wanna choose here,
and click Yes and install.
Now this will install VirtualBox on your system.
And once it's finished, we don't need to start this,
we just need it to be installed
because Minikube will use this.
Now we can install Minikube.
And for this, I will again use this Chocolatey tool,
which I used before.
And then running choco install minikube,
which now installs this Minikube tool.
Again, this can take a couple of minutes
or seconds to complete.
And once this is completed,
close your command prompt, and restart it.
Now you don't have to start it as administrator,
and confirm your successful installation
by starting a new cluster
and therefore in the case of Minikube,
also a new virtual machine
by running minikube start --driver,
and then the driver of your choice.
I'll come back to that in a second.
So Minikube start --driver is the command,
and now the value for driver
should be your virtualization driver,
which you wanna use.
So in my case, I installed VirtualBox,
so I should use this as a driver.
You can check the full list of drivers you could be using
depending on your setup.
If you use VirtualBox,
you should use virtualbox as a name here,
all lowercase though.
So plug in virtualbox here and hit Enter.
And this now creates a new virtual machine
with help of VirtualBox,
which will hold your development cluster.
And it will set up the master node
and the worker node in there,
actually it just sets up one node
where worker and master node share the resources
because for development, that's no problem.
And it will also install all the software Kubernetes needs,
the API server, the kubelet.
It will install all of that and set everything up for you
inside of this encapsulated virtual machine.
Now, again, this can take a short while,
so let's wait for that to finish.
And once this is finished, we can test whether that worked.
Now you will see for me it failed
because I am using the Hyper-V hypervisor
and this kind of conflicts with VirtualBox,
and therefore, I either should disable that hypervisor
or use the driver Hyper-V instead of VirtualBox.
Now I will do that,
but you can absolutely use VirtualBox
if you don't have this built-in hypervisor,
for example, on Windows 10 Home.
So I will run Minikube start again,
now with --driver hyperv,
and this will now use to built in hypervisor,
which of course means
that installing VirtualBox was unnecessary.
Now we, first of all,
need to delete the other virtual machine,
which was created first,
and then we can run Minikube start driver hyperv.
And now this will set up a new virtual machine
now not based on VirtualBox, but the built-in hypervisor,
which is built-in virtualization support
some Windows versions have.
And you'll see it now also failed
but simply because this now needs to be executed
as administrator,
and then run Minikube start --driver hyperv again.
And now this should succeed
and it should set up this virtual machine
on my local system as well using that built-in hypervisor.
So let's wait for that to finish.
Of course, if VirtualBox work for you,
you don't need to switch.
I just wanna show all possible scenarios
I'm facing at least
so that hopefully there is at least one scenario,
which also works for you.
And therefore by the end of that,
once that finished,
we should have our running demo cluster
in that virtual machine on our local host.
So let's wait for that installation and set up to finish.
And with that finished,
we are now ready to get started
with Minikube and Kube control on our system.
We can verify that everything worked
by running Minikube status now,
and there we should see a bunch of running,
which I do, which is great.
And you can also get a visual dashboard,
which allows you to look into your cluster
by running Minikube dashboard.
This starts a process which will stay up and running,
and which also opens up a browser tab
with a web application, not created by us or by me,
but instead built into Minikube,
which allows you to look into your cluster.
For example, here, you can see any running pods
of which we have none at the moment
because we haven't used Kubernetes right now
to create a deployment and create any pods.
But this can be useful later to look into the cluster
and see which resources were created by Kubernetes.
For the moment, I'll close this
and stop this process by hitting Ctrl + C twice.
Now that's Minikube and the Kube control tool setup.
And with that, we're ready to proceed
and to finally start working with Kubernetes for the moment
with this local development and dummy cluster.