Learn KUBERNETES for Beginners | Pranjal Srivastava | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Learn KUBERNETES for Beginners

teacher avatar Pranjal Srivastava, Subject Matter Expert

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

17 Lessons (1h 20m)
    • 1. Overview

      1:25
    • 2. What is Docker and Kubernetes?

      1:39
    • 3. Architecture of Kubernetes

      6:06
    • 4. Pods and services

      1:45
    • 5. Create multi cluster using KinD

      6:24
    • 6. Minikube

      3:14
    • 7. Deploying and exposing first Pod, understanding Kubernetes YAML files

      7:56
    • 8. Interact with container inside pod

      5:05
    • 9. Creating virtual cluster with the help of Namespaces

      6:33
    • 10. Namespace

      4:49
    • 11. Replica controller for High Availability, Load Balancing

      5:38
    • 12. ReplicaSet using YAML

      5:21
    • 13. Deployment

      3:22
    • 14. High Availability & Load Balancing

      1:22
    • 15. Scaling Up/ Scaling Down

      2:21
    • 16. Autoscaling

      9:49
    • 17. Easy update and quick rollback

      7:29
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

26

Students

--

Projects

About This Class

In this class, you are going to learn about most popular orchestration management tool, Kubernetes.

Kubernetes, also known as K8s, is an open-source container orchestration tool for automating deployment, scaling, and management of containerized applications.

Among list of containerization orchestration tool, K8s is one of the popular and powerful tool which is originally designed by Google and is now maintained by the CNCF aka Cloud Native Computing Foundation.

The salient features of Kubernetes is

  • Automated rollouts and rollbacks

  • Self-healing

  • Horizontal scaling

  • IPv4/IPv6 dual-stack

  • Auto load balancing

  • Service Topology

  • Service Discovery

  • Automatic bin packing¬† ¬†and much more

In this course, you'll get answers of what is container and container orchestration tool, what is Kubernetes and how it is different from Docker, how to scale up the application, how to make fault tolerance and highly available applications and much more.

Then you'll be learning about pods (basic unit of Kubernetes cluster), then adding namespaces and labels to make virtual cluster. Then you'll learn about replication controller, replica set and deployment. What are the similarities and difference among them as well to implement them with the help of YAML files.

You'll have lots and lots of detailed hands on various commands related to minikube and kubectl.

Lectures backed by practical exercises makes it easy to understand without wasting time in doing troubleshooting. This is the only course that provides 90% practical hands on with 10% theory to support the topic.

Meet Your Teacher

Teacher Profile Image

Pranjal Srivastava

Subject Matter Expert

Teacher

I am passionate developer, machine learning enthusiast, coder and bug fixer. Developed many applications on various platforms including python, java, android, php, etc.

I have worked over cloud on IBM Bluemix, AWS, and Microsoft Azure. Prefer digital marketing and SEO in my free time.

I am IBM certified Python developer.

