# Kubernetes Project for Beginners | Run your First App on Kubernetes | Edureka | Kubernetes Live

## Метаданные

- **Канал:** edureka!
- **YouTube:** https://www.youtube.com/watch?v=zTeV7mJ6feU
- **Дата:** 11.05.2026
- **Длительность:** 46:26
- **Просмотры:** 1,330

## Описание

🔥Advanced DevOps Certification Training with GenAI : https://www.edureka.co/devops-certification-training
This Edureka 𝐊𝐮𝐛𝐞𝐫𝐧𝐞𝐭𝐞𝐬 𝐏𝐫𝐨𝐣𝐞𝐜𝐭𝐬 video will help you create, run and share a Container Image on Docker. Moving on, we will set up a Kubernetes Cluster using minikube and finally, run our First Application on Kubernetes.

🔵Kubernetes Full-course video: https://youtu.be/YXfLAWGTI38
🔴Subscribe to our channel to get updates on Kubernetes Full Course. Hit the subscribe button above: https://goo.gl/6ohpTV

🔴  Twitter: https://twitter.com/edurekain
🔵  LinkedIn: https://www.linkedin.com/company/edureka
🔴  Instagram: https://www.instagram.com/edureka_learning/
🔵  Facebook: https://www.facebook.com/edurekaIN/  
🔴  SlideShare: https://www.slideshare.net/EdurekaIN  
🔵  Castbox: https://castbox.fm/networks/505?country=in
🔴  Meetup:  https://www.meetup.com/edureka
🔵  Community: https://www.edureka.co/community/ 

#edureka #kubernetescertificationtraining #edurekakubernetes #kubernetesprojects #kubernetesprojectsforbeginners #kubernetesdeployment #kubernetesedureka #edurekatraining #kubernetes

---------𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐎𝐧𝐥𝐢𝐧𝐞 𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐚𝐧𝐝 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧---------

🟣 Kubernetes Training: http://bit.ly/2ZauSTy
🟣Python Online Training: https://bit.ly/2CQYGN7
🔵AWS Online Training: https://bit.ly/2ZnbW3s
🟣RPA Online Training: https://bit.ly/2Zd0ac0
🔵Data Science Online Training: https://bit.ly/2NCT239
🟣Big Data Online Training: https://bit.ly/3g8zksu
🟣Selenium Online Training: https://bit.ly/3dIrh43
🔵PMP Online Training: https://bit.ly/3dJxMTW
🟣Tableau Online Training: https://bit.ly/3g784KJ
🔵 Microsoft Azure Online Training: https://bit.ly/3wsAhV4
🟣 Power BI Online Training: https://bit.ly/3zq1WHX

---------𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐌𝐚𝐬𝐭𝐞𝐫𝐬 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐬---------

🔵DevOps Engineer Masters Program: https://bit.ly/2B9tZCp
🟣Cloud Architect Masters Program: https://bit.ly/3i9z0eJ
🔵Data Scientist Masters Program: https://bit.ly/2YHaolS
🟣Big Data Architect Masters Program: https://bit.ly/31qrOVv
🔵Machine Learning Engineer Masters Program: https://bit.ly/388NXJi
🟣Business Intelligence Masters Program: https://bit.ly/2BPLtn2
🔵Python Developer Masters Program: https://bit.ly/2Vn7tgb
🟣RPA Developer Masters Program: https://bit.ly/3eHwPNf

---------------------------------------Edureka Post Graduate Courses-------------------------------------------

🔵  Artificial and Machine Learning PGD: https://bit.ly/3AylL0q

----------------------------------
How it Works?

1. This is a 5 Week Instructor led Online Course.
2. Course consists of 30 hours of online classes, 20 hours of assignment, 20 hours of project
3. We have a 24x7 One-on-One LIVE Technical Support to help you with any problems you might face or any clarifications you may require during the course.
4. You will get Lifetime Access to the recordings in the LMS.
5. At the end of the training you will have to complete the project based on which we will provide you a Verifiable Certificate!

- - - - - - - - - - - - - -
About the Course

