Join this live session with Rodrigo Díaz Concha - 1st episode starting on December 21, every Wednesday at 07:30 AM Pacific Time (US).
After attending this session, you will be able to describe what Kubernetes is, and you will set up your own Kubernetes cluster by using Minikube.
ABOUT SPEAKER
Rodrigo Díaz Concha is a Solutions Architect, Microsoft Regional Director, and Microsoft MVP with more than 22 years of experience. In addition, he is a book author, speaker, and course author for LinkedIn Learning.
Rodrigo has dozens of professional certifications from different companies such as Carnegie Mellon SEI Software Architecture Professional, Microsoft Certified: Azure Solutions Architect Expert, Microsoft Certified: DevOps Engineer Expert, and HashiCorp certifications.
He also has the distinction of having written the first books on Silverlight 5 and Xamarin.Forms in the Spanish language.
C# Corner - Community of Software and Data Developers
https://www.c-sharpcorner.com
#CSharpCorner #CSharpTV #Kubernetes
Show More Show Less View Video Transcript
0:30
Hello, hello everyone and welcome to this series about Kubernetes only in C-sharp corner
0:43
This is going to be a live series about Kubernetes. At the end of the series, you will be able to understand Kubernetes as a platform for
0:51
building robust and wonderful distributed applications. So this is the first session
0:58
Today, we're going to see some things related about the development environment and what do you need to install in your machine to use Kubernetes
1:11
So, allow me to present myself. I'm Rodrigo. I'm a partnering consultant at Soliance
1:18
I've been awarded as Microsoft MVP since 14 years ago, and I'm also a Microsoft Regional Director
1:29
I'm also a LinkedIn Learning author. You can find my courses there in that platform
1:35
And I also wrote the first two books about Silverlight and Summer in Forms in Spanish language
1:42
and I'm also an international speaker. You can connect with me in social media, such as Twitter or LinkedIn, or I think those two are the most common ones, right
1:57
So you can connect with me and, okay, let's get started. Kubernetes
2:04
The thing about Kubernetes is that I believe it's not a topic that is easy to grasp, to be honest with you
2:14
because most of the time today, it's very easy to hear people and companies
2:23
that want to go to the cloud, right? They want to, I don't know
2:27
maybe they want to take their current workloads running on premises and they want to run somehow in the cloud
2:35
And somebody said to them, hey, you know what? You can use containers
2:39
and you can use Kubernetes as a container orchestrator and everything is going to be fine
2:45
But actually, I don't think that's true. I think Kubernetes is a fantastic technology
2:52
However, it's not an easy one. That's why we're creating this live series here in C Sharp Corner
2:59
Allow me to show you one thing about the Cloud Native Computing Foundation
3:08
which is the foundation part of the Linux foundation. I believe Cloud Native Computing Foundation is underneath the Linux foundation somehow
3:23
In here, the Cloud Native Computing Foundation, which is this organization that creates and manages a lot of open source projects
3:35
for cloud native applications they created this cloud native trail map which is this nice diagram
3:44
or poster that we can see here on the screen and the cloud native computing foundation wanted to
3:51
show us a path right how we can create cloud native applications what would it be
4:00
those challenges that we're going to face if you want to create those kind of solutions, right
4:07
So the first one, as you can see here, is containerization. Containerization means that we can run and we can deploy our applications by using containers
4:19
maybe Docker containers, which is the most popular technology. However, there are other container technologies, and I'm going to talk about
4:28
actually in this session later on. However, containerization itself is interesting because it allows you to deploy your applications
4:38
and port your applications quite easily between environments. You can be running those containers
4:47
in your on-premises environment, for example, right? And then you can bring those same containers to the cloud
4:56
maybe Microsoft Azure, maybe AWS, maybe Google Cloud Platform, what have you
5:04
Okay. So we're going to talk about containers. However, Kubernetes is not about, and it doesn't know anything about containers
5:16
That's fascinating. I'm going to show you that and I'm going to describe why. Okay
5:20
Number two, as you can see here in the screen, the second step in this trail map is implementing continuous integration and continuous deployment pipelines with, I don't know, maybe tools such as GitHub Actions or Azure DevOps or Jenkins, right
5:42
there are so many platforms and tools that we can use to implement those CICD pipelines
5:51
However, those are quite needed because, of course, you can containerize your applications
5:57
However, you're not going to do that manually. You need some kind of automatic process to do that, okay
6:05
That's why it's number two. and hey you need to run your containers somewhere right of course you can install docker on your
6:15
machine right as a developer or maybe you are trying to understand what containers are all about
6:23
however in production in real life you need to have a real container runtime you need to have this
6:33
real and robust platform for running containers. And this is the place where Kubernetes
6:41
comes into the picture, as you can see here on the screen
6:46
So, and there's other steps. There are other things that we can talk about this trail map
6:55
However, it's quite easy to see that orchestration and containers are one of the or two of the most uh uh important topics about cloud native applications and
7:09
solutions okay it's in number three three from ten okay so what is container orchestration
7:21
i know that i can containerize my applications i i know how to create a docker file maybe you using Visual Studio and you just right click on the project and select the add docker support and visual studio is gonna add that docker file
7:39
it's gonna inspect your project for creating that docker file or maybe you're using i don't know
7:45
python or you're using go or any other programming language actually right and you can containerize
7:54
that you can containerize your web service or a web application however as I said you need somewhere
8:01
you need out you need a place to run your containers you need a container runtime okay
8:08
so let's define container orchestration it's good and it's very easy to manage a couple of containers
8:16
right I can create a web API in this session and containerize it and run it and it's everyone is
8:23
is gonna say, okay, that's cool, that's easy. However, what happens if you have hundreds of containers
8:33
or thousands of containers? Of course, things start to get messy because it's not that you're going to run
8:44
those containers manually. So container orchestration is a process of automatically deploying and managing containers
8:55
So with this, there are some orchestrators that we can use. Kubernetes is not the only one
9:03
However, Kubernetes won't be container orchestrators war. Back in the day, I mean, maybe eight years ago
9:14
seven years ago, maybe eight years ago, There were so many options regarding container orchestrators
9:22
and actually we have those options today as well. I started using containers and container orchestrators back in the day
9:33
when Microsoft released Azure Service Fabric, okay? Service Fabric as a container orchestrator
9:42
And Docker as a company, they released Docker Swarm, right? and other companies and other people released other orchestrators
9:54
What in the world is a container orchestrator? An orchestrator can schedule containers to run on hosts in the cluster based on resources availability
10:08
So we're talking here about a cluster. A cluster, as you should know, is a group of virtual machines or maybe a group of physical servers, right
10:21
And they're connected to each other. They can see each other, right
10:25
So you install this kind of solutions, I mean, an orchestrator, right
10:31
And the container orchestrator is going to decide where to schedule that particular container
10:38
If maybe it's going to schedule that container on server A or maybe server B, okay
10:48
And also, most of them can enable containers to communicate with each other regardless of the host they are deployed to, okay
10:57
So, yeah, you deploy your containers, right? And somehow, generally speaking, you need containers to communicate to each other
11:06
And I'm talking here about maybe a microservices-based architecture, right? And of course, you can use containers for creating that
11:18
It's not a requirement. Those two are different things, okay? And actually, I'm not going to talk about the microservices architectural style in the sessions, okay
11:28
However, you should know that distributed applications such as microservices, they expect this
11:38
They expect services and containers to communicate with each other to maybe run a particular process or task
11:47
And most of them can manage and optimize resources usage. Of course, you have those machines in your cluster
11:56
Maybe those are super powerful virtual machines. And an orchestrator is able to detect if a particular machine is under loading
12:10
you know, it's not being used at all, or maybe it's being used quite poorly
12:16
And the orchestrator is going to be sure that that particular machine gets more load
12:23
more load more more computing processes to execute okay container orchestrators kubernetes won the
12:34
orchestrator war okay however there are other container orchestrators that are valid options
12:42
nowadays okay such as service fabric the one that i told you about this is an open source project
12:49
from Microsoft for creating distributed applications and containers is just one option
12:58
with with service fabric you can use the reliable services SDK for creating those micro services
13:06
and distributed applications based on that okay and of course I'm going to talk about service
13:12
fabric is not the main topic about this in this session. Dockerswarp, as I mentioned
13:19
it was created by docker and we have Apache, Mesos, and HashiCorp, the same company that creates
13:28
Vault and Terraform. They created Nomad, which I believe is based on somehow Kubernetes
13:37
but it's quite different. I'm not really sure about Nomad. However, that's another option that
13:44
we have today, right? The thing is you as a professional architect or developer or IT pro
13:55
are you willing to use a technology that is not being used at all in the market
14:02
I don't know maybe us as technologists we're we want to go where the you know where the market is
14:11
right so kubernetes I believe that's the that's the that's the option for creating this
14:19
distributed applications based on containers there's actually this nice and very interesting
14:26
documentary in YouTube that you can watch about the Kubernetes history. I believe it's in YouTube
14:32
and LinkedIn, LinkedIn Learning as well. And in that documentary, you can see and you can hear
14:41
from the people involved in the project, what were the challenges that they faced when creating
14:48
Kubernetes which was created by Google I have to mention that Actually I going to mention that and some other details later today so kubernetes is the most popular container orchestrator hands down okay uh i don think there anybody that can um defy that um
15:14
that fact it's a fact that's the most popular container orchestrator okay it was built by
15:21
Google, the company, right? However, Google created Kubernetes as a way of creating
15:31
this new and modern and robust container platform. However, they have back in the day a lot of experience
15:43
running containers in production for the Google search engine and all of the applications and solutions that Google offers
15:54
And they created Kubernetes as this platform, right? Taking into account those previous experiences
16:03
that they had in the past. So yeah, it was built by Google
16:09
However, today Kubernetes is part of the Cloud Native Computing Foundation. It's an open source project
16:18
and everyone can participate in that project and everyone can use Kubernetes for its own purposes, okay
16:29
Kubernetes was written in Go, which is interesting. If you're a Go developer, you should know that Go
16:37
and also I think Docker was created by using Go, right? right? Me, I'm a C-sharp and .NET developer since 21 years ago so I know a little bit of Go
16:55
however I don't consider myself an expert in Go, but I believe it's interesting. If I wanted to
17:03
to learn another programming language, maybe Go would be my first choice
17:11
And Kubernetes has this Apache 2.0 license, which allows you to use Kubernetes
17:18
in your own software solutions, commercial solutions, and non-commercial solutions. It's an open source project, as I mentioned
17:30
and it runs on all cloud providers, okay? So, all cloud providers, I mean the most popular ones, they have this managed Kubernetes service that they offer
17:44
For example, in Azure, we can find the Azure Kubernetes service, which is a managed Kubernetes service, a platform as a service option of Kubernetes
17:57
This means that you don't have to install Kubernetes and other things
18:05
And I'm going to mention that in managed Kubernetes later on, maybe in the following session
18:13
And there's a huge ecosystem about Kubernetes. You can find a lot of plugins, applications, dashboards
18:20
there's a lot of documentation, videos, training courses, blah, blah, blah about Kubernetes
18:28
Okay. It's a huge ecosystem. Okay. So let me answer some of the questions that I have here
18:40
Are this meeting being recorded? So Simon said, no. Okay. Please feel free to post your thoughts, questions here
18:52
Okay, cool. What can Kubernetes do? So, it's fascinating to know all the different functionalities and features that Kubernetes has
19:04
The first one that I want to mention here is the service discovery feature or functionality
19:11
This means that Kubernetes is able to detect where in the world is this other service that you want to communicate to
19:21
Maybe you're executing this service, service A, and service A can know where in the world, I mean, where in the cluster, right, is service B or service C
19:34
It can load balance our requests. It's not a full-featured load balancer
19:43
Kubernetes is not about that. It's not about load balancing our requests
19:47
and computing processes. However, Kubernetes can do that. And I'm going to show you that by using code, okay
19:59
Maybe in the following session. With Kubernetes, we can create automated rollouts
20:06
or rollbacks this is interesting because back in the day when i was using service fabric
20:11
a deployment of an application in service fabric is uh is not an easy task because there are a lot
20:18
of things there are a lot of moving parts and with kubernetes is quite easy okay just just define
20:26
the new deployment that you want to deploy and then kubernetes is gonna roll out that for you
20:33
and you can roll back to a previous version if you need to one of the most important things
20:38
about kubernetes is that it's a self-healing platform it means that maybe you're running
20:45
your container you're joining you're running this nice application this nice microservice or web api
20:52
and what happens if that particular container dies right what happens if that container
21:00
throws an exception and it's in this faulty state in that case kubernetes is able to fire up another
21:10
container okay and redirect all the requests to that particular newly created container
21:19
and actually i'm going to show you that in the following sessions as well
21:23
there's a secret and configuration management it's a quite primitive one I it's not a because
21:31
Kubernetes is not about storing secrets and configurations however we have this nice storage
21:37
about that and I'm going to mention that and we're going to use the secret store in the
21:45
configuration store now actually the technical name is config map in one of the sessions however
21:52
in real world applications maybe you want to use something like Terraform bold I'm sorry
21:58
HashiCorp bold Terraform is another product from HashiCorp or Azure key bold or those kind of things
22:05
okay and with kubernetes you can execute processes as a batch execution and there's a dynamic scaling
22:16
notion in the platform as well. You can scale up and down your containers
22:22
and your applications based on some rules maybe So yeah we going to show that uh in the following sessions in this series cool so it nice to know and i think it quite uh important to know
22:41
what kubernetes can do right however i believe it's more important to know what can it do okay
22:50
it's fascinating and it's crucial to understand that kubernetes is not able to handle directly
23:02
or run containers right because kubernetes uses this container runtime that most of the time
23:12
could be docker or it could be container d there are others okay however kubernetes it doesn't know
23:23
anything about running containers okay you should know that it uses the container runtime that is
23:30
installed in the cluster for doing that kubernetes itself is not able to do that it doesn't understand
23:37
and containers. It can also build app or deploy source code. I mean, cannot, right
23:47
With Kubernetes, you don't build your app or deploy your source code
23:51
Of course, that's why we have, I don't know, maybe GitHub or Azure repos
23:58
or maybe, I don't know, any other platform. Actually, Kubernetes is agnostic about that, okay
24:07
And Kubernetes, it doesn't provide app level services such as databases, message buses, message brokers
24:17
catch and those kinds of platforms and components that most of the time we need in distributed applications
24:25
Kubernetes is not about that. It's about the scheduling compute processes, right
24:33
In a machine, in a cluster, that's Kubernetes. that's the that's the gist of kubernetes okay and of course in a real world application maybe
24:45
you want to use a database maybe you want to use a message broker maybe you need to use some kind
24:51
of storage or i don't know you can do that but actually that's outside the kubernetes topic okay
25:00
cool So here in the screen, you can see the Kubernetes components
25:08
This is quite, it's indispensable to understand this. It's paramount to describe and identify all the different components that Kubernetes has
25:22
because it's nice to know that with Kubernetes, we can schedule some processes to some machines, right
25:32
But how, how Kubernetes works? We're going to describe that in the following slides
25:39
So as you can see here, we have a cluster. I mentioned that before
25:44
You need a cluster. Kubernetes is about using a cluster. Of course, in a development phase
25:51
you can have a Kubernetes cluster or virtual cluster in your own machine and
25:57
I'm going to show you that by using MiniQube. However let's think that we have this
26:05
cluster right in this fictitious scenario okay. So there's one part in Kubernetes named the
26:15
control plane. There are actually nodes in the cluster. They could have two different roles
26:23
a master node or a control plane node, and the other ones, they are named worker node or maybe
26:33
minion nodes. Those are the nodes where your applications are running on. However, let's
26:40
focus on control plane. The control plane is the brain of Kubernetes
26:47
You need the control plane deployed somewhere. Even if you're using maybe one server in this cluster
26:56
with only one server, you need the control plane. That's the brain
27:02
That's the logic. That's the rules of Kubernetes. all the functionality and features of Kubernetes is right there okay and of
27:14
course in the worker nodes you deploy your applications so let's focus on
27:20
control plane the control plane has many components and modules and processes
27:27
that I'm going to describe that allows Kubernetes to work as a scheduler as an
27:34
or container orchestrator okay so let's uh i'm going to describe those components later on in
27:43
some slides uh that follow i'm not i don't want to use this particular slide for explaining the
27:48
control plane just remember that there are two different nodes in the cluster the master node
27:56
or control plane node and the minion or worker nodes, okay? That's important
28:04
What about local Kubernetes? I was mentioning Minikube as a way of running our cluster
28:13
locally in our machines. However, there are other options that we can use
28:21
For example, MicroKate's Docker desktop. It has the option of running Kubernetes actually
28:29
Let me show you that this is Docker desktop. Okay. If I go here and I click on the settings button
28:37
we can find the Kubernetes option and you can enable Kubernetes. So I could be able to run a Kubernetes cluster
28:48
right on top of Docker desktop. Okay. I'm not going to use that option in this series
28:55
I'm going to use Minikube. However, that's nice. That's nice. Okay. This is a nice option to have
29:03
And there are others such as Kind or Key3S. I don't know if that's the correct pronunciation of Key3S
29:16
Because K8S is pronounced as Kates. uh anyways so there are some other some options about running kubernetes locally okay and again
29:30
we're going to use minikube cool what about those managed kubernetes options that we have
29:38
on the cloud i mentioned azure kubernetes service that's the azure managed service that microsoft offers
29:48
And of course, the other clouds have their own Kubernetes option, such as Elastic Kubernetes Service
29:56
in AWS, Google Kubernetes Engine, in the Google Cloud Platform and of course some others such as the Oracle Cloud and Alibaba Cloud
30:07
they have their own Kubernetes managed option why because again managing the control plane and
30:15
managing that brain about Kubernetes it's not an easy task that's why we have those options and
30:24
they're great okay however I believe and I truly believe that in order to understand those managed
30:34
options say AKS I believe that you should know Kubernetes you should know the fundamentals of
30:42
how Kubernetes works right that's why we're creating this sessions here in C-sharp Corner
30:50
okay and what about an on-premises kubernetes option maybe you have your servers you have your
31:00
blades you have a lot of investments already in place in an on-premises data center well you can
31:09
install kubernetes in the bare metal right and there are so many different techniques for doing
31:16
that however you can use kube admin which is one of the most famous tools for installing kubernetes
31:25
and actually i believe that's uh that's great for understanding uh all the different pieces
31:31
and services because you need to install those and configure those manually right of course you need
31:39
to have the time for doing that but actually that's great that's the option that we most of
31:46
the time use in real world applications where we want to install kubernetes in the bare metal
31:54
okay so let's talk about the development tools that we're going to use in this course in this
32:01
sessions so the first one is a minikube i mentioned that before minikube is an open source
32:09
and cross-platform technology for running Kubernetes on Linux, Windows, and Mac OS
32:18
And actually you can install Minikube very easily if you use something like a Chocolaty
32:23
as an application management tool and actually that's the technique that I used some months ago
32:31
when I configured this particular machine that I'm right here right now okay
32:43
one thing about Minikube is that it's interesting because it uses a provider
32:49
model so it can use Hyper-V if you happen to have Windows and you have the
32:56
hyper-v option and of course maybe your computer supports hyper-v you can use that however you can
33:06
use other providers such as vmware and others i think parallels as well docker desktop is another
33:14
provider for minikube i mean you can use minikube on top of the docker desktop even though i'm sorry
33:23
docker desktop has its own kubernetes option so just uh identify that you can run minikube
33:32
in different ways okay i'm going to show you how to run minikube by using hyper-v
33:38
however you can use any other option that you like okay um minikube can use docker desktop
33:46
However, it doesn't require Docker desktop. That's fascinating. You don't need to have Docker installed on your machine
33:54
You don't need that. Of course, it's quite expected if you're going to test Kubernetes
34:01
and you're going to start creating this distributed applications based on containers
34:08
to have Docker desktop on your machine. Or maybe if you're, I'm sorry
34:14
Maybe if you're running Linux, maybe Ubuntu, or maybe Deviant, or I don't know Fedora, or those kind of distros
34:25
Of course, you don't need Docker Desktop in Linux, right? Because Docker itself is a native technology in Linux
34:35
So if we're going to use the Hyper-V option, it requires a type 2 hypervisor or container runtime
34:43
okay and it bootstraps the kubernetes control plane and installs docker that's actually why
34:52
minikube is a great uh tool for starting your uh your um your journey in kubernetes okay so i
35:04
I love MiniCube because of this. Cool. So let me show you this
35:12
Let's search for MiniCube. So MiniCube, MiniCube install. And here it is
35:26
MiniCube start. It's right here in the kates.io website. I strongly suggest you go to that particular page and take a look at the documentation, okay
35:41
Because I already done this. I already installed Minikube. I used the Chocolaty option, okay
35:49
Because I believe Chocolaty is one of the greatest pieces of technology that we have in Windows for managing and installing applications
35:58
This is a free tool that you can install and you're able to install anything in your Windows machine
36:08
This is actually what I use for installing everything when I'm working in this particular computer
36:17
So I used the Chocolaty option. I just run the Choco install Minikube command and that's it
36:27
However, maybe you don't have Chocolaty, maybe you don't have the permissions for doing that or using Chocolaty
36:36
There are other options here, as you can see here on the screen, such as downloading the installer
36:44
There are some steps that you can execute for downloading Minikube and installing Minikube
36:53
So, let me show you this. Okay so let me open up this Windows Terminal and I going to increase the phone size so you can see that yeah it real Minikube is right here at the time of this recording or I mean I sorry at the time of this
37:11
session the Minikube version is 1.28 okay I think that's the latest one so I'm going to use Hyper-V
37:22
Hyper-V as the backend technology for using Minikube so as you can see I have this virtual
37:29
machine okay that was deployed by Minikube maybe two weeks or three weeks ago where
37:38
where I was using this for testing some things related with the projects that I'm involved with
37:44
however let me delete that let me execute minikubedelete and you know what let me show you this
37:54
I want to show you side by side here what happens if I execute minikubedelete actually I need to
38:04
run this as an administrator okay I'm going to close this down and I'm going to execute again
38:11
the Windows terminal but this time as an administrator okay so mini cube delete
38:20
and this is going to I think there are some things that are trying to I have some locking in
38:27
my machine it says that the process cannot access the file because it's being used by another
38:32
process anyways I wanted to do that I just want to delete this virtual machine okay let's turn it
38:41
off and let's delete this delete okay and let me try again minikube delete of
38:48
course you don't need to do this when you start using minikube because you
38:52
don't have a virtual machine on your environment anyways let me do this okay
39:01
minikube start again you install minikube okay you install minikube and and then you run minikube start you have to define the back-end technology the back-end provider that
39:15
you want to use for running kubernetes in this case i'm going to use hyper-v okay remember that
39:22
you can use parallels vmware docker desktop and there are other options that's why i told you
39:29
to go to the documentation about minikube okay cool let me do this so I'm going to use the Hyper-V driver for starting Minikube okay this
39:45
is the place where you define okay I'm going to use VMware I want to use Docker desktop okay so
39:52
those are particular identifiers that you need to specify here in the driver argument anyways I'm
40:00
going to use Hyper-V and I'm going to accept all the defaults for doing this okay so as you can see
40:08
Minikube is going to download the Kubernetes binaries and then it's going to deploy a virtual
40:16
machine in my Hyper-V platform and it's going to install Kubernetes in that particular virtual
40:24
machine and it's going to install docker as the container runtime for this scenario and it's going
40:33
to configure everything for me so this is that's why minikub is great for learning kubernetes okay
40:42
so it's going to start creating the hyper vm with two cpus and six thousand megabytes of ram
40:51
and 20 megs, I'm sorry, 20,000 megs of space, of disk space
40:57
Of course, you can override those defaults, okay? You can specify that maybe you want different nodes
41:05
This is going to create just one node in the cluster. So this is a virtual cluster with just one node
41:13
And it's going to take 6 gigs of RAM and 20 gigs of space
41:18
and again you can override that so in the meantime let me go back here to PowerPoint
41:27
because what happens what happens with the control plane what happens with the nodes and
41:37
the worker nodes and all of that gas that I mentioned before well in this particular case
41:44
I have only one node in the cluster and because of that I will have the control plane
41:51
and the worker node in the same place okay the node is going to be hybrid somehow because I need
41:59
the control plane somewhere right and I need to deploy my applications somewhere as well
42:05
so that's why in this scenario that I'm showing you right now I have both control plane
42:13
and the worker node in the same place. But this is just for development purposes
42:19
and this is just for training purposes as well. It's not that you're going to use this same scenario
42:30
You're not going to use Minikube in a production environment. That's not what you use in real world applications
42:39
Okay, so let's go back here to the windows terminal and it's done as you can see i now have the virtual machine
42:51
this one named minikube and i can see the the status about my cluster and i can run some other
42:59
commands about my cluster and i'm going to show you that in the following sessions okay so um as
43:06
As you can see here, I executed Minikube status just to know if the cluster is ready for me to use
43:15
And it is, right? So it says the control plane, that's the role that is playing this node
43:23
Anyways, we're going to use that control plane for deploying our applications as well
43:29
And everything is running correctly, okay? So it's quite interesting to know that you can
43:36
connect to that particular virtual machine and let's login as root and we can do this
43:48
we can execute docker version in order to understand what is the version that
43:54
this particular virtual machine is running so in this case is running docker version 20 10 20 This is not the same as the docker desktop that i actually happen to have
44:10
in my machine okay i have docker desktop however as you can see this is another version those two
44:17
are different because this docker desktop i'm sorry this docker runtime is running inside the
44:23
virtual machine right so this is great let's see another things about this particular virtual
44:31
machine we can see that this is running the build root distro this is a compact
44:40
and a small distro that minikube decided to use okay however remember minikube is
44:48
um in kubernetes those two are open source and cross-platform technologies so i'm using build
44:56
root that was a decision decision made by minikube and it's great i mean it's not that you're going
45:02
to use this in a production environment right anyways let me um close this down okay and
45:11
this is the place where my cluster is going to run okay i just have one node in my cluster
45:18
however it's fine for training purposes cool so let's go back here to the presentation
45:26
and let's continue explaining some other tools that we're going to use in this series
45:34
kubectl is another command it comes from kubernetes itself actually this is the command
45:40
line interface that we use for managing our Kubernetes applications and clusters in the real
45:48
world. Okay? Of course, there are other tools and other ways of doing that. However, kubectl is, I mean
45:57
is the most important one and it's crucial to understand its functionality. Okay? Actually
46:03
if you happen to be interested in passing the certified kubernetes administrator or the certified
46:13
kubernetes application developer certification exams kubectl is going to be like 90 of the time
46:21
questions are related to kubectl okay so it's it's paramount friends okay it's paramount to understand
46:31
cube cuddle so yeah you install cube cuddle this is not from minikube actually minikube
46:38
doesn't i think yeah minikube installs a cube cuddle um so if you install minikube it's going
46:46
to install cube cuddle as well however you can install cube cuddle on its own okay you can use
46:52
chocolatey or you can use some other techniques and at the end of the day you'll have kubectl
47:01
okay this is the command line interface that we're going to use in this training series okay as you
47:07
can see i'm running this version actually there's a lot of json there anyways you can see that this
47:15
is running i have kubectl installed in this machine and kubectl is able to connect to
47:22
to different clusters. Okay. It's like a multi-tenant tool for managing different clusters
47:29
You can manage your own MiniQube cluster. And of course you can manage another cluster
47:35
that maybe is deployed in the cloud or whatnot. Okay. All configurations are stored
47:41
in this particular folder that we have here on the screen, which is your home folder
47:48
and then .cube slash config. So let's do that. Let's go back to the terminal
47:57
So home folder, okay, and then .cube, .cube, and then I have some things here
48:09
And this is the place. This is actually config is not a folder. It's a file
48:15
as you can see here we can see the different configurations that I have in
48:20
this particular kubectl installation okay and I have a lot of different
48:26
settings and I have a lot of items in this config file and that's because I've
48:32
been using kubectl since some years now and that's the place where all the
48:37
configurations are stored okay you can use kubectl to deploy your applications
48:42
we're going to see to see that in this series you can inspect and manage your cluster resources
48:49
you can view the container logs you can inspect your pods you can inspect your deployments and you
48:57
actually can do everything related to kubernetes that's why kubectl is crucial
49:04
to understand okay in order to manage Kubernetes so what happens when you have different configurations
49:14
what happens if you need to manage different clusters well actually you can create contexts
49:22
and you can change between contexts in order to send commands to different clusters okay
49:30
that's why we can use kubectl config get context and with kubectl config set context
49:36
and you pass the name of the context that you want to switch to so let's do that let me go back
49:43
to the root folder so we can have a lot of more space here in the windows terminal let's execute
49:50
kubectl config get context and as you can see here i have different context right
49:58
for different purposes and different demos and different projects that I'm involved with
50:04
Okay. So as you can see, Minikube is the default context. But what happens if I want to change the context
50:13
and maybe send commands to another one, such as Wisdom PetMed, WPM AKS
50:21
Actually, that's a cluster that I created, like, I don't know, maybe six months ago
50:26
this cluster doesn't exist anymore. However, the configuration is here. I need to delete some of these items in my configuration
50:39
Okay. I'm telling you this because the only context that is available for me right now
50:46
actually in real world is Minikube. Those other clusters that you're watching here
50:53
those are not available for me anymore. So yeah and most of the time we execute kubectl and then a command and then a subcommand and maybe you pass some parameters and you pass these other arguments and flags and so on and you have to type kubectl kubectl kubectl
51:15
kubectl right so there's a technique for not doing that I mean you don't have to type kubectl
51:22
all the time you can create an alias such as the one that we have here on the screen this
51:29
code is using I believe this is bash for creating an alias and then you just use k instead of kubectl
51:39
kubectl kubectl okay anyways I'm not going to use this technique in this training sessions because
51:46
again if you are interested in passing these aka or ckad exams those are the those are two of the
51:56
certifications that are related to kubernetes um yeah i'm going to use kubectl all the time okay
52:04
just remember that you can set an alias for executing your commands so yeah it's nice to
52:13
understand all the different commands and all the different options and actually i'm going to
52:18
go to that route in this series however it's nice to have completion in PowerShell if you happen to
52:28
use Windows just like I'm using Windows right now you can add completion to your PowerShell
52:37
commands this is kubectl for instance as you can see I already added completion
52:46
right i type c o n and then i press tab and i have this nice completion okay this is not by default
52:58
you have to uh modify your powershell configuration in your own profile to do this
53:05
and actually the command is this one okay you create the you obtain the completion script
53:12
that you need to add to your profile configuration. And then you use that script
53:19
to add it to your PowerShell configuration, okay? But actually, that's a PowerShell topic
53:28
I just want to show you this, kubectl completion PowerShell. And this is the script that you need to add
53:35
to your own profile, okay? As you can see, this is just PowerShell code
53:42
that we need to add. Anyways, I already done that before, so I don't need to do this
53:50
But yeah, it's nice to have completion in PowerShell. Cool. So, most of the time
54:00
kubectl has this expected syntax, which is kubectl, and then the primary command
54:11
and then maybe a sub command, or maybe you define the resource type
54:17
that you want to work with, and then you pass the resource name
54:21
and then some other parameters and arguments, okay? So we're going to see this
54:28
in practically all the following sessions in this series, because this is actually what you do
54:35
when using kubectl, okay? Here's an example, kubectl, okay? that's the command line interface and then the command is get this is get command is just as
54:48
you expect it's going to obtain some things it's gonna retrieve some information about the
54:55
particular resource type that you're setting in this other position such as pod okay kubectl get
55:03
pod kubectl get deployment kubectl get service kubectl get i don't know there are dozens of
55:10
of different objects in Kubernetes that we're going to see most of them in this series
55:16
And then you pass other flags and parameters such as the name of the pod or I don't know
55:22
it depends on the resource type of course, right? In this case, it's going to show us this command
55:31
all the different pods that have the name my pod, right? And it's going to use the output, which is this flag
55:40
this dash O flag is for output, and it's going to show us a lot of other columns
55:49
That's why it's the wide option. Anyways, we're going to execute this
55:55
But of course, wait, I don't want to execute this because I don't have any pods yet
56:00
We need to define what a pod is, and that will happen in the following sessions, friends
56:08
So yeah, if you happen to be using Azure as the managed Kubernetes option
56:19
there's another CLI that you can use. This is just for Azure
56:24
If you're not an Azure user, just forget this. This is the AEC command
56:29
This is the Azure command line interface. However, I'm not going to use any particular Azure-related feature for Kubernetes in this series
56:42
I'm just going to use Kubernetes vanilla. Cool. So, this is it
56:53
We're going to close this session down because in the next session, we're going to talk about the Kubernetes architecture
57:03
I'm going to explain those control planes, features and services and components and modules, the ones that were in the diagram
57:14
Remember that? So I'm going to show you that and I'm going to describe and I'm going to explain that in the following session
57:23
cool let's close this down thank you very much for uh joining me and see you
57:30
next time i'm going to answer some questions here before we uh close this streaming
57:38
uh thank you very much thank you very much um so yeah thank you friends thank you too for coming
57:51
and yeah, see you next session. See you on the next one
58:02
Bye-bye
#Networking
#Distributed & Cloud Computing
#Development Tools
#Educational Software