Created own Programming language in Hindi .

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Overview: Hi there. Welcome to this class on Q, and it is for beginners. My name is bronchial and I'm your instructor for this class. In this class, you will learn multiple things related to communities. First of all, you will learn how to create a part, which is the basic unit of communities. And then you will going to expose your part to the external world using services. After that, you will learn how to create exact replica of your part to make your application higher level and self-healing. Then you will learn all about deployment, through which you'll be able to create the different versions of the application through which you can easily update your application, as well as you can do a quick roll back. Scaling up and scaling down is added the salient feature of Q and 80s in this class, you will also learn how to scale up and scale down your application. At the last, you will learn some more important companies or communities lack namespaces, container images, kind, and much more. So this class will help you to build a most important skill for which is required for DevOps Engineer, which is Q and ATS. After mastering the skills on Kubernetes, you can apply it on various Cloud platforms like GCP and AWS. So see you in the class. 2. What is Docker and Kubernetes?: Before understanding communities, you must know about container technology. You have developed an application, now it's time to run it on production. But you call this some warnings and errors. You search for a solution and you data for forums like Stack Overflow or even to your teammate. But at the end, you don't have a solution. Harding, the survey, it is found that about 70 percent of issue are related to word problems we have right now. To rescue us from such an problem. Darker content of the picture. Darker is one of the popular container technology. But to occur, you pack to application which essentially libraries and dependencies into container and makes your deployment process is you run anywhere anyway. I mean in production iron as well. This time when developer team gives the code do dev, ops team to deploy the application. And it works. Hola, darker. You see if you increase this time, your resources and large soft money. So this is all about Docker container technology. Suppose your application becomes too much power. And to solve that problem, you added more and more containers. And now to manage containers will be impossible for you. They're giving each piece comes into the picture and healthy out managing container workload and services. 3. Architecture of Kubernetes: Hi there. Welcome. Here in this, we're going to talk about Q and it is architecture. This is our master node. Just like other node. Notice smallest unit of computing hardware in the Q and a, which represents a single machine into your cluster. Most of the time, it could be a physical machine which is located into datacenter, or it can be washing machine hosted on a cloud providers like AWS, GCP, or as x2. This master node is also known as control plane and Cuban APs, which is responsible for making global decisions about the cluster, and also detect and respond to the cluster. Aaron's. Let's have a look inside a master node. Here you will find there are five components are too into it. One is kube API server. Other one is EDC de que controller manager, cube Schuller. Q Cloud Manager. Let me describe each of them one by one. Let's start with kube API server. Whenever you use Cube CTL command line interface, you actually communicating with kube API server, which is used to process all your rest operations when Dan and update the corresponding options into a DCT. This is the only cumulate is component which connects to it. And all other companies must go to API server to work with the plus. Just take. Another one component is it a CD? It acts as a clustered data store, which is used to provide consistent and higher level key-value store for persisting clusters. It provides information like what part nodes are running in the cluster and much more. If you have multiple master node, then it will go in to synchronize the data between them. Other one component is Q controller manager. The skill contamination was the state of the cluster to the API server Watch feature. And when it gets notified, it makes the necessary changes attempted to move the currents towards the desired state. In other words, QC incriminate her foster share state of the cluster using Q API server and do the things accordingly. Q controller manager is not alone. I also have four components. One is node controller, which is responsible for checking the nodes. And one is replication controller, which is responsible for maintaining the correct number of bars for API, the application controller object. Other controller is N port controller, which will populate the endpoint objects. And the last one, service account and the token controller, which creates a default account. And apex is token for new namespaces. Another component of Master Node is Q should do look. The queue should use the newly created bards, who knows with enough space to satisfy the bar resource name, it basically needs, listens the queue EPS or enqueue can pull them in Azure to create a new part and schedule it accordingly to the AV node. And the component of the master node is cloud controller manager. It is a Kubernetes control plane components, the Cloud specific control logic. It managed to link your cluster into your Cloud providers API and separate out that component, that, that dark red phone from the component that you interacted with your plus term. So this is all different components, our master node. Now let me describe some of the components. Node, which you can call it a worker node. Here you will find kubelet. Kubelet is an adjunct which runs on each node in the cluster, as well as including master as well. This cumulative proportion of the queue API server, whatever is going inside that node. The funeral service as an intermediate between the VPN server and the CNI Container Runtime Interface. Kubler gets the parts specification from the kube API server, ensured that bars and the containers are healthy and in the running state, it is a service, not apart. Then we have Q proxy. Q proxy handles the network traffic by allowing the communication between the parts, containers, and the node. It is also run on master node as well. If you have two client node, then there will be two Q proxy pods running on the master in order to communicate with those. Note that at the last we have Container Runtime Interface. It launched the containers on the node. We need container and time software. We can use different container runtime, but we widely used docker. Other than darker, community supports, container D, cry and Racket as well. There's all about the different components of communities. Hope you guys, you understand the high level view of carbonate is competence. 4. Pods and services: This is multi node cluster. Inside each node of the cluster having different number of parts. Parts is the basic unit of the communities. In Q&A. You can't run your containers directly. Instead, you have wrap up your containers into high level structure, which is part I containers inside a same part. We're going to share the same resources and the local neck for containers can easily communicate with other containers in the same part as they were on the same machine, while maintaining our degree of isolation from others. Can hold multiple containers, but you should limit yourself when possible. Because then you are going to scale up your part are killed Hanyu part. It will reflect into all containers which are located inside apart. So it is best that you should use a small number of containers inside part. So now we're going to discuss are the important keyword it acuities, which is services. Services is used to allow natural access to a separate parts. Suppose you have a client request. So there will be three check marks and whether you can use NodePort, ingress or load balancer. You can x's here part with our sight word. Other than it, there is a cluster IP, which is used for internal communication. But if you want to access par with the outside world, you need to use NodePort, ingress, or load balancer. 5. Create multi cluster using KinD: What's up, guys, Welcome back. In this lesson, you will learn how to deploy a multi node communities cluster with the help of immigrants. Listen, I've shown you that how you can deploy a single node cluster with the help of many cube, kind of similar to mini cube, n cube ADM. Here we're going to deploy multi notes and all multi node will have Docker brains chart. So kind simply means Q and 80s and darker, which is basically used for creating you when you disclose to locally and to use this guy and you must have Go programming language and Docker installed on your system. With the help of G9, you can do testing or do daily basis that document with the help of a kind. So here we go. The first thing which we need here is to create YAML file for definition for the cluster, okay? Such as write copy, no, bracket, multinucleate using kind dot yammer. This is a command to create. Okay, and cmd, okay. Now, I'm just going to remove this. Okay? So I've told you earlier that is a template for the YAML files which is used in humanities like you have to add your API version that kind and so on things. Okay? So here we are only focusing on the nodes and the cluster, so we don't require that template and specs object here. Okay? So simply I will write its kind is clustered and the API version will be using the Alpha for basically four kind. Okay, now here I'm just going to add this node object. And here I will define the number of nodes. And what will the role of that node, okay, suppose you need only two nodes. So you just need to write road and the purpose of that node, okay? Two times, okay? So we need one control plan and one worker node. So I did like this, okay? Suppose you need to add two more workers. You need to add, simply add this roll call and worker again. So in this manner, you can create a multi node cluster with the help of pine. And you type kind, you will find lots of everyone's minds or kind like bird, completion, create, export, delete, and so on. At me, use this voice and command. And here you will get the version of the kind. Okay, let me clear all this. Now. I'm just going to create our first cluster. This right kind space create space cluster. And the right hyphen, hyphen config. And you name of this YAML file. Which you don't hear. Okay? And and type the name of your clustered as my multi node cluster. Okay? And just hit the enter button, then you will get this kind of error. This simply means that Docker daemon is not money. So I started my Docker daemon and it will take few seconds to start your darker diamond, okay, because its name will lead. This is Q and it is in talker. So Docker daemon must be running on the background and it will not work if Docker daemon is not there. So as you can see, this orange, yellow, green, that simply means that our Docker daemon is running. Okay, so let me minimize this. And again, I'm going to hit this. Come on. And you can see that it started creating the cluster. It will go into create two-node cluster. One is master and other one is Walker. Let control to and simply means a master. Okay, don't begin to use. So it will be preparing the nose, writing the configurations. You can add some more configurations into your YAML file accordingly. Okay, So I did nothing is simple multi node cluster. It will take two to three minutes to create one cluster, okay? Once you have created your cluster now you can do whatever you want with clustered, like running the jobs into them. Okay? So just copy this command. It will give the information and or cluster, okay, like master or Dan QPS, this brief information related to cluster. Now just write kind get Leicester. So these are the numbers of how many cluster I have created right now. There are total of four. Okay, so I'm just going to delete to cluster, which is not any use for me. Yeah, you need to add cluster. They're kind believed Leicester. At the same time you continue to cluster. So it's just gave Spacebar. And right then at that cluster name, so it will go into delete the unwanted gesture. So in this lesson you have learned and how you can create a multi node cluster. Then how you can check the nodes and information Digital Cluster and how to delete your cluster. Okay? We're going to show you see notes are there, one is control plane and another one is worker. Control plane simply means a master node. This is all about kind. Hope you understood, so forth and they'll keep learning and keep exploring. See you in the next class. 6. Minikube: Hi, and welcome back. The objective of this lesson is to create a mini cube. So what is money q Mini cube is a tool which helps you to create a local Cuban nucleus cluster on a laptop or PC. Especially for those who are new to communities and for the developers as well who want to try it and their deployments on a daily basis. With the help of many cube, you can create a single node cluster. So let's create one. Does have been EQ VM. We need to use this command. Many cube is chart, okay? If you want to use other kinds of drivers, by default is virtue balls. If you want to set this happens we as your driver. So you can give it in this manner, okay, other than Hyper-V and virtual box, you can use darker KVM to as well as Pateman. So in this way, I created mini cue VM. Okay? It will take two to three minutes to have been. So after creating the Hyper-V, VM, it will prepare the communities. And then if I'm going to verify the cubic is components and enable some of the default add-ons on it. Or after it. You need to check this is working or not. So the stripe Cube CTL get parts and here you will get no sources font in the default namespace. It simply means that our mini cube is working fine. Okay, let me show you one more thing. This is Hyper-V manager would do. And here you will see that virtual machine is running, which is mini cue. And you will find lots of options like connecting the VM to a no shutdown, pause, start, and many more options when a label on that window. You can also find all kinds of options here in the command line as well. I will discuss later on Vuforia, let me SSH this VM. The username for this VM is darker and the password is TC user, okay? It is a default font. You can change later on once you have logged into inter-cell VM. Okay? So this is a mini cube we have now connected to the mini cue VM. Let me see when Mosaic, my username of the VM, which is darker, and it is a current directory where we are just now. So here you can find that Docker is already installed in it. And let me share that keeps you Tuesday are no excuses. Not only Docker Engine is installed on this molecule via, let me exit this view. So this is how many QV on looks like. We will discuss some more details at our mini cube and litter section. So for tin law, keep learning and keep exploring. 7. Deploying and exposing first Pod, understanding Kubernetes YAML files: What's up, guys, welcome back. By now you have learned about the architectural communities as filled, you have created a cluster using mini cube nine. This part, first part, part is simple, a basic unit of, given it is that you need to be deployed into the cluster. Okay? So for it you need to create YAML file. And inside you need to specify Kubernetes deployment objects. There are four basically go to objects. One is API version, other one is kind turbine is metadata. And the fourth funded spec. Let me give you a brief introduction about each of them. First one is a baby version. It specified the API version of the Kubernetes deployment object. There are three kinds of API. One is alpha, one is beta, and the last one is table. You're going to use Table API version throughout the series. Other kind of object is kind. It describes the type of resources to be created. In our case, we're going to deploy apart. So here we will write part inside this kind of section. There are lots of resources and objects which is supported by communities like ConfigMaps, deployment pods, services, replicas, There's replica controller. And much more. By other object is metadata is a set of data to uniquely identify our queue and it is object. So here you will get four important things, like label's name, namespaces, and notations will be there inside this metadata section. And at last, we have spec. Here we're going to declare the desired state and the characteristics of the object we want to have. Suppose if you need to replicas or three replicas. So you need to mention the number of replicas here in the spec section. Then you need to give the selectors because to have a replica set, you need to give the selector option as well. So there it will mask the labeled with that part and it will set the replica for it. And at the last you need to specify the template. This template will be information related to container and 40 formations environment variables which are related to containers. So all the information related to continuous will be here inside the template. So this is all about Kubernetes deployment objects. So now we're going to focus at how you can create our first part file. So inside API Watson and unique to just write v1. And as it is. Apart. So in set kind, you need to write bar and metadata. You need to keep the name of the part and labels namespace annotations as occur. So here I will go into add the name of the part and just going to add a label to this part, okay? And annotations and much more teams will be added and editor on series. Now, you need to specify the container information here. Here we're going to deploy engineer part. So you need to give the name of your image here. Okay, That's right. Container name will be your bot name and image name and genics fallen latest. So what will happen? It will going to pull engine next image and it will be off latest version. Okay, So this is a simple definition YAML file and through Visual going to create our first part. So let's do first, you need to write this command Cube CTL, create half and half and the name of the YAML file. If you want to do some kind of changes after creating the part, then you need to use apply attribute there instead of create. Okay, let me write Cube CTL, get parts. You'll see that the containers are in creating state. Let me have it for for awhile. It will go into create within that 30 to 40 seconds. 4, 3 if you're going to pull that engineers image, and then if we're going to start. So you can find here that our pod is at running state. And here one is Your name of the part. It's steady because there's only one replica. And it is in running stage. And numbers start is like if you're bar is having a problem having an error, it will reboot your part and that number will be refract here. And the age is a time that Homer was time before pod is created. Now I'm going to expose this part to the real-world so that anyone can access this bar. I mean, we're going to expose our part to the outside boy. Okay, so you need to use this ex post command and you need to keep the name of the service. And there are actually three kinds of services which we will discuss in this series when his cluster IP, one is no pole and the turbine is load balancer. So here I'm just going to use node port because this cluster IP is just for internal networking. And this node port and load balance is used to for the communication to the outside world. Okay, so here I will be using NodePort and you can use load balance as well. But here, I'm just going to use node pool, very easy to implement. So you need to write cube Situ, the exposed and the name of fuel part and then name of the service. And you need to specify the port. At last, you need to give that node port, okay? You will find that the service is now created. Okay? Now I will use molecules service command. And this command will only work on a command prompt. With admin privileges. You can run this command without admin privileges. So you need to open that admin portal and you need to run that command. So just simply write many cubes services and the name of the service. So here we're going to see it open that page automatically. So by this way, I expose my part to the outside world. So here you will find the namespace, which is default. Then there's name of your Bot Service and the dagger port, and this is the URL. And this URL is our mini cube IP. Let me show you see the URL IP and the molecules are the same. Hope you understood. In my next lesson, we're going to learn some more topics related to communities, so forth. They'll know, keep learning and keep exploring. 8. Interact with container inside pod: What's up, guys, friends, welcome back. In this lesson, I'm going to show you then how you can interact with a container which are located inside your car. General, we don't have any kinda Bart's hair, no resources found in our default namespace. Now, I'm going to run this command here. My I wanted to show is the name of the deployment and offer as you do this, come on. We had the part with the same name, but at last we have a unique ID at the end. Okay? And then we have, this simply means that if we're going to delete our resource once we just exit from their session. And this hyphen, hyphen TDI by simply means to have an interactive session. And at the last, we put the double hyphen, which means there's end up the QC children command. And at the last we have Bash, which simply override the container CMD. And here we're going to launch the bash containers. Come on. Okay. Once you have login, now let me check the current directory which is routinely and the username is root. Let me install some of the libraries to show you that how I'm working with this. I'm going to show, okay, this is a Container image. Okay, so first of all, you need to update all your APT getting shot of all things like that. And once it is up to date, now you can install other kinds of libraries. For one purpose. I'm just going to install that. Tyler February, okay. This library as a cool every which you'll find in L12 properly system. Okay, let me installs. The name is a comedy, but yeah, it does work. Okay. This right turn it and the text which you want to have to have print in this manner. Okay? So it is a kind of Fiddler which you can use. Okay? So let me do some serious work. Suppose you'll need to install like Bitcoin. Okay, So let me show you that Python is not installed by default. So you need to install the Python. So you simply you to put this equity install and the name Python. It will take two to three minutes and all your jobs will return and you can execute your Python programs here. Okay? So yeah, Python installed on my container at me right by 10. And your inside that Python cell. Okay? Just try print high highs, naught n variables. You need to put it down. And double-quotes, just print hi and they will be higher. Okay? So let me check. First of all, let me existence by 10 shell. And yeah, in this manner than go See, you need to press to exit from that Python cell. And this is the version of the Python which have been shown on my open to container, which is there inside our part. Okay. Let me Cube CTL, get pods. It was fine that our login to show this running. Okay. But do you know at the time while I was creating the deployment, what I did, I put that combine that hyphen item. So I will exit this session and then by default, this part will be deleted. Okay, you don't have any kind of xs to that part. So this container I just built to show you a demo about how you do with interaction between your containers. So it is showing that once you have exit this year pod is deleted and it is not normal running. Now once I will type get parts here, here you will get nothing. So here inside you will get the hazardous Craig one. You get you out of service regarding that container. But now you don't hold that part. So we don't axes at par. But at the beginning, if you don't going to grow at that hyphen item command, then you can use this attach command there. Okay? So, but we don't have, our parts are just not rocking there. Okay. So this is all about that, how you can interact with the containers and so on things. Okay. It was very helpful while doing the debugging things. Okay, so for till now, keep learning and keep exploring. 9. Creating virtual cluster with the help of Namespaces: What's up, guys, Welcome back. Here in this lesson I'm going to talk about namespace. So what does namespace? Namespace is simple, a virtual cluster. Inside your cluster. It allows you to organize your resources, okay? So it is very important to happen in space when there is two or more teams working on the same cluster. Or you want to organize your resources in such a manner like some resources are related to database, some resources edited to monitoring, some orange to it too. Your front-end and back-end and so on things. So it will be very helpful for you so that you can easily check out where you want to do some changes or you want to set things here, okay? So this is the importance of namespace, so obvious in time list, create a simple YAML file. I'll namespace. Here. Again, you would require that hit that same template which are used for creating the simple part. Here you need API Watson kind that metadata spec is not there here. Okay, So let me remove that. Yeah, and one more team. I will going to use the same YAML file which I did earlier for creating a simple part. And just I'm going to add a simple namespace stack there. Okay? So this is my template. Okay, I'm just going to add here for namespace they'd be able to know will be v1. And the kind will be the namespace. Because we're going to create a namespace. Either you can create using newspapers with the help of YAML file, which is the most suitable thing. But if we wanted to create a namespace with our writing, our YAML file, you can simply created using your QC to create command. So it's better to create a namespace or any kind of other resources or objects, given it is with the help of YAML file is very good for you. Okay? So this is simple namespace yaml file. And here inside that metadata, you need to specify the name for your YAML, which is you can put anything, okay? And you need to add the labels. So just write labels. And the labels title. Okay, So this is a simple namespace yaml file. And now I'm going to execute that Cube CTL create happen f and the name of your, your alibis. This F and F means the name of your file. Okay? So just recently, right Cube CTL create half and f. Let me copy this file name from here. A little bit lazy to type the whole name of the file. So this is our YAML file. Okay? This one error and our YAML file. Let me see. It's talking about meditation means pace. Okay, good, We got it. Okay. Here you need to copy the complete table. Only. You need to add that app and leggings. Now let me save this file and it will see automatically this inside you. Bye ciao. Yeah, your namespace is created. Okay, and if you wanted to check the namespace, you can just type Cube CTL gave a short form for namespace. So here we will see there are lots of namespaces are, we're already a river like default and QW, QB system and so on things. And we're going to discuss each of them later on in my section. So let me read this for awhile. So this is our part YAML file, and here I'm just going to put the names pace. Okay? So, so you need to keep in mind that while working with a YAML file, you need to worry about as identification. If you put a wrong adaptations, then it will not going to vote for you. Okay? So this is the name of our namespace. As you can see, it is just be convoluted label section. It will be on the same level. Okay. So here I put her down my namespace here. And yeah, Our first part, the namespace is created. Now let me check that there will be any part or not. You will shop that you created apart. And when you type this command keeps you to get parts and you're part is not their life. So, so you again create your part, but it says that there's bored with the same name. It's already exist. So there you're part is running. Why you will not able to see them. It may explain you because you have created the part. The other names pace. And when you, when you run this command Cube CTL get parts, it only talks about a default namespace. Okay? So let me type the name of the namespace here and here, and here you will see that our pod is running and it also shows the age. Okay? So this is how your namespace works. Okay? So let me describe my namespace and here you will get all your events there, okay. And they will also launch inflammations and you can see them and understand and was all about the namespace. Okay. So I will not go into this. Describe each of them because it is same and did earlier. Okay, so here inside cubes which will get parts, having namespace, the namespace name, you got your part. Okay, Now one more thing I'm going to do here. I'm going to show you that high you can change that current contexts, which is default, or you can say two, which is make you to other contexts, which is our part with namespace, our namespace. So the ones you will type this Cube, CTL get pods. You will get your part there. Where this thing ever do in my next lesson. So stay tuned. 10. Namespace: What's up, guys? Welcome back. Mr. listen, I have shown you that how you can create a namespace and a part with that namespace. So once you did all these things, then use tar that you just have a look how power is forking. And you just had that command kubectl get part and you didn't get your heart. So here I'm just going to show you how you're going to make this possible. Then you're going to ride you CTL get part, and you will get the part. Here. There are five to six visits are already there. Okay. And now what I'm going to do, Just let me show you that, that my part is running or not. This right Cube CTL get parts and use this namespace attribute and the name of your namespace and you got your part. But now that our task is just when you're going to write, use it to get hard and you'll get there. Okay, So now I'm going to use this QC to config mind. Through config command. You can set the context. Because a namespace, when you create a namespace, it will just create a new virtual cluster. And to use their virtual cluster, you need to set the context. Okay? So to learn there's no context for our note, our namespace. So you need to view your config file. This is the configurations of your communities. And here you will find the user's name, our cluster names, and lots of loss information you will find there. So what is our task from here, you just need to pick up the name of your user, which is mini q. Okay? Because at the time while creating a new context for our namespace, you will require the user name. Okay? So just now, you know your, what is your username? Okay, so let me show you. This is our current context, also having the same name, Mini cube. Okay, but now we're going to change. We're going to create a new context within that same using mini cube. And then we will going to use that newly created context through which we can get our parts. Okay? This right cubes you deal with set hyphen context. And here you need to give the name of your context. Just write Bartlett ns apart, but namespace, symbol, name. So there you can edit, can find it. Okay, now let's give the namespace attribute and the name of your part namespace, which is par with the namespace. Copy this, and paste it here. And then you need to specify the name of user. And we already knew which is mini cue and the cluster name as well. Which is again. Let me check it. I will cluster name also having the mini cue namespace showing default. Okay? And because by default we use the default namespace, OK, now we change our namespace to bargain namespace. We need to change this. Okay. I hope you got the thing is I'm explaining. Okay. So yeah, you give it the name of a cluster and given the name of your user, which is mini cue on the both the sides. Now you have created a context. And now you need to use this newly created contests for it. You need to use this use contexts command and offer. You need to write that name. And we are now selected to that newly created context. Now, let me see. This is our current context. Then you'll be cluttered context. And now you will get all your part and just typing the Cube CTL get parts are late, was not there. Now it is. They're just because we do data context and said do that context. So this is all about namespaces. Namespaces, very, very useful thing. And I think that you must use namespace by having a small preserved or you are having a large project. It doesn't matter that what's the size of your project. It's a good habit to use namespace. So for till now, keep learning and keep exploring. 11. Replica controller for High Availability, Load Balancing: What's up, guys, friends, Welcome back. Here in this lesson I'm going to talk about replica controller, replica controller and replica sets. And in the same purpose. But the only difference is the selector. Maybe they'll say it uses a selector and you'll pick controller does it. So here I'm just going to deploy regular controller. And then my next lesson I will talk about replica set. And for the detail things f earlier discussed like replica, replica controller and the deployment. Here. In this, I'm just going to do the practical things, okay? So I will not going to waste a lot of times like again, same, same. Okay, So this is our part. And here I'm just going to ask some of the kings. The first thing which I'm going to change is the kind. Here. The kind will be replica controller, okay? And you know, that replica, we're going to replicate our parks. So you need to give the template for your container. Okay? So inside your controller, you need to give template for your partner, okay? And inside that container runs. So I'm going to copy this and paste it here. So it is a tampered on our part. It is the same thing. Okay. Which we did earlier. That downside from the spec, we having the same things which you will require to execute a simple part. Okay. We had the containers, we have the labels, metadata and alkynes. But you don't hold that API was in, which is already defined. And the kind, because it is a replica controller. So you don't need to provide the kind there. Okay? So here you will see that there are two spec. Once pig is dedicated to replica controller, okay? And once big is therefore o part. And to be exact, for the container which we're going to run inside the part token. So don't be confused. Okay, so the temperature does seem that API was unkind. Then there is metadata and use pick. And here what is happening? That replicable replica set controller will going to replicate the parts. So inside the means you need to give the Bot Details, okay? So you have to provide all these things inside your campaign. So this is very, very basic YAML file to create our replica controller. Previously it was used, but now we have a replica sets. So we prefer Africa sales or repeal controller. But this irony that in the next lesson where I will describing your Branca said, then I will say the same thing, but the, I will say replicas. We need to use your deployment or efficacy. Okay, so leave this apart. This replica set and replica can coolers are the same things. And when you deploy the applications, you have to do some kinds of days and rollbacks wanting for it, you need to use that deployment. But if you don't have sustained this user PSA to replicate controller, okay, so you see there's no replica going to row by default nurses. And we don't have any kind of parts there. Okay, so now I'm going to execute this command Cube CTL create hyphen F, and the name of our YAML file. Copy this YAML and here. And here, I'm just putting it on the tree. Africa's, so what will happen? It will going to create three replicas form a part. As you can see, that it is creating the container and one container is already there in both the parts notebook. All three of the parts are running. Okay? So in this way, I have feed it our replica controller. Let me delete one of my part and see how our replica controller works. So we have deleted one of the part. Okay, it will take a second to delete apart. Okay, so our pod is deleted a data faster. Okay. So you can see that we have another part, the ages 9, second year, and this shows the height of the services. That's why we used Africa. Okay? So this is the major purpose of using replica. And other thing for which you need to use. Our replica is like when is higher rupee, okay? And other one is like load balancing. Suppose you have three parts, so the load will be across the three parts and you want to scale, you can easily scale up your replicas as well. Okay? So this is all about our replicas replica controller. Okay? 12. ReplicaSet using YAML: What's up, guys, Welcome back. Here in this part we're going to discuss about replica set. Reversely. We have seen replica controller and use cases and they wanted to just insert the same thing. All the things which I told him adequately center, we're going to apply here as well. And here the only difference is the selector. Actually ReplicaSet will replicate that part only which attached to it. Okay, here in the definition of ReplicaSet and just providing the selectors for names app. So the part having the ligands will replicate. But in case of bigger controller, all of the resources which are level going to replicate here only am just giving the selector information and that targeted BOD will be duplicated. So let me execute this replica set YAML file, and you'll see the same thing. Okay? So, but it's a part of the communities you must nerve or controller represents serves as the less deployment. And there are much more options available. Diamond says, jobs. Your bare parts. Are this or that options are available, but they have other kinds of use cases, okay? What refer matters is deployment. And it is very important to know that the controller by dealing with deployment. Okay, so let me execute this command here because set YAML and our replicas, there's error created. Now you'll find that inside part. On, inside RS you will get that your professor. And inside parts, you will get your bots. So these are the liters one, okay? The all are running right now. So this is rapid test set, okay? Now I'm going to delete one of the part as it will also do the same job and shifted up and color does if you're going to replicate that. Okay? So this is how replica orcs and cloud computing and other stuffs. The thing is, the application should provide high quality and must have the load balancing option. So these two miserably requirement will be fulfilled by using the replicas, okay? And q, and it is only used to deploy, is a container orchestration. So it is a part of humanity's. Each time whenever you going to create. It will have the same name. The part has the replica set name, and at last it will have the unique ID. Do I didn't find that part. Okay, now I'm going to delete that. Delete what you've begun secondly, so all the parts which were for their MLU deleted as well. Okay, So now I will check on, so I'm going to delete for Replica control as well. So now we don't hold any kind of parts that for sure you out That's right. Gives you to get parts and you will find that they all are terminating state. Okay. So there are different tiers are there in the park Like when you create the container. And then if you're running an actual group terminate in between their two most taste. But I don't insert we're going to discuss because most of the time we only see this. And if the container is having some kind of problem, you will see adder and cashback have this tool. Shares will be there. But generally we don't have to see them. We just see the containers creating and it's running. At last. It is. When you delegate the power, it will add communities cheat. So this is the running state out the parts. So this is all about replicas. And in my next lesson, we will be discussing about deployment is 14. They'll keep learning and keep exploring. 13. Deployment: What's up, guys, friends, welcome back. In this lesson, we're going to talk about the climates. Earlier, we have discussed replica sets and represent controller with the help of them, we can easily as calles, our part is Lee as well as it gives the oral high avidity. So now in this part, we will be discussing about deployment. When you look at the YAML file or deployment and the YAML file for replicas said, you can't figure out the difference. Okay? But here, when we deploy the replicas, set or control the weather. So it was going to create the parts. Okay. But in case of deployment, when you deployed, it will not create the parts directly. It will create the replica set first, okay? And after it, we're going to create the parts. Okay? So suppose if you want to do some kind of updates into your deployment, so it will going to change. The replicas says accordingly, and parts will be created with the new replica sets. So the really interesting thing, right? The appears Cool be like you want to change the image or lookup. We want to change some parameters through command line arguments and so on. So when you're going to obtain it, the part specification, the deployment, we're going to create a new replica set with that updated palm specification. And the replica set which were created earlier will be deleted and new replica set will be tailored with the new part specifications. So this is how deployment works, okay, here in the gamified, I just did not do changes like one kind. And you need to write the department and in metadata, git chain in the knee. Okay. So by default when you see on my dashboard like there's no parts, There's no replica sets, and there's 20 province. Okay. So but when we're going to create this department, then if we're going to create the part, we're going to create a replica set and we're going to further progress. Okay? So how it looks like, let me show you see parts is creating right away and here the replica set curve and it is going to be complete. Now, see, our efficacy is also ready and I will do form is also ready. So in this manner, department books. Okay. And last thing is it also creates a service as well, okay, while creating the deployment. So this is all about deployment and professors. In my next lesson, we will do some kind of scaling and do some kind of updates into the deployment so far till now, keep learning and keep exploring. 14. High Availability & Load Balancing: What's up, guys, Welcome back. This Communities provides self healing power to your application. It simply means that it will going to give the of higher loyalty of the application. Suppose you have created three parts and due to some reason, you're one of the part is not responding. Are it is deleted by mistake, then this will going to create another part of seeing competition. Let me show you. As you can see, that we have already deployed replica controller. And with total three applicants. And now I'm going to delete one of the part which are there right now. And once you have ability to part and range, we'll check it that you will find three points is running. Just because of self-healing every 50, it created a new part with the same configuration. So this is how, given it is folks. And this is the, one of the features of a given age. 15. Scaling Up/ Scaling Down: What's up, guys, Welcome back. In my brothers and I have shown you how you can create the deployment. Here. Our task is to scale up and scale down with respect to u to that load. Okay? So the first thing, either there's two options to scale up into primer was killed on your deployment. One is in the YAML file. You can change the number of replicas. If we want to increase, you can increase the value. Or if you wanted to crease, you can decrease the value. But the best way is to use this Cube CTL scale command. Here you need to write Cube CTL, KD and deployment, and the name of your department and with the numbers, to what extent you want to replicate your part. So here I have replicated my power from three to ten. Okay? So it will take time to create new cards with the same congregation which we have already provided. So as you can see, five order tens are ready right now. Okay. Now I just 789 and I think within a second we will have Yeah. Now we have then replicas of engine next part. Okay, So in this way I simply is Caleb my engine next part with respect to meet the load and graphic, ok. Now, if you want to scale down, you can just simply as good the same command instead are 10, this but don't 2, which is less than 3. Because earlier there was three replicas. Now I'm down to, so no, it will going to scale down. And there will be only two parts of labor. So this is the one of the features our community, which is scaling up and scaling down. Okay, hope you understood. And in my next lesson we're going to focus on how you can do autoscaling, okay, so forth till now, keep learning and keep exploring. 16. Autoscaling: What's up, guys, Welcome back. In this part I'm going to talk about auto-scaling feature, which is provided by kill any D's humanities or as a series of features to ensure that your cluster have the right size to handle any kind of load, whether it's high or low. Okay, so here in this part we're going to talk about auto-scaling feature. There are two types, so autoscaling, one is horizontal and other one is watercolor. In horizontal. What do we do? Either we add or remove bars or add or remove nodes. But in the vertical scaling, we actually modify the CPU RAM resources allocated to that part or NADH. Okay? So these are the things you must know the Dart and proceed to give the practical on Autoscaler, you must know about horizontal scaling as well as vertical scaling. Horizontal Pod Autoscaler. These visits, I'm going to show you the demonstration how you can put Horizontal Pod Autoscaler. In short. You have listened a lot of time Horizontal Pod Autoscaler. So here we're going to do it. We're going to scale a number of parts which w in the cluster to handle the current commutation or workload. Okay, earlier in my previous lesson, I have shown you that how you can use the scale command to scale up and scale down your resources. Okay? But here what we are going to happen and the autoscaler, it will see tit-for-tat CPU utilization, memory utilization, and accordingly, it will going to increase the parts or decrease the cars if they're able to be a high computation or matter Utilization, then of course, if we're going to create a new parts, could deal with that heavy load. But in case you have already ten parts is there, but it is very, very low CPU delegations that this is all free resources. So here, again, Autoscaler constitute the picture. It will go into, decrease the number of parts even it can gives to one as well. Okay, So this is a feature of Horizontal Pod Autoscaler. And this checks continuously the CPU and the memory metrics, which is generated by a macro server, which you need to add on this matric server. Okay? And I will going to show you that how you can put this metric server. Okay? So another kind of vertical part, autoscaler. And here you need to use that VP recommender. Okay? But here in this lesson I'm just going to talk about SBA Horizontal Pod Autoscaler. Okay. So let's do it. To check the CPU utilization or Mallory, you need to use this come on top, gives each a dog. It will going to keep the current status of your resources. Okay, so now what do you do? You need to use this command to check the current status of your pod or you're not. Okay, so I'm just going to check my part status is simply write gives each your job board and the name of your part. Okay? Suppose this is my art and I'm going to paste this here. There is an error that metric API is not available. So this is a metric server is talking about metrics server I told you to. Matric server is something which going to give the report of the current status of the parts or notes, do the SBA means Horizontal Pod Autoscaler. So you need to write many q Mini cube add own list. Do see the numbers of G, the number of add-ons available in communities. And if you know already that provides exact name of your add-on, you can simply enable add-on, okay? But in case you have a little bit confusing the name of your ad on, you need to use this combined add-on list. So it will give the list of all the add-ons available. Okay, so here you will find metric server which is currently disabled. So what I'm going to do just write Mini cube add-on enabled this metric server. Okay? It will enable our add-on. As you can see on my screen, There's message. The matter server is enabled now. And here across shaky you can check that it is not enabled. So this is how you can enable add-ons which are daring to you, given a piece, okay? And this metric server is looking at the end to the Kube system namespace. Okay? So if you write QC to get part, you will not going to get that mean that macro server, you need to give the name of your namespace cube system and you will get bars running into that name says John Knox are honest working here. So you simply write namespace, the namespace. So these are current bars which are running under kube system. And here you will see that element is server is running. So I triple cross check actually when I checked on the list, then here one more time. So this is how you can enable the macros API. Now what I'm gonna do, I'm going to autoscale deployment. And here I will give the minimum replicas. And the maximum replicas to deal with the load. Okay? So simply, I'm going to check the current status of my part is showing 0% CPU utilization. Okay? So once I will going to do enable this, autoscaler will do something that it increased the percentage of the par, which is 0 right now. Apart, now, we have to focus on Autoscaler comma. Here you need to write Cube CTL, autoscale. Then you need to give the name of the deployment, which is my deployment. This is just here. Now, you need to give them maximum CPU, MS. Moon, sorry, maximum and minimum cost number, okay? So minimum and a maximum 20. Okay? So it will check continuously with the help of metric server at what is the current status. And accordingly, they will be more load than it, then that part will be 20. If less load tanker, then. Okay. Now I'm just going to put the CPU percent if I did see, Okay. Okay. Okay. So we need to do something with the part so that its percentage of CPU increased from 0 to one. Okay? The best way is to have an interactive shell, okay? You need to interact with the bot. Here, this is shell of my first part. Okay? So let me download something here. The CPU utilization may be increase, will fully, I think there will be change in the person teach. And it is before it was 0. Now it is having some kind of numbers. Okay? Now, let me shake the box and it's great. Firstly, there was a 20 parts, but to deal with the load, this is five-person right now. So it increased the number of parts to 10. Okay, So this is how XP works, okay? So hope you understand and how you can enable this auto-scaling feature into you. It is deployment is very helpful. It saves a lot of time, local resources as money as. Okay. So this is all about deployment orcas killer. Keep learning and keep exploring. 17. Easy update and quick rollback: What's up, guys, Welcome back. Here in this part I'm going to talk about different kinds of deployments, credit Gs. As you know, there are various deployment strategies, but among them, rolling update and recreate strategy as the most use deployment package you go, I'm going to talk about rolling strategy, okay? But before it, let me show you that how you can restart you all of the parts tolerate you just, you have to run this command helps you to rollout, restart and your deployment name. As you can see on my screen, that some of the parts are now restarted and there is an seconds. Okay? So here when it will then type UBC to really get deploy, you will get the numbers apart which are ready. Okay? So this is how you can restart all your parts using just a simple command. Okay, so now I'm going to do, I'm going to apply roll-out strategy. Here. What we are going to happen in rhode, our strategy, which is basically that default strategy to update running version of your app. Here, the rolling update cycles previous part out and brings new part incrementally. Okay? It will not going to shut down every part at funds do in a cycle, okay? It will take to Ford's and restart them, and then it will create a new part in place of that Allport. And similarly, if we are going to increase, okay. So now what I'm going to, I'm just going to change the image name of my current deployment from leggings into a town kid, another kind of server. Okay. So you can either use cubes you to apply, come one to apply. All the changes are, it's very simple that simply run this command keeps your deal aged and deployment name. And Diana file will be open N here. From here you can do the changes. As in this YAML file. There you will find only one against. Okay, let me see again. And I wanted to replace it with Tomcat 0. Only one appearances there. Okay, so let me replace all of them. So this is a YAML file for our deployment and I did some changes. And here you will find that V0 deployment yaml file is ejected. Now I'm going to execute this command. Cube CTL. Describe deployment to check that the image name has been changed or not. It last few, describe me, get all your events. And here you can see. My name is Don cat ligase. Okay. Now let's check the current teachers that although the bars which were already earlier have updated or not. Okay, so far aid you need to use this command Cube CTL. We know this right, gives you general lost status and then name of the deployment. And it will say is that all of your bars has been rolled out. Okay, and you can see that all the edges are showing the second suggestion. They're updated recently. Now let's try it gives you two to get deploy and get the up-to-date. Then barks, OK, and then archer of levels also. Now This is my covenant is dashboard. And here I'm going to double-check that the parts which are running at our DOM, good or not. You can see clearly on the name that it is Ugandan care. Okay. So this is how you can simply update your deployment with the help of ruling Update matter. If you want to put that recreates strategy, you need to write inside the deployment YAML that strategy colon recreate. Okay, So as meantime, I updated my deployment. You will see that new replica sets for generated for each of them. Now, what I'm going do, I'm fond to roll back my deployment to the older version. And in the history section you will get the older version deployment file. So now I'm going to use the undo command. It's right Cube CTL, rollout, undo, and the name of your deployment, your deployment has been under, which simply means you're not changed your image into your older version, which is negative. Now, let me check. Okay. I obtain bars were not ready yet. There's fire in my dashboard dispersed, not showing status. So it will take a time. All of my parts are rolled out. Let me use this, get parts. And all my parts are updated recently. And that represents is also updated. This fun. Okay, My older ReplicaSet is now active. Now inside that q and it is dashboard. That means a cube into the cell. Here. You can see that earlier it was Tom cat 0, 10. But now it is a totally different. That simply means we have successfully roll back our deployment. So this is how with the help of communities, you can easily roll back and roll out your deployment. Simply, easy update and quick roll back. Okay. So hope you understood about Q and a. D is another wonderful future. So far, does not keep learning and keep moving ahead.