Edureka's Kubernetes Certification Training introduces you with the advantages provided by containers over the virtual machines.

You will understand why we need an orchestration tool for containers. You will also get to know the boundaries of Kubernetes – what it does and what is it not supposed to do.

You will also understand the inherent architecture of Kubernetes – master components, node components and the addons provided by it. The course will start off with learning the basic components of Kubernetes like Node, Pod, Deployment, Services, APIs etc and then teach you to create a local cluster using Ubuntu VMs.

- - - - - - - - - - - - - -
For Online Training and Certification, Please write back to us at sales@edureka.in or call us at IND: 9606058406 / US: 18338555775 (toll-free) for more information

## Содержание

### [0:00](https://www.youtube.com/watch?v=zTeV7mJ6feU) Segment 1 (00:00 - 05:00)

Hello everyone. I welcome all of you on behalf of Edurea guys. So let's get started guys with our today's session that is project for beginners. So what exactly is cubernetus? We will be discussing that today. So before I actually start let's our today's we mainly going to talk on the need for cubernetus what exactly is cubernetus okay how to create and how to run a container image. Okay, how do we create a cluster we deploy our first application on cubernetes? So this is what mainly talk. Okay, exactly is let's go over there. What exactly is Kubernetes? Okay, so Kubernetes guys is basically a container orchestrator. It's a container orchestrator. Now why do we what is a container? first of all and what exactly is a orchestrator? Let's talk about this particular part. Okay. And why do we need cubernetes? So in short, Kubernetes is also called as skates. Uh now we why we call it as skates is because if you see the spelling of Kubernetes, it start with the letter K and it ends with the letter S. Between the first and between the last character, you have total eight characters. You can count it. U B E R N E T E. Okay, total eight characters between the first and the last. So that's why we call it as kids. Okay, so it's a basically a container orchestrator. Okay, so first of all, what exactly is a container? Okay, let's suppose I want to deploy a application. So what I normally do to deploy an application to deploy an application, we simply first create up a server. Okay, on this particular server, okay, we install our operating system and on top of that I go and install my application, right? This is what I normally do. Like for example, on my Windows, I have a Windows laptop. Okay, I have installed Windows as a operating system and on top of that, I have installed multiple applications like Chrome, Edge, okay, puty, Notepad++. These are applications. It's a application. Zoom is a application, right? So I've installed multiple applications on top of my host OS. So I have my laptop, I have my machine, on top of that I installed Windows as a operating system. On top of that I have installed my application, right? But if I am trying to run multiple application let's suppose I have hundreds and thousands of application which include your web server, your Kafka applications, your databases, your Hadoop clusters. There are lot many applications that I'm using in my day-to-day environment. Some monitoring applications like Nagios, Prometheus, there are lot many things that I'm running okay in my customer environment or in the production environment. Now I to deploy those applications guys understand to deploy those application I will be needing uh do I need to deploy this on one server like one application per server one like for example here MySQL is running. Normally we do that in the traditional environments. MySQL is running. I create one more server. Okay. And here I install operating system and I'm installing HTTPD over here. Okay, I can do that. If I have another server, okay, here I can run my Oracle database, okay, or posgress database, any other application like Kafka, Hadoop, whatever it is. So basically I can have multiple servers on which I can run multiple applications. That's good enough. But the problem is when I'm doing this my overall cost of deploying application the overall cost of running the entire applications will go high right because I have to maybe thousands or many servers okay depending on the number of applications you have you're going to create servers okay so maybe you end up with thousand servers or somewhere now what I was saying was But if I try to deploy application servers the problem is I will end up with huge cost right my cost is going to be very high. So how I can optimize this cost and apart from that cost the problem is that if I have new application coming first of all I have to bringing new servers I have to create new servers on top of that I will install application it is time consuming approach so cost is also high time is also very high time it will also take higher.

### [5:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=300s) Segment 2 (05:00 - 10:00)

