So what do we need to install
to get started with Kubernetes locally
on our local machine for playing around with it?
Well, we need to install
what we need to install no matter where we wanna use it
no matter if it's our local machine
or some machine in the cloud
or in our own data center.
We definitely will need a cluster.
A cluster with our master node
in reality that master node might
actually also be distributed across multiple machines
to ensure it's always up and running
because if it fails
your entire cluster will have a problem
but to keep it simple we need one virtual instance
one machine running in a cluster
which has that master node set up
and we need one or more worker nodes.
And we don't just need these machines
which then are empty
but we also need to have all these software
and all these services, which they need
to be installed on them.
So on the master node,
the API server and schedulers should be installed
and a couple of other things
and on the worker node Docker should be installed
the kubelets should be installed
so there is communication device
for talking to the master node and so on
all of that needs to be installed.
So that is something which we need to create
and then we need another tool locally on our machine
and that's the kubectl or kube-control tool.
The kubectl tool is actually a tool
which you then use
to send instructions to the cluster
for example, to create a new deployment,
delete a deployment or change our running deployment.
With the kubectl tool
you as the developer and administrator
are able to send instructions
to the master node in the end which then will do
whatever it needs to do with the worker nodes.
For example, if you sent the instruction
to create more Pods of a given container
so more instances of a given container
the master node will then interact with the worker nodes
such that these extra Pods are created.
So this is how you actually set or change the configuration
which then should be maintained by Kubernetes.
So the cluster is the technical infrastructure
the kubectl tool is your communication device
for talking with that infrastructure
and for talking with this Kubernetes set up.
Don't confuse the kubectl tool with the API server
or with the master node.
The master node is really the thing in your cluster
which then basically applies your commands
and ensures that your commands are executed correctly.
The kubectl tool is really just a thing
with which you give the commands.
You could compare this, even though I will admit
that it's kind of a strange example
but you could compare this with
let's say the president of the United States
who is the Commander-in-Chief
and who could give the command
that whatever country you should be attacked
and yes, I know it's a stupid example
but let's say that is what the president does
then you would have generals in the army
with soldiers below them
who execute that command
and it would be the duty of the generals
to ensure that the command of the president
is executed correctly.
So kubectl would be the president
the master node would be the general
and the worker nodes would be the soldiers.
And please excuse the strange analogy
but I hope it's now clear how these things work together
and therefore that is what we need to set up.
And if we would set this up in a cloud
or in our own data center
then the cluster would be what happens in the cloud
or in the data center and kubectl is a tool
which we install locally on our machine.
Now for testing and for playing around with that
we will set up everything on our local machine
so not just kubectl
but also a demo, a dummy cluster.
And for setting up this dummy cluster locally
we can use a tool called minikube
and attached you find a link with setup instructions
though we will set it up together
over this in the next lectures.
Minikube is in the end a tool
which you can install locally
for playing around with Kubernetes and for testing it
and it will use a virtual machine on your laptop
on your machine, on your local machine
to create the cluster in there.
So it simulates another machine on your machine
by using such a virtual machine
and the this virtual machine then holds this cluster.
It will actually create a single node cluster
which means there the worker and master node
is combined into one single virtual machine
not something you would do in production
but something we can absolutely do during development
to keep things easy and resource friendly.
Now, minikube is a great tool
for getting started with Kubernetes
and for testing things locally
and the great thing is that you can install it
on Linux, macOS and Windows.
And again, you attached find a link
with setup instructions for all three systems
though I will walk through macOS and Windows
together with you.
It's also worth mentioning that minikube
will not replace the kubectl command or tool
which you also need to install.
You always need to kubectl command locally
even if you don't use minikube because that is the tool
you use for communicating with your cluster
no matter if it's a minikube cluster locally
or your cloud cluster running on AWS.
And therefore we'll actually install two things
we'll install kubectl,
and then we'll install minikube
and we'll start with that in the next lecture on macOS
and in the lecture thereafter on Windows.