‫Kubernetes is a lot of things.
‫I want to definitely break down some of the
‫basic topology and parts of
‫the system before we get into installing an app
‫on Kubernetes. First up is Kubernetes itself.
‫That is essentially what I'm talking about.
‫The entire system.
‫Either a single server or multi server setup with all
‫the parts together that are there to run your apps.
‫We abbreviate that sometimes as K8s.
‫Normally when I'm talking about Kubernetes, I will just say
‫Kubernetes, but often in writing, or even in the
‫documentation, you'll see the K8s,
‫and that essentially is a short, abbreviated version of
‫Kubernetes. If you actually look at it, the 8 means
‫the 8 letters between the K and the S.
‫That's why they did it. The K, eight letters, and then S.
‫That's their abbreviation.
‫Sometimes people might call it Kube.
‫But, essentially here we're going to be talking about the
‫same thing when we say Kubernetes and K8s.
‫Now kubectl is the command line tool that you will use
‫to talk to the Kubernetes API.
‫The main way we talk to Kubernetes is through its API.
‫There's multiple tools out there that can do it.
‫In fact, there's lots of tools they can talk to the API.
‫The one that really comes officially from the project and
‫that we'll be using most of the time is kubectl.
‫Now you may see this being referred to in other
‫videos, or talks, as cube cuddle, or
‫kube cuddle, or kube control, all sorts of other
‫types or maybe even kubectl, but
‫those all are the same thing.
‫They're essentially different people saying it a different
‫way. In fact, just about a year ago or so
‫they decided to officially call this tool
‫kubectl in the documentation.
‫But, there really is no wrong way to say it.
‫Just like with Swarm, where we call nodes
‫the servers that are inside of that cluster, Kubernetes
‫also refers to things as nodes as well.
‫So, that terminology is at least the same between the two.
‫Kubelet is the container that will run a
‫small, little agent on each node to allow
‫that node to talk back to the Kubernetes master.
‫Remember, since Docker had Swarm built in,
‫it didn't really need the separate agent.
‫That was all built into the Docker Engine.
‫Now with Kubernetes running on top of that, it needs
‫its own engine API that talks to the local Docker,
‫or the local runtime, whichever that may be.
‫Then it talks back up to the control plane,
‫or master, which is in charge of running the Kubernetes
‫cluster.
‫The control plane, sometimes called the master,
‫is what's in charge of the cluster.
‫If you're familiar with Swarm.
‫In Swarm, we had the manager.
‫There could be one or more managers.
‫We wanted an odd number of managers.
‫Then there was workers that were doing all the work.
‫If you remember from Swarm, the managers could also
‫be workers because they could also run containers
‫themselves. So you could technically just have a single
‫server. You could have many servers and have the two roles
‫split out. A lot of that is very similar in Kubernetes.
‫We just have slightly different names for it.
‫The control plane, also something we ran
‫in Swarm, is the part where
‫the servers are running all of the stuff that's
‫in charge essentially.
‫It's more than one container. It's a group of containers.
‫They run individual things.
‫They take the Linux principle of do one
‫thing and do it well, and they take that and split
‫everything up. So, essentially each one of these parts is
‫doing one thing and doing it well, and it simplifies
‫the design in terms of the development.
‫But when you have to build this and run it,
‫it does make things a little harder to set up because
‫there's more to it. This control plane includes
‫containers that will be running the API, the scheduler,
‫you actually need a database backend that will be something
‫called etcd.
‫Then you have controller manager.
‫You'll probably need something called coreDNS to handle
‫your DNS, and so on.
‫We have a lot of parts here, but let's put it
‫on a diagram and see if this helps makes sense.
‫I'll compare it to Swarm since you've already learned that
‫in this course.
‫If you only had one machine, like we're going to do in a
‫minute for learning, all of the things I referred to
‫previously would all be in the same server.
‫There would be a bunch of running containers. That's what
‫you'll see on things like minikube and Docker Desktop
‫when you're running a single node Kubernetes.
‫In the real world when you get on servers,
‫you're going to break this stuff out. I thought I would
‫show you really quick, on a network diagram, how this might
‫look and explain the different parts.
‫First, let's assume you have a master.
‫In a multi master setup, you would have three
‫of those. Just like with Swarm, you need odd numbers
‫because it uses the same RAFT protocol to keep consensus
‫just like Swarm did.
‫In the documentation, these are all known as master.
‫But, it gets a little confusing when you have more than one
‫master because it's the same setup where you can only have
‫one that's really doing the job of writing the etcd.
‫These are also known as the control plane.
‫You'll recognize that term from Swarm,
‫which was referring specifically in Swarm to the
‫protocols over the network that were allowing
‫the masters and the nodes to all talk securely for giving
‫orders. But here, it's a little bit different.
‫The control plane is talking about the master nodes
‫that are all making decisions.
‫Just like with Swarm, we have worker nodes.
‫In the documentation, they'll really just be referred to as
‫nodes. Sometimes, you see the word worker mentioned.
‫We're going to call those nodes here just to be consistent.
‫Again, like before, all of these can run containers,
‫but generally you're going to keep your apps to the nodes
‫and the Kubernetes management systems to
‫the masters.
‫All of these are running on top of Docker or
‫some other container runtime like containerd
‫or crio.
‫Inside of each master, we're going to need to run
‫multiple containers to keep control
‫of the system. The first of that is etcd.
‫Etcd is a distributed storage system
‫for key values.
‫It's very similar to how Swarm works with its
‫RAFT algorithm system.
‫It's similar to etcd, but etcd is a separate product
‫and is something you can install without Kubernetes just to
‫store configuration data.
‫It uses the same RAFT protocol, so a lot of the same rules
‫apply. You need odd numbers.
‫You can start with one, but if you want true fault
‫tolerance, you need three.
‫And so on. On top of that, you'll need to run multiple
‫Kubernetes containers that will store data
‫inside etcd and manage the cluster.
‫First up is the API, which will be the way we
‫talk to this cluster and issue orders to it.
‫Next up is the scheduler container, which will control
‫how and where your containers are placed on the nodes
‫in objects called pods.
‫Next up is the controller manager, which looks at the state
‫of the whole cluster, and everything that's running in it,
‫and it uses the API to do that.
‫It takes the orders that are giving it, or the specs,
‫and determines the difference between what you're asking it
‫to do and what's actually going on.
‫It's basically a loop that's seeing
‫the whole system and figuring out how to make everything
‫that's currently happening the same as what you've asked it
‫to do. Then you'll need something to control DNS,
‫which isn't built in, and by default, that's coreDNS.
‫Depending on other add-ons that you
‫get later, like networking or storage,
‫web and other features, you'll have more containers
‫running here as well.
‫On all the nodes, they're going to need an agent running.
‫That's known as kubelet.
‫To start with, you'll need kube-proxy to control
‫the networking.
‫Just like with Docker, all of these will be repeated for
‫their role. The masters, if you were going to do multi
‫master, would have all those same containers set up.
‫Each node that you set for worker nodes will
‫also have those at least two containers there for
‫management. Kubernetes is designed to solve lots of
‫problems in lots of ways.
‫You'll find yourself possibly adding more things
‫to masters, more things to nodes, such as networking.
‫On the master side, there's lots of other optional tools
‫to add onto it as well.
‫Let's get to installing this on your local system for
‫learning.