Okay. It will take time because understand the problem here is that let's suppose my customer says hey I want to deploy this application. So first of all have to look in the server available if I don't have the server or it can be a virtual machine but I have to create virtual machine on the or not or should I have a dedicated server for creating those virtual machines as well right so again it is a time consuming and on top of that it's a speaker net I will patch my operating system I will do everything And then in the end, okay, I will run my application. I'm going to run my application in the time consuming as well as costly affair. Can I not do something like this like a multiple server like just put all the application on a single server? likeing system I put my number two on a single like this we can have this will help already to deploy applications a good solution is to do the between these if I talk for example GX okay tool I have both these on same tpd balancer end as well to be both of them default port 80 so if I try to install both these application on the same server how will they Because both of them are trying to bind to the same TCP port number and that is the big challenge. One application will be running other will not be running. Application one will be running, application two will not be running. If application two will be running, application one will not be running. Why? Because it's a clear networking conflict between applications. So my solution is very looking easy that run multiple application on single server. Okay, You will reduce time, you will reduce cost but you are going to increase conflicts between applications first networking. Now there are chances that dependency okay there can be conflicts between the dependent dependencies like for example application number three requires Java version 17. Okay requires Java version 21. How will you fulfill this? How will I deploy my application? Okay, I can if I install Java version 17, application 3 is running fine. But if I install Java version 21, okay, application three will not be running. Application two will be running. There's a the application version Java is required by both of them requires version two requires version 21. So problem okay there can be more conflicts like process conflicts two applications are trying to bind to the same port number two applications are trying to use the same file or try to mount a same file at a given point of time they are trying to write to a same file or trying to write or trying to mount a same file okay then it's a problem how will they do it if one application is writing to a file other application will see a lock on that file Okay. So there can be multiple conflicts networking processing file mounts IPC communication like one application IPC interprocess communication. One application consume all of your CPU. Okay. Other application is starving for waiting for CPU. Okay. That it gets the CPU and it will go and process it. So one application consuming all the cycles of CPU other is starving conflict right. So I want multiple applications to run on a server to reduce cost and to reduce my time to deploy. But these are that I might face the conflicts. I might be facing the conflicts over here. And how we can reduce these conflicts? conflicts by running application in isolated environment. Like what we can do over here is like I have this server over here onto this particular server I install the operating system. Okay. Now instead of deploying applications directly let's create some kind of isolated environment in which my application is running and along with the application its

### [10:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=600s) Segment 3 (10:00 - 15:00)

dependency is also running. I have another isolated environment in which the application 2 is running along with its dependency. I have another isolated environment in which application 3 is running along with its dependencies. Along with its dependencies that is running right. So here when I say isolated environment it means that this environment this application will have its own network means its IP will be different. It will have a private IP. This application will have a different network. Okay. This process ID. Okay. This will also have different set of files or mounts. uh your IPC. Okay. Enter process communication and a different host name. It will also see. Okay. Same over here. P I mount for this mount along with IPC host name will also be different for application 3 and application two will also have all things isolated segregated no mixing and matching of the same things network IP is different process ID different mounts different IPC different host name different along with that their dependency for example application 2 requires Java version 17 and this requires Because Java version 21 they will be running in their own environments dependencies running in this isolated environment. Okay. So we need some okay to isolate our applications. Okay. Where on a single host I'm able to run multiple applications. applications on a single host. Okay. But there should not be any conflict. So this isolated environment is nothing but this is a container. One isolated environment is one container. This is a container. This boundary that you see one is a container. Okay. And how do we create these containers? Let's try to understand that. Okay. So to create these containers what we need to do we require some tools like here's my server I have the operating system on top of that I will install some container tools like docker docker cryo podman containerd there are lot many tools in the market I can use any of these tools to create containers so let's suppose I'm using docker and after using docker okay this docker will allow me to create isolated environments in which I can run my applications in which I am can go and create my applications. Application one, application two, application number three and so on depending on how much CPU and RAM this machine has according to that I can create the number of containers over here. So what is a container? A container is a isolated environment in which you are running your application along with application any of its dependency. When I say isolation, isolated environment means every container will have its own network, own process, own mounts, own IPC and own host name. All these things will be different for one container. Other container will have these different from the first container. The third container has these things different from the first and second container. All unique. Okay. so that my application runs successfully without any issues, without any challenges. This is what a container is mainly all about. Okay. Now the big problem here is that let's suppose okay I'm happy by running multiple container tools. like I have this machine on top of that I installed operating system. I installed Docker and on top of that I have created multiple containers in which I'm running my applications. Application number one let's suppose this is MySQL. Okay. I have application number two which is HTTPD. three which is let's suppose your Kafka. So I'm very happy by running multiple application on a single server. It reduces the cost. Along with that it has also reduced my time to deploy application because the server is already ready. Tomorrow let's suppose I have to bring another application. I can do that. For example, I want to deploy another database CD. I can deploy etc. Yes. Fine. Okay. So definitely I can deploy multiple applications within like few minutes. Few minutes like hardly one or two to go

### [15:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=900s) Segment 4 (15:00 - 20:00)

and deploy a container. That's it. The big problem here is that what if this operating system crash. So this machine is a single point of failure. SPOF Okay. And what do I mean by that? If this operating system crash or if the server is shut down deleted. Now this server can be a virtual machine as well. Let's suppose this is hosted on AWS cloud or Google cloud or Azour cloud. Some cloud it is hosted. Okay. So if the machine is deleted or powered off or if the operating systems crashed what will happen to these applications? They will also crash because all these applications are running because of docker. Docker is a application. Docker is a service or application that helps us in creating these containers. But if the operating system crash, this application will crash. Ultimately these containers will also crash in which you are running your applications. So how we can overcome this? So for overcoming this we require orchestrator. So cubernetus is the tool that will help us in overcoming these kind of failures. Understood? So that's why we call it as container orchestrator. Cuba latest is a tool that provides us the high availability high availability and high availability and fall tolerance of containerized applications. This is what it provides. Okay. Now what do I mean by this high availability and fault tolerance? High availability means something like when you want something in redundancy like I want redundant of something okay has high availability I have server running okay I have a server running it's a critical application my SQL it's a very critical application database application so I will not be running it on a standalone server I will have okay if one server goes down I can have access from the other MySQL server right this is high availability running multiple copies of the same application is high availability. Okay. And what is fault tolerance? Fault tolerance is automatically recovering from a failure. Let's suppose if the server crashed and it automatically come up. That's very good. Okay. No manual intervention. Automatically recovering from a failure is fault tolerance. So right now if I'm using Docker, I'm running all my containers over here. This is my server. I have the operating system docker over here. And if I go and create containers, my application containers are running fine. But the problem is if any of the container die, my server is running fine. This is fine. If any of the container is dead, I have to go and manually create it. No fault tolerance as of now. No fault tolerance for my applications that are running in container in containerized environment. That's why we need orchestrator and Kubernetes. So Kubernetes is nothing but a container orchestrator. Okay. Apart from that, let's suppose this is a application called as MySQL. So I need high availability for this. Okay. So I can have multiple containers of MySQL. Okay. That's fine. But all of them are on the single node. This is not too high availability. What if this machine crashed? All MySQL containers will be dead. So I need to span I need to expand the application across multiple nodes. That is the overall idea to get the actual high availability. Right now I can have three containers of MySQL. You might be thinking I get high availability but the problem is the underlying infrastructure is the single point of failure. The underlying virtual machine on which those containers are created is a single point of failure and that is the problem. If the machine fails everything is gone, right? To overcome this we require Kubernetes. Okay. So what does Kubernetes do? Let's try to understand Kubernetes or any container orchestrator that is in the market. So we have Kubernetes, we have Docker Swam. Okay. We have Apache Misosphere. These are some of the alternatives of Kubernetes. So let's suppose I have multiple machines. Machine number one, machine number two and machine number three. On each machine I have the operating system installed. On each of the machine we have the OS docker dot installed. Okay. On each of the machine we have this docker installed. Okay. And now right now when you will deploy cubernetus so what cubernetes is going to do? Cubernetus first of all will create a first of all right now all

### [20:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=1200s) Segment 5 (20:00 - 25:00)

these three machines are standalone machines. machine number one, machine number two, machine number three. Right now, all these machines are the standalone machines only. Okay, they have no correlation between them. But when I'm going to deploy Kubernetes, what is going to happen over here? Kubernetes is simply going to create a network, a private network. It is going to create a private network. Mainly for your containers. It is mainly containers. A private network for containers. Okay. This is what cubet is. Let's suppose the support 0 to/ there can be some subnet. Now any container that is getting created. Let's suppose there's a container that gots created over here that will take the IP from this network. Any container, let's suppose this is MySQL, it will take the IP from this network. You create HTTPD. Okay, the IP from this container does not matter whether wherever my container is running on which physical node. These are the nodes on whichever node the container is running does not matter to me. My containers are going to take the IP from a single network. So all the containers first of all can communicate with each other. Okay. Container run on any machine. They can easily communicate with each other using this particular private. Understood the first thing. Now the second important thing over here. Okay. here is that let's suppose if this HTTPD application is dead. machine three crashed this crash do I need to worry I have two more machines that is going give me the fault tolerance for this application. So cubet will automatically see that one of the machine has crashed the operating has crashed. Okay. So any container that was running on that machine will be shifted. So let's suppose it is shifted PD will be shifted over the IP shifted to node one or maybe can be any and let's suppose automatically a fails FT Okay, I have this MySQL application. This is a critical application. I need a for this. So containers MySQL controls as well. SQL container can be SQL here. Suppose this is healthy this particular not here. So I can have a proper high availability by SQL multiple copies of the same application. I can have those multi copies of the same spread across different is the role of that's why we is basic that provides the highance of my containerized without it is if I'm running anything it's all a single Okay, nodes, three nodes, four nodes and deploy access. Okay, like when HTTPD I own it as well using services but how we expose it. Okay, but normally is all about mainers it provides and for the main goal okay let's try to see how over here and check on the guys over here. So over here is you can see this uh let me close this see I have a sle on the GCP. So I'm going to create a cubernetes cluster on GCP. Now you can AWS. You can create it on uh GCP, Azure, digital ocean, Oracle cloud, IBM cloud, any

### [25:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=1500s) Segment 6 (25:00 - 30:00)

particular cloud. You can go and create a cubernetus cluster. It's completely fine. It's very easy as well. No need to worry about it. So what I have to do here is I simply anything. Okay. If you see coupons, here's the option cube link. Click on this. Anything? No, I don't have anything as of now. Okay, I think it did. Yeah, it did not opened up. Yeah, now it opened up. Clusters clusters. Do I have anything over here? See, you can create a cluster. So, cluster directly from the CLI. Okay, the back end when I'm going to use the CLI guys do is it is automatically going to create okay uh two I'm going to have a two node cluster I will be having two node cluster so when I will create the cubitus cluster there will be two subs that will be provisioned and that those will also be provisioned on my Google cloud account only where you will see those in the compute engine right now I have nothing it's all blank all scratch patch. Okay. So if you see this, do I have any instances, any virtual machines? Click on view instances and you will be seeing nothing. There are no instances as of now. Okay, this blank. Okay, I refresh. It's all machines. I have no cub. Let's create a cub. Okay, I'm create a cluster on mainly Google GCP spec. If you want to create a cubernetes cluster on Amazon, you need to use the Amazon commands. AWS EKS command. Here I'm going to use G-Cloud command. If you're using Azour, you have to use the Azure commands. Depending on the infrastructure, we need some kind of platform. We need some infrastructure to deploy a cluster. Okay, a platform which can give me servers, networks, everything. You can also deploy this onremises. But in onremises also you have to create virtual machine. On top of that you have Kubernetes is a application okay that is managing containers on certain number of nodes on the nodes okay Kubernetes requires some VMs some machines on top of those machines you deploy a Kubernetes cluster and in the end you create containers on those machines will be managed by Kubernetes okay so Kubernetes is a application for managing container it's a container orchestrator. Okay. So to deploy that what I'm going to do here is I am simply going to go on cubernetes. Okay. You can do it from UI but I give you a more simplest way. Some few commands and I will be done. Okay. So let me open the command line to do this. Right now there are no clusters. You can see let's open the command line. You can see activate cloud shell shell. Okay. So now click on this and activate the CLI of the Google cloud. Okay. So it is right now opening the CL app. Okay, let me show you the command. In the meanwhile, let it open up. Okay, it is going to authorize my account one time. Okay, so for having opening up this Google cloud, you just need to use your Gmail ID and Gmail password. Your Google account ID and Google password is sufficient to open GCP console and to do anything over there. You just need to give your card but you will be getting $300 as a credit for 3 months. So normally it is free for the first 3 months. Okay. After that you have to pay. Okay. After let's suppose 3 months you are still using GCP you have to pay. Okay. So it is taking my cloud shell to unarchive because I'm utilizing this almost like after a month I'm opening GCP. Okay. And this is my personal account over here. Open this in a new window. So what you have to do just click on this button open in new window. This will get open up a new window over here. And I can close it from here. And you can see it's opened up. Authorize this call. Okay. So it will get authorized over here and now it's opened up. Okay. So right now I am on the cloud shell. I'm in this particular project demo 8 project. See demo project demo 9760. This is the project ID when I see demo 8 minus. Yes. So let's I need to create a region. I have to first define that. Okay. So whenever you create a cluster or whenever this cluster will be creating some kind of compute resources like EC2 like your uh compute VMs in AWS we call it as EC2 instances here we call it them as compute instances okay so those instances or those VMs will be created in some kind of region some kind of zone so I have to define that okay where I want to create so for example what region what zones I have I just want to show you I'm not creating any

### [30:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=1800s) Segment 7 (30:00 - 35:00)

something instance click on this you see these region see these there are regions over here this over here in every region for example I'm using US central one okay in this region we have multiple zones A B CF see this there are multiple zone over here right so you can select zone is nothing but a data center so I can select any data enter over here. Okay. So, I'm going to simply use any region, any zone. First of all, I have to select it. So, I'm going to my CLA. Let me put the entry for my zone and the region. So, I have the command handy over here. So, first let me select the region. G-Cloud config set compute region. Paste it over here. Ctrl + V will work over here. So, G-Cloud config set compute region. US West 2. Now, in US West 2, you have three data centers A, B, and C. Choose anyone. So let's choose A. So I'm choosing A. G-Cloud config set compute. Ctrl + V. Control V. G-Cloud config set compute zone. US West 2 A. That's it. If I hit enter, my zone is set. My region is set. Now what next? I just have to go and create the cluster. That's it. So I simply will be running a command G-Cloud container clusters create. This is the Kubernetes is a container a cluster for your containers. So we call it as container clusters create. Name of the cluster hello-cluster. Okay. And how many nodes you want to have in this cluster. Let's suppose I want to give number of nodes is equal to two. That's it. So this is going to create a cubernetus cluster for me with two nodes. You can also have one node cluster but in a standard environment in a production environment we always have more than one because if one node is down at least we have another node to host the applications to run the parts okay in the real world in the production world we never have a single node cluster multi-node cluster three four five big clusters as well like 50 nodes 100 nodes thousand nodes I have seen cluster almost 500 node clusters as well, big clusters. Okay, so now here guys, my cluster is getting ready. Okay, this is the demo environment. So I'm just using two nodes. Okay, so here my cluster is getting ready on the back end. If I go and show you Kubernetes over here. Okay, where's Kubernetes? Click here. Kubernetes. Okay, and over here if I see the clusters, can we see the clusters? Okay, click on clusters. Scroll down. Can you see the cluster over there? Okay, coming soon. Let's close this. Okay, that's fine. Can we see this hello cluster coming up? Okay, number of nodes. Okay, and the status it is being created. The cluster is getting created over here. Okay, this will normally take around 5 minutes to 10 minutes of time cluster to get entirely initialized. Okay, after this cluster is initialized, I will go and run some commands. Okay, in the back end, let me first show you that my nodes have also started coming up or not. So the cluster is getting created on the CLI also I can see the same output okay creating cluster hello cluster in US west 2A that's completely fine now I go back and what I'm going to do I'm going to show you the compute nodes okay are there two machines coming online or not okay let's see to it over here so compute engine click on the compute engine okay and over here let's see the instances click on this VM instances okay and you will be able to see two nodes see this two nodes two machines coming up. Okay. Where what are these two machines? These are the two machines of my cubernetes cluster on which my containers will be running. All running on mainly on these two nodes only. Okay. Once my cluster is ready, I'm going to run some commands for you guys to verify the state of my cluster. Okay. So, what I'm going to do here is I'm going to run commands like cubectl get me the nodes. Okay. If I run this command, it will give me output two nodes. the name of nodes. Name of nodes in cluster. It is going to give me the name of nodes in the cluster. Okay. And their state whether they are active or not. Ready active or not. It will give me that. Okay. Cubectl get nodes. After that I want to run my container. So in cubernetes we call container as pod. We denote the containers as parts. Now pod is basically the cubernetus resource. Whenever you want you have to create pod and in the pod your container will be running. So you don't create containers directly in cubernetus. We always create pods and in the pod container will be created by cubernetus by your container runtime.

### [35:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=2100s) Segment 8 (35:00 - 40:00)

Okay over here if I talk about be running command ctl first of all cubectl cube ctl we also called as cube cuttl or cube cutle is the cubernetus command line utility command control uh we call as cubernetes client utility or command line interface CLI cubernetus cla any cubernetes command be it Amazon cubernetes you deploy a cubernetes cluster on AWS, Azour or Google does not matter. All cubernetes commands are always going to start with the word cubectl. If you are from America or United States, people normally call it as cube cuttle. Cube cutle or cubectl one and the same thing. Okay. So cubectl get nodes. Okay. This is going to give you the number of nodes in your cluster. And if you want to create a pod command will be cubectl run. I want to run the first pod. Okay. Minus image. Let's suppose I give the image as ngx. I want to run ngx application or httpd. I can give that. So I can run another command cubectl second pod. Second pod minus image is equal to your httpd. That's it. Okay. So I'm running two ports over here. First part and second port. Now first part is going to have nanix container. Second httpd container. Okay. But to run these commands guys, I have to first verify whether my cluster is created or not. So let's go back. Let's go to the CLI over here. Here's my CLI. Okay. And my cluster is successfully created. I told you it will take 5 minutes, not more than that. 5 to 10 minutes. And you can see the cluster is running. Right. Control plane is healthy. Cluster has been health checked. Done. Everything is working fine. And can I run the command now? Hey cubectl, can you please get me the nodes in the cluster? I will be having two nodes. Let's see to it. Yeah. Can you see this two nodes, right? Because I have given the count as two. That's why two nodes. Two machines. Now these are two virtual machines guys. Okay. And you can see the virtual machine 746K QW1. Can you see these two virtual machines guys over there? 74 CK ending with 74 CK and QW1. See this right? 74 CK Q 74 CK and QW1. Right. Do I have any pod right now? Cubectl get me the pods. I don't have any pods. Let's create the ports. So I copy the command directly which I've written on the notepad and let's try to run it. Okay. So I go here and Ctrl +V hit enter and cubectl get pod. So I've started a pod right now and you can see first pod status is container creating. So in this pod container is getting created. Which container guys? ngx container. Okay status is 0 by 1 0 by one means in the pod right now there's one container but out of that zero is running. Pod has one container but zero is running. Why? because it is in container creating state. Let's see the output one more time. cubectl get pod and as expected it is running successfully right so cubectl get pod shows me container is running successfully from last 30 seconds can I see can I get more details of the container yes or the pod cubectl describe me the pod just describe this pod and the name of the pod is first pod that's it just describe the pod or po will also work is the short form for pod so if you PO or POD one and the same thing. Okay, so describe the pod first part. Hit enter. And what do I see? Okay, we see this. See, successfully assigned the pod to the node qw1. I have two nodes. Qubectl get nodes. Now the pod is assigned to the node qw1. Now in the pod first of all container will be created. But to create container image will be pulled up. So successfully pulled the image pulling image. in 9. 4 seconds. After that it created the container and then started the container. So over here guys if you if I scroll up these are the events. Okay these are the events that you saw. But if I go and show you the output on top you will see automatically see the pod first pod is created on the node QW1. This is the IP address of the node. You want to verify? Let's verify 101680. 5 the IP address of the node. Okay. And

### [40:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=2400s) Segment 9 (40:00 - 45:00)

over here this is the IP address of the pod because I told you Kubernetes is a container orchestrator that will create the network and all the containers all the pods will take the IP from that network. So this is the IP of the pod. Now inside this pod a container is running. Can we see inside the first pod container is running? The name of the container is okay first pod only. Whatever is the name of pod name of container is also same. Can I manipulate this? Can I modify this? Yes. At the time of creation I have the ability to do this but via the YAML files. So in Kubernetes we try to create these objects via the YAML files. Okay. So yes, right now container name and pod name is same. Container is a container ID. It's not created by a docker. Google Kubernetes engine this is GKE uses containerd not docker. Kubernetes needs a container tool. Without container tool how containers will be created. So cubernetes is using containerd. We have docker container d podman cryo multiple. So here containerd is utilized and image the application that is running is ng i nx and this image is pulled from docker hub. See this guys, So I've successfully created my application. If I want to expose it, I can expose it. But for that I have to create services. load balancers. Okay. But as of now, I can see over here that my cluster is successfully running. Okay. I can see nodes as ready and I'm able to successfully deploy my application. Can I create more pods? Yes. Let's run the second part. cubectl run second pod minus image httpd. Let's paste it over here. Ctrl + v. And it should be running fine. See cubectl get me the pod. Okay. So see second pod is container creating. Can we see this cubectl get pod? Absolutely. See it is running now from last 11 seconds. Can we see the describe cubectl? Describe me the pod. So there's a space describe me the pod and the name of the pod is second pod. Let's copy. Just double click and paste. Control double click will copy and control V will paste it. You can see second pod is also assigned to the same node. Now it's good that both the ports are on the same node but it can be any node out of these two. Okay. As of now my both the parts are going on same node. That's fine. pulling image here running here and created container started container let's try to create third part okay and this time I give radius which is a caching database which is a database mainly used for cache purpose database pod okay now let's see where this is going cubectl get me the pod okay see radius db pod is coming up which is going to host the radius application so cubectl describe me the pod DB pod. Okay. So over here once I hit enter, let's see if the pod is running. And this is also not sure why it is going on the same node. But if you try to create multiple pods, this will be going on both the nodes equally. Let's try to run more nodes over here. Or DV pod one. I can have same application as well. DV pod 2. Okay. DBOT 2 same application in multiple ports I can have it definitely this is high availability guys running multiple copies of same application right now if I want to see I have multiple ports cubectl get pod see how many ports I have six ports seven ports 1 2 3 4 5 6 which node they are running let's try to verify cubectl get pod minus output wide so as of now you can see some DB pod is running on qw1 DB pod one is running on 746K the other node. So I told you out of two nodes any node will be chosen to create a pod create a container to host my application. Okay. And there's a component in cubernet called asuler that will choose which node pod should go. So if you run the command cubectl get pod will give you the ports. But if you run this command with minus output in a widal state it will give you the node on which the pod is running. You don't have to then describe every time. Just do that and you will see all the pods and these pods are running on which node. You can see that easily from here. Now if in the end I want to delete my entire cluster, I can delete it. Simple command for doing that is G-Cloud container

### [45:00](https://www.youtube.com/watch?v=zTeV7mJ6feU&t=2700s) Segment 10 (45:00 - 46:00)

container clusters delete. Give the name of cluster hello cluster. That's it. It will ask me yes no. If I give yes, it will terminate the cluster. So cluster creation and cluster deletion is very easy guys over here. And Kubernetes is all about creating pods, managing those parts. Okay, have a great time ahead. Thank you and bye-bye.

---
*Источник: https://ekstraktznaniy.ru/video/50515*