Kubernetes - The definitive guide | D谩niel Ern艖 Szab贸 | Skillshare

Playback Speed


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

Kubernetes - The definitive guide

teacher avatar D谩niel Ern艖 Szab贸, Pythonista in the making

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

14 Lessons (1h 42m)
    • 1. Kubernetes Intro

      1:49
    • 2. Kubernetes Environment & Docker

      5:37
    • 3. Kubernetes Python & Docker smaller

      20:26
    • 4. Kubernetes Docker tips n tricks

      5:28
    • 5. Kubernetes Minikube install

      9:28
    • 6. Kubernetes Docker custom bridge

      5:24
    • 7. Kubernetes Pods and Services

      12:21
    • 8. Kubernetes ReplicaSet and HA

      6:21
    • 9. Kubernetes Deployments

      7:53
    • 10. Kubernetes Kibana and elastic

      6:08
    • 11. Kubernetes Pushing container logs

      7:45
    • 12. Kubernetes Python app for logging

      5:36
    • 13. Kubernetes Forwarding Python app logs

      5:42
    • 14. Kubernetes Outro

      2:17
  • --
  • 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.

28

Students

--

Projects

About This Class

Hello,

Welcome to my course on kubernetes and DevOps, this is a wonderful opportunity for you to pick up speed in one of the fastest evolving subjects of IT. This course will help you get familiar with DevOps concepts. We will first configure our Docker machine, do build and run docker containers, then we turn our sight towards Kubernetes. We will build our test environment with the help of Minikube. Deploy our Pods, Services, ReplicaSets and Deployments. As an ending we will create an ELKF stack to collect logs from our containers and I'm going to show you how to index a standalone python application.

Check out the supporting github repository in the links for the resources.

https://github.com/r3ap3rpy/containerrealm

Let's get started!

Cheers,

Daniel

Meet Your Teacher

Teacher Profile Image

D谩niel Ern艖 Szab贸

Pythonista in the making

Teacher

Hello, I'm Dániel Ernő.

I currently work as a devops engineer. I have several years of experience with various platforms and I'm here to teach some advanced techniques which may attribute your job security ;)

Cheers,

Daniel

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. Kubernetes Intro: Hello there and welcome to my course on Cuban. It's so carbonates is a container ization platform and it's ah, kind of popular at the moment. And the discourse is intended to show you how you can take your doctor knowledge that a next level in this course we are going toe start out with a little bit of docker introduction, we are going to create a new image for ourselves, which is going to be a pilot on Web application. And then we are going to see how we can take that container to the next level, so create, ah, high availability to deployment in multiple ports and so on. So we are going to start out with some doctor installation. After that is done, we are going to see what the doctor hub is able to provide us. We will see how we can push images to our own account and then later in time, reuse it. Then we are going to take a look at how we can install and utilize many cube on our platform, and this whole course is supported by get hub represent Torrey, where you will be able to find answers to your questions that may arise. Why watching this course? So if you have plans to take 2020 to the next level and improve your let's a job security them, I I strongly encourage you to do investing yourself and learn something you seen in the next one. 2. Kubernetes Environment & Docker: Hello there. And welcome back in the city, we are going to take a look at the prerequisites that I needed. So we're going to need to Virtual machines you can use were to a box Camel gave e m or be a member station for your sick. But ah, we would like to have a machine which is our doctor machine. And we would like to have a machine which is a bit more powerful. That is going to be our Minnick. You were carbonates machine. So now I'm going to use Santos virtual machines. I think the 7.6 is installed so you can grab the latest installer creator basic installation and then just seem to use it. What you may also want to be a rare off is that I have set up my richer machines so that they have static I p addresses. They are able to reach the internet. So we have two years to ah networks. One is the B m. That one and the other. Isn't that so? On the William that one. Ah, we have this ah, host on the network, so to speak. And the net provides Internet access and Ah, this is for the Ducker from thinners. This has two weeks of RAM and two were Tracee pews with 20 gig storage. And I have ah, bit more powerful machine which has eight gigs frame and eight course. So the demonstration doesn't take too long. Two rum. So I mean, if you do not have, the resource is so I have ah, pretty powerful machine with tohave course and 32 gigs a friend. But you should be able to make do with two course and four gigs of From a Swell. So let's ah first installed docker on these machines. So I would like to boot off my system and then simply go and start my cause our emulator. So I'm using the commander consul emulator. And once the center s A is available, I should be able to ss age into it. And once we are in, we should be able tow, install docker. So in the city where we are going to install Docker and in order to do that, we need to execute this in root privileges. And I think I am styled the password, so yeah, and ah, you will find this command in the get have repository. But basically it's called com ump which will be piped to the shell. And this is going to take care off the basic doctor installation. And on this installation completes we need to be Eva will make sure that the Docker demon is starting up automatically when the rebuilt a cures. And we would like toa odd our user which in our case is the user and Zebo to the Docker Group. So it is able to execute Dr Commands without the root privileges. So yeah, basically that was it. So system CTL enable Docker And we would like Toa starting Docker And we would like to use user more Dash A she Docker and cyber command And then we need to exit and look in once again So these changes take effect. And if we have successfully logging without known throughout user, we should be about issued docker ps common And that's all almost so. The second thing that you need to do in order to follow along this course is to create docker hub account. So this doctor have account is ah nice thing to have because the lungs you to have unlimited free repositories, which our public to everyone and one private repositories. So if you have something that you not do not want to share with the the public, then you can upload here those containers as well, as long as it fits into one repository. So basically, you need to register here and then under the my content, you will be able to see which whatever public or private repositories you have and the technically this was all I wanted to show you in this video. Thanks for watching. 3. Kubernetes Python & Docker smaller: welcome back. So now since we have our doctor instance configured, what we should be doing is that first we are going to create the Python application, which criers the fight on version three. So, in order to install from the source fight on version three, we need to perform some additional steps and these additional steps are going to be mentioned in the ghetto Fab Repository. So basically, we would like to grouping started development to us and then in star some that finances enoughto that we would like to get to fight on 3.7 installer. And once this is done, we need to extract it. Then CD into directory issued. The configure a neighbor hold Mimi is a shows, and once this is done, we need to issue the make audience Starcom, that will take care off installing this. That's a compiled version off. Fight on to our environment so that we can use the pipe of 3.7 execute viable, so make All star. And then after this is completed, we should be able to create our fight on Web application that we are going to later utilize in our Cuban its environment. So For now, what we would like to do is to create on, have application, test it out if it's working, then push it to our Dr Repository and create a few versions of it so that we can that wants straight the let's say, different types of deployments that carbonates allows us to dio. And as a plus, we're going to also see and scores what we need to do to collect logs from the docker containers and push it to ah Kibwana Elastic Stir Church. And, uh, I cannot record a name, but by the time we can we get to the part of the course. The other flew Andy so fluently is going to be the one that's collecting our logs, so it should be done in any mean it. Well, after that, we will need to update the alternatives. So now we are combining great. So now we should on the the alternatives on and we should be good to go. So happy just takes it and issued a fighter 3.7. Great. Now what we can do is to create a bite on Web app directory and here we should create an app that p Why so the sub The P y. Is going to be the heart off our application, and this is really ah, simple flask based Web application, and we would like to create map, which is flask. Dunder Score Name said. Underscore me is double underscore and empty that drought. And we would like to have default context route with the index function, and we just simply return the version one off the And if the name is equal to Main, then we would like to have the yep bathroom. And we would like to listen on every interface off this also the i p address. Zero The tear that 00 and the port his 8 80 and the bug it waas True. Great. Now what? We would like to do this issue the peat bite of 3%. That's the less great. So it gave us the permission denied, but that's OK, so fight on 3.7, the sham peeping stall flask. Great. Now we do not have permission the night, And if you shoot the fight on 3.7 AP the B y. We have a syntax error because this needs to be indeed by a common. But we also have another syntax era that needs to be fixed. Now our application is ready to run. So left me grab a browser. And here if he should STD b scent of a say 80 80 then after turning off the fire war. So system CDO stop fire or the as of ah, Then we should rerun this application and see that the version one off the application is here. Now what we need to do is to create a docker five. So how do we create the doctor fire? So that could file Is the heart off the custom images that you can create? And what we would like to do is to issue from by thumb three. And we would like to add ab the B y and the dot means in the current directory, you like to run the paper and Stoff last, and then our common line is going to be an array. And the survey is going to hold the pie, Tom and the Yeah, that be you, I And if you save it, you should be able to build the image. So how do we build this image? We can be of the signage by issuing the following. Ah, let's say come on. So docker Beeld that t and repurpose I forward slash by thumb where? But call on V one and the death eso Now it is going to go out and pull down the specifically layers and these layers are going to be necessary for the pytorch three basing each and then it is going to could be our application and then ah, after issued a run command, it is going to simply start the container. It's so Pape install Flask is now running. And, uh, after this is done, we should be able to run the image as it was intended to be. Run Andi, New connection fe the year What soaping Google not come. And no, we would like the appealed Why is it timing out? Let me restart this machine because it was not restarted since we started the scores. So being Santo say so in the background You can see that this machine is now booting up Great! Now we can assess age into the center same machine and then we should issued sido so and C system CTL stuff firewall d and then and I don't know about. And they should. Docker Beard, Come on. So once this is done, we should be able to see what this has offer. So basically, this flask installed, and then we should be able to run our application itself. So temporary failure in name resolution. Okay, So Sudo su or let's just go back here. So Santo See, this is why it's good to have goings. Alexis still Veenstra machine. So now you would like to re activate these and try once again and it's still not working. So sometimes you may face a similar issue when you have, let's say, a problem with the building discussed, um, image. And, um, to be honest, I'm not sure if it's the problem off the virtual ization platform or something deeper. So I have these two connections and one night in the 168 56 one and this one is auto magical pink goo world. Com Then ping that come. We should be able to build this image if it's not working and then this is going to be a part two off this video. So yes, this will be so sometimes my machine likes to play the fool with me. So basically, after restarting the laptop, I have just starting the richer machine as well. It seems that the Beeld is now working. So Ah, how should I put this? Maybe should start your whole system after this was completed. But now we have the means. So if you should the docker images We see that we have a base image downloaded with vital. And we have the custom image, which is the pipe and web up itself. So now, in order to run this, we need to issue the Dashti the Speed 8 80 a 83 per pie fight on where but V one and the Docker PS gives us the following output. Hmm. What so vital? 3.7 at the B y. It is running, and the docker doesn't seems to be able to start it. Mm. What? So me have build the Pitre? Yeah, man. Then we would like to run and it says that this was not found, so he eye doctor five and we would like to have the that for slash at that Bu I Mm. Ah, sorry. So now it seems that we are required to use double courts, but I'm not sure about that. Oh, boy. Now it's running. So, Dashti, Dr P s. And here we should be able to run our Santo s application and get back response as well. So basically this this is it. And what we can do now is to push this image to our repository. And ah, we would like the push after the Doctor Logan on. And here we would like to use the doctor lugging itself and then docker Bush. And we would like to push the reaper pie by Tom Web B you want great. And after this Bush is complete. We should be able to lugging to our docker hub. And after looking into the Doctor Hap we should be able to see under the My content was the push is complete that Ah, we have, despite the web up a repository. So we have the we w one. So now we would like to modify that the p y to return the version two and we would like to build this image with version two. And after beer this complete, we would like toa push the veto image as well. And after this was done. So we are using the build than the docker image. Push with the appropriate tag And as you can see, the rush some layers which already exists. So that is going to be ignored. And we would like Toa create a version three off this application that saved let's ah ability with the three and then we would like to push it with we three as well. So these layers already exists and the rest is pushed. So now if you go back to a doctor hub to the appropriate repository So as you can see it so long, we only have version one. Now we a version two and version three as well. So if issued Docker images than Dr P s and we let's just just give it the test run so wrong and we would like the 81 to V two and eight to to the V three. And if you go back here, you can see that under 80 is listening for diversion one. The 81 is the version two and the 82 is the version of three Elvis applications. So basically we have now three different images with different versions of the application . So this is a very simple example. But this will be the foundation to demonstrate what Cuban it's has to offer to us, so see you in the next. 4. Kubernetes Docker tips n tricks: load at her and the work come back. So in this video, we're going to take a look at some tapes and trace that you can use to manipulate your docker containers. So basically, the steps and tricks include some comments. So with the docker PS, you will get the list off your running containers, and these running containers will give you information as toe. What is the container I d watches? What is image that is running and you may not see it, but on the dope port top, right where my camera images newest or let me just pull it. Yeah, So, uh, here, USC what The port. This is map toe and you will see Ah, let's a funny name that is going to be the name off your container. But this is that all I wanted to show you. So basically, what we can also do is inspect our containers. So, for example, if you go the lock, Ducker logs and we say that we would like to get the log for the container which has this image, I d. Then, as you can see, we will have every single log that was done to this container. So, for example, I have chosen the rebel free to And if they go and open another window and then just simply say that Santo s a 80 81 This is the V two man. If I say that can't touch this, it says not found. So now we should see 204 04 response as well and their ego. So basically, this allows you to inspect the container and the looks that it emits during its execution. So we can also say that we would like to docker inspect and specify in the majority. And here we can inspect the container as it is, let's say a Jason form and here we will be able to see that when this container was created , When what is the past watered arguments? What is the horse name, path and swarm? And basically, this gives us a very detailed information as to what this environment looks like inside the container. We can also say that we would like to have the Docker port and say that the image Oh boys, that's grab an image I d and 22. So as you can see that the TCP 22 is not published. But if you go back to the 80 80 it says that this is mopped to the 80 81 port. So basically, the report image and port allows you to check if there is a specific port exposed to the public. What we can also check He's the doctor, his story, and check the history off the specific image. So in our case, we need to specify the pi toe web up V two. And here you will see whatever history off this images. So what kind of factions were performed and when they were performed and so on? And then what you can do also is too. Check the or not Jag. But simply say that you would like to docker pose and say that you would like to pause this image. And now the doctor PS produces us this output so you can see that this image was posed and we can unp owes it. And now we can see that this image is continuing to serve these Ah, let's say requests and we can also check where the Ducker environment lifts. But Dusty's for another radio. So this was all I want to show you in this video. See you in the next time 5. Kubernetes Minikube install: welcome back. So now we have our doctor platform configured. We have our docker images pushed the car hap So now what we would like to do is to configure our Minnick you or carbonates machine. So, for example, here, as I have mentioned before Ah, under the center a c I have 8% sir course and eighties fram. So under edit virtual machines, what I would like to do under process source is to any Burgess v actualization. And ah, I owe memory management unit. If this is a neighborhood, we can start up our virtual machine. And once this has booted, we can start and configure our machine. So for this, I'm going to start up Michael's old hold on. By the time this machine has booted, I should be able to see it. So now we have a Logan and here we would like to log in. We are s a sage to configure this machine. So now we would like to issue this command. So Sudo Su And then this is a car command that is going down on the script which is going to be mine. Many cube, then we would like to move this to the user locker being so that we can refer to it as my mini cube. And in order to do that, we need to change the permissions. So we would like to sign on, execute herbal permission every everyone so user group other and the here. If he issued a mini and enter tab, you will see that this is not up completed. So in other words, if we go like l s l A, he will see that we have said the permissions that anyone can execute this go around. So now what we would also like to do is tow download the Cube City. Yeah, and this keeps CTL is ah off. Ah, kind of a big size. But after this is downloaded, we would like to do the same thing. So move it to the user local bin, and then change the permissions. No, we have the cube cdr common as well. Now what? We also need to do this thing star some dependencies. So this dependency is the camera leave reared and other stuff which is necessary for this to work. And after this installation is complete, we need toe a neighbor and start the livia to the service. It's af so let's wait for it to complete. So seize them. Setia A neighbor lib veered the and start this one as well. And we would like the ardour current user the deliberate the And after this was done, we can issue the mini Cube start Calmund and it is going to download Ah a V a chair machine and configure it and so on. And after this now Lord is complete. We should be able to Okay, so let's get back to a sausage and issued many cube start command. Um, it doesn't allow us to do this, so sido shut them are zero So sometimes, Ah, depending on your sentence machine, you you will need to restart this whole installation itself. But after it was installed and configured properly, you should be able to log in to this and start your mini cube installation Ping Sando s e And let's say it Santo a c meanie You start so revered socket unable out in decades sido soon and many cube start and it says that it should not be used its root privileges. So I I think that common there waas misplaced so sido And now we are unable to find this many cube. They start great So you should not issue the user Maat commander with the pseudo I mean when you are rich user, you should sido and issue that command. But after this is done, we should have working. Ah, many cube environment. So let's wait for it to complete. And after death, we should be able t she would, uh Minnick, you've status and the cube cdr get or command And we are going to close this video with the put off those two commands themselves So preparing Cuban AIDS on Docker Great, We are almost there on And then then then Well, we are getting there, by the way. Ah, so as you can see, I'm using this commander concert emulator. So Cmdr clones on Emma later and you can download it from this page. So I suggest you download the full installation, extract it and just simply executed. So if you are not executing it with the administrator on in this before you get some arrows but apart from that, it should be a feasible and working solution for you and eso the mini keep start is only going to start this instance after the U issued a comment So it doesn't imply any kind of service like restart after urea machine is revolted. So every time you restart its virtual machine, you need to start the mini cube instance that you have so many cube status. As you can see, we have everything up and running and we can assure that cubes Ethio Yeah, or and now, as you can see, we have a working many cube installation and this is or I wanted to show you this you to you in the next 6. Kubernetes Docker custom bridge: welcome back in the city or we are going to talk about how Dr Networking works. So basically, when we go back toe my previous example So if we issued the docker Ron Rash deed SP 8 80 80 Reaper pie by phone, Web version one. Then after this docker image start, we can use the docker exact command to get an interactive shell inside our container. And basically, if you should i p address show common. We will see that this net for is the f M zero in six. And this is the I P network that this is using. So what happens when you would like to customise it or say that you would like to use a different networking with different, some mask and so on? So this video is going to be about that topic. So let's kill this container in order to do that. What we would like to do is to enter privilege month and first install the bridge you deals subregion beauties provides us with the br CTR command. Let me stop my firewall day and what we would like to do No. If so, basically create a custom bridge for ourselves So first we need to stop the Docker demon. And then we would like to issue the I P. Link set Dev Dr Zero down. But first a i p other show. So here you can see we have this bridge that is providing I p addresses from this submit range. And we would like to change this. Um, every line of distribution is a little bit different, but the concept is the same. So we would like to create a new bridge. And then dad Doc, a demon to youth, that bridge instead of the default. So hi, Peeling set, Dev Dr Zero down. And we would like to odd bridge our custom bridge. And we would like toa odd an i p address from 1 92 168 That zero that one slash 24 And the device is bridge zero. Or that's call it custom. And we would like to ah use the appealing said that custom up And we would like to use the br CTL the bridge docker zero Now if issued I p address show common, you will see that the doctor zero is gone and we have this I p address So now we need to customize the etc Docker, the imam that Jason. And here we would like Toa create Jason fire. And it's just a fire. Hold the bridge and the custom. So this does Docker demon to use discussed this bridge which is called custom Now we need to start the Docker demon. And once this was started, we can go and run our container. Where is it? Where is it? Okay, Backer Ron Dashti That should be 80 83 per pie by phone Web version one. And after we docker exact into the container, we should see that the I P address show gives us a different I p Every i p address from a difference that we have just go for your and basically we're happy with this. So now you can see that this doctor zero is still created once the services are. But we are using this custom and technically that was all Thank you for watching 7. Kubernetes Pods and Services: we'll come back in this video. We are going to take our many cube or carbonates environment for a test drive. So basically, in the previous videos, you got to learn how you can create your own custom backer images. How you can let's see, apply tags to separate different versions and push them to the doctor repository, which could be your single source of truth and your version ing system. But basically, what do you like to do here, Mr Apply more advanced concepts to that. So, first in this video, we are going to create a port and the service. So the port is basically the container or atomic version off execution that is running, and the service, which serves as an abstraction, is going to allow you to detach the port from the user interactions so the users will interact with the service and points and the service and points for your service, A proxy against the ports. Let me basically show you what I mean by this. So we would like to go to our the stop. So I'm using the center s E machine with eight cores, and they've use of ram and song and we would like to create directory, which is called Huber Needs. And after navigating to this directory, we would like to creator board that Yemma So Yemma stands for yet another markup language, which is I think it's pretty funny acronym, But this is really a powerful concept. So Yemen is used with when you're working with answerable and other frameworks that make develops engine, it's lives easier. So currently we would like to define our port and let me see if I can make this uh huh, a little bit bigger. Yeah. So here we have this text size toe 30 or 40 15 16 and let me check my recording. So now it should be visible, but you may need goggles to see this. So what we would like to do is to define our port. So in the port definition, we need define on a P I version, which is going to be re one. And, um, everything I do and every knowledge I have comes from this side. So this is the go to place. If you are working with Cuban, it's and this allows you to understand the basics of Cuban. It's if you are that kind off document reading guy or girl that wants to say that. Okay, I thought the scores, but But I need more information. So this is the place I go and this is the place you should go. This is going to be linked in the course repository on Get up. So we have a napi I version off one version one, and our kind is going to be put. What we would like to do is to specify Method E and this weather data is going to come from a name which is Web, and we would like to have labels. And this Labour's is going to come from EP Golan web. So these labors and metadata are important because you have different select or swing your defining services. And those selectors apply a fear third toe these method eight hours that are defined on the ports and they will know with services connect which parts. So that's kind of the story behind that. But now we can create the spec so this back will say that we have containers and these containers have a name which is called Web, and we would like to have an image and this image is going to be repurposed. I But I thought on Web calling V one and we would also like to have ports and the pores that are exposed Our container port and we were used 8 80 So this is kind of similar to what you would write in Docker. So docker, um Dash deed SP 8 88 80 and Reaper Pie Python Web call on V one, baby. Physically, we almost wrote the same thing. Difference will come when we apply this to our environment. So in order to apply it, we need to issue the mini cube start. So every restart, the doesn't imply an automatically start off the cabinets or Munich you be environment. And the reason for this is that this kind of a power hungry port process. So it is currently using the K B M re actualization, and it is going to start the existing K V M retrial machine and it takes some time to boot . But after this node waas provisioned properly, we will be able to apply this sport. So after applying the sport, we're going to inspect what you can do and how you can do it with your mini cube installation. So how you can reach it, How you can gather information. So we are waiting. And as you can see, we have these this funny icons. So this is for the docker. So this is a whale or something like, this is the rocket. This is the lamp. This is a smiley and so on. So if you have a window schools all it might not look the same way. But basically after this was done and it working plot properly, you can have a mini cube state this so this gives you back that the horse to Cuba and a P s ever and que con flick status. And if you have these three running and this configured than you're good to go If not, you should do visit my previous video in which it is explained. What kind of deafness sees needs to be applied in order for you to run this mutualization. So what we would like to do now estate should cube CTO dash F apply bash F Doctor. So what it will do is it will apply this configuration to the Cuban, its environment and the dot means that take everything in this folder. Where yet? So here we have the sporty Emma and we do not have any typos. So it was applied. And if issued, the Cube Setia guest home, then you will see that we have the Port Web application running and we have a service which is the class their I p and so on. So what we can do now is to issued groups et help describe And we would like to take the boat web and hear what you will see is ah, description off the port that is currently running. So currently we have the sport running on this note and we have this label applied to it. We have every other types of information. So this is the I peer. There's this I p addresses not reachable from your browser or anywhere like that. So in order for you to reach this put, you will need a service and in order to define service, we should do this. So service that Huma and we say that a P I version is the one, and we would like to have a kind which is service, and we would like to have a matter data and the name is Web service. And then we would like to have this back different. So the specs says that the selector is going to select an application which matches the web . So this is how the service knows which or poured. This is serving. So we have the find a poured with the web metadata. So the selector is able to find it. And now what we would like to do is to mop the port so the sports look like this. So we haven't http port and this http port is going to be 8 80 mocked to the node port and us. You do you muppet 19,099 9 And then we have this type, which is gold note port. So this Northport will be accessible from the outside world. If you specify, let's a class stripey. Then that will be an internally accessible board. And now, if he should cube CTL, apply dash dot You will see that there is an adult in the definition because this is called port. So now icis selector and the valid range. Yeah, I always forget that. So we should find something that is between the 30,000 So let's make it 30,000 won. Great, now, Cube, CTL get all returns. Asked this information. So we have this no port, which is mapped to our port. And if he should a mini cube, i p Then what we can do is to start up Firefox Web browser and in the Firefox Web browser. We should issue this I p address with the specified port. So s TTP and 30,000 won. And there you go. Now we have access to our by publication In the next video, we are going to continue our journey. Stay tuned for more. Thanks. So what you 8. Kubernetes ReplicaSet and HA: So where? Come back in the city or we are going to improve our previous solution, which consisted of one port and one service definition. So currently, if we take a look at our solution, it's working and it's kind of fine. But ah, what happens when the we issued Ah Cube city, our get Oh, and then we simply say that cube Setia deal it and we delete the port. What you will see now is that our solution with stuff working. So if we try to reload it, it would say that I'm not going to reload it and the Cube city are get all will not show us this part animal. This could be a crash in the service or poured or whatever reason that it becomes unavailable. So now, in order to improve this situation, what we would like to do is to delete the port GMO and we would like to create a replica that memo. So replicas and pours boards are kind off. Ah related in a sense that a replica is just basically ah more multiple definition off the port which serves a specific services services and in order to overcome this problem we need to define this with the APS that were you on a P I version. And the kind is going to be a replica set. And we would like to have the meta they thought. And this method data will be names like Web. And we would like to have the spath spec for spec definition with the selector where the name order rather the application is web. And we would like to say the trap like us are going to be three. So we would like to have three replicas off this, um, and the in the selectors, we we should definitely extend this so much the balls. And here we would like to have the up set, so then played. And this should have Matadi and this matter data should consist off labels. And this labour's should be like this we're about. And now what we would like to do in the same ah alignment as method data to define our spec . So our spec were consists off containers, and this containers are going to come from the name web, and we would like to have the image, which is the Reaper pie fight. Own Web V one and we would have the ports and the sports are going to be mapped the same way. So basically contain out port 80 80. Now if we go back and say that cube CTO that Ah apply stash F Q B c t ell then unknown film fear the much labors. So this selector Letna cheat a bit match labels So this is capital l and this is going to be tamp late. Great. So after we have ah successfully, let's say, created our definition. You will see that these were Babs started to run And if you go back to our browser and reload it, then you will see that the version one off the APP is currently working. Now if I delete one off these So Cube Setia, they did it then what you will see is that it will start automatically a new container or Newport which was served this specific service. So get all and then we can see that this is running once again with a different name. And ah, basically the idea behind this is that you would like to have the same service supported by multiple number of parts, so you can provide high variability in sense that once one of the ports nice, the rest of the polls will take care off the traffic. And you can see that the age off this Newport, which was started instead of the one that I have killed, is now to have seconds. And this is all I wanted to show you Stay tuned for more tax or itchy. 9. Kubernetes Deployments: welcome back in the city or we are going to take our replica set to the next level. So currently our Cuba needs environment. Looks like this. So we have ah, replica set off three providing a service which is reachable from our web browser. And if any of the ports die, then you will be able to or you will not be able to notice anything because the rest of the ports with third the requests. So what happens when you have a new version of this application? By this approach, you will need to delete the current replica set with the Cube Setia Delete de Chef Rapley cassette and then create the new one with the next version. So, for example, a live right, this one we divvy to and then applied. And ah, this good work. But nowadays, when you have the every service must be available 100% of the time. You do not have time for these. So I'm going to show you an approach which provides you with the flexibility to dynamically upgrade your application and provide Let's say this zero downtime approach. So currently what we would like to do is to issue the cube CTO delete Bash F and Cube Setia get all well, give us this terminating stuff. So you know what we would like to do is to Adam f that forward slash everything. Man, we would like to create the deployment that Yemen. So this deployment will consist off our port deployment and our service deployment. So let's jump right into it. So we will need an A p I version, which is going to be APS V one, and we would have a kind which is deployment. And we would have a method data which is named Web up. And then we would like to have the following specifications. So we need a selector and the selector will have the much labels and the smash Labour's. We work with the app weather and now what we would like to do is to specify the replicas and we would like to have three replicas which is more than enough for our demonstration environment. And we would have a template so this template will have the matter data which were consist off Labour's and these labours will look like this app web. So this ah matter data than further is extended with the following information. So containers and we would like to specify container with the name well, but and the image which is the Reaper pie by phone, where better. And we would like to use the version one to be able to demonstrate how we cannot great diversion to and version three. So then we would like to have the ports they find so the sports will have this container port, and this is 80 80 and then what we would like to have is a service definition. So here you are able to provide multiple definitions. And, um, my suggestion is that you try to group together in a single yem of five, the deployments that you would like to apply to your Cuban Eights environment because you get separated with services, the deployments, the ports, the replica sits whatever. But as, ah, business or product view, I think it's best practice if you group these together in a single yemma fire and what we would have here is the kind of service and we would have the method data and this method data will have the name web up surgeries. And then we would have the spec, which is the selector based selection off the application web. And then we would have the ports mobs together. So name http and we would like to have the port 80 80 map to the node port. 30,000 and one and type is no port. And if everything goes well, we should be able to use the Cube. CTL applied the chef deployment that Thiemo. So now if everything is working for correctly with the Cube CTR get all we should have a status. These sports are running the services running. Our deployment is appropriate. And if you go to the Firefox, we can refresh the browser. So now, in order to upgrade this to the newer version all that we need to do here, it's changed this to version two and that's it. And then we can apply the deployment. And if you check the get or you will see that we have some containers terminating and creating, and if you refresh this one, as long as there is one new container with the desired version running, then we are able to provide us the service that is perfectly functioning. So let's now upgraded to version three and that is basically going to be the end of this video. So version three and we apply it, and we yet Oh, and here we refresh it and as it because now we are at the version three. So So basically, this is all it takes to upgrade our infrastructure within your containers. And I believe that this is a really powerful concept to group together deployments and services and allow you to dynamically upgrade your were Web platform or whatever platform you have with the half off carbonates. And that was all see in the next room. 10. Kubernetes Kibana and elastic: Hello there. And the work Come back. So in this video, we are going to prepare our center s e machine. And this is going to serve as an elasticsearch in Cuba on a host. So this will allow you to aggregate docker container logs or cabinets, container logs or put logs and ah allow you to search them. So basically, we would like to install with the help of the console the following packages. So this is provided to you in the get have repository. So, um, all you need to do is follow up. So on Zebo on and me, I at sea, um that repose the deer elastic report And here we were like the insert the following company. So here we specify Repository, which is for the elasticsearch repository for some point expected jizz on the center A system. And this is the Basie where we would like to check the g p g. This is the GP. Geeky against future, we would like to check And this an a bird and we would like to have all to refresh. So now we can see em installed a drastic search. That's why so basically, after this was installed. We should be able to stock Ivana, configure our firewall d and then get weather in their face towards our installation. So after the elasticsearch was installed, we need to add it. The at sea elasticsearch elastic searched a t m a fire. And here we would like to change the natural cost. And it's not, of course, will be the one 27 00 that one. And be below that we would like to have host or hey, http host Toby Zero. That's zero. That's zero. And we would like to have a city P port for the 9200 and let's just save it and exit. Now we can use the system ctr a neighbor elastic search and system city start elastic search. And then if the represent Terry was properly configured and we can install Kibwana so we should use the same repository for the later stable. You can choose to install the bleeding edge version and better. What not but yum install. Keep Vonna bash y and this go out and grab our Kibwana packages and simply install them. And almost this was installed. What we would like to do, It's the permanently disabled the firewall or we should also try toe. Give it an exception. So you either disable the fire or you allow through the ports, which are necessary for years set up. This is based on your consideration, so to speak. So for a production deployment, you may want to allow only specific services to be accessed. But for a development or testing environment, you may want to allow anything to be working, but you need to make sure that your environment is consistent. So after this is done, what we can and should do is to check with the Firefox. If the let's say installation is working, so keep buying a and any well, and they say, Well, firewall D and stuff. Great. Now if you go to our Web browser on the should, the http Syria that 00 9200 then we should get back a Jason response, and it says that this elastic search notice properly running. And after the Cuban awas started, we should invest. Inspect the 56 1 port and it should give us back the Cuban a Web interface. And as you can see, this is now loading and basically in the next video. We are going t o come for your flu, Andy, and allow ourselves to send the logs to keep Vonna itself. So stay tuned for more. Thanks for watching. 11. Kubernetes Pushing container logs: Hello there. Fellow develops engineers. So now we have flu Andy installed. And we also have elasticsearch installed on our Cento a C machine. Now what we would like to do ministry installed a TV agent. So I'm going to paste command which is relevant from the get hub repository. So basically, in order to installed TD agent, what we need to do is to issue this command So this skirt command will pass to this page, so bash shell and it is going to install whatever is necessary. So I didn't want to take up too much time. But basically, if you should has come under or put will be longer, but the result will be the same. So now that we have the steady agent installed, what we need to do is to go on the Etsy d d agent td agent. Come. And first, you should remove everything that you have there after death. You should have only this part here. So currently what we have is a source which is going to forward from the bind poured 000 and ah, the 24 2 to 4 port. So physically it will listener all in their faces for this specific port. And this is what is used by flu, Andy. And what we would like to do is too much everything which comes out of Docker instances. And we would like toa have the type of scope e and store them in elastic search. And we specify the horse which is sent the S E which is currently let me show you. So up in the running. And after that, what we would like to do is not the stud adobe Premiere pro, but for the comfort you're out fluent agent. So we have this lobster, former true, and we have the perfect flu, Andy with the date graphics. And then what we have is also we were attacking it with access log and then we will flush it every other second. So now if you say with and quit, what we will do is to system Setia start TD agent and after it started, we can inspect the war logs and t d agent and TV agent log. So now we can see that our worker is up and running. What we can do now is to start our container. So let's leave the rule chair and issued Docker Rahm Dashti the SP 8 88 80 with the log driver, which is a quote flu. Andy and the log hoped which is equal to web up, not opt but up. And we would like to run the reaper pie fight Own web up version one Onda uh, fluent. The driver is not available. What? Oh, sorry. So the flu and the is appropriate, but what we have is the log which is going to be tag grab a great. Now the Docker PS is going to give us that this container is running. And if you go to our Santo Asi address and refresh it and refresh it them, refresh it. What we will see if detail the war log t d H and T D agent look, is that we received these get requests. So now you can see in the background that the heat requests or to get request, hit the web application and reproduce the logs. So how do we push this toe? Kibwana and Elasticsearch. So basically, what we would like to do is to go under settings and in expectorant, and what we would like to do is specified creating expect er, and we would like to have the flu. Indy specified this pattern. So if you specify Star, then whatever comes after the flu, Andy will be indexed and this is good because it allows you to index based on the day that these logs were received. So in the next step, we were specified that we would like a filter based on time stamp, and it should just simply create the index pattern. So now what you can see here is what was discovered by our Cuba instance. And if you go to the index management, you will see that we have the slough and the index for the for seventh of January 2020. And under the dashboard you will see all the logs that were emitted by the docker container . So now what we can see is which container from with sores omitted what kind of flog? And I think this is, ah, pretty cool, because it allows you toe say that you can let's a field there further so if I see that this known not exist is going to be done, then if we go back and refresh our log, then you will see the 404 with the container Rieti and keep on also allows you to have on the left side these these different ideas which were belong to your containers. And then we will have also this container ID's the container names, the logs and whatever you would like to filter. So I think this is really a pretty powerful concept. And in the next video, we are going to extend this coupon apart by up being, Ah, let's say, Ah, lock filtering from a local file on the remote machine, so stay tuned for more, see in the next. 12. Kubernetes Python app for logging: good evening, fellow there offs engineers. So in this video, we are going to create a small pipe and application which emits logs. And in the next video, I'm going to show you how you can pours those logs and forward them to flu, Andy. So let's get started. So let's create a directory which is called APP. And inside the CEP, we would like to create ah, fight amep that b y and the inside. Despite the nap, what we need to do is to import the longing, manure and thrown the logging with your We would like to import from the handlers, the rotating file handler. And then what we would like to do is to say that logging that basic comb fig And here what we would like to say that the format is going to be quote, too, and I'm just going to cope e and face this. So we would like to have a time, a level name and the message. And then what we would like to do is to specify the level this is going to be logging that info. So this specifies that we would like to receive or log everything that is either informational level or above that. And then what we would like to say is that logging that get longer And we would like to say that this is gold Bytom app. And then what we would like to do is to specify Handler and this handler is going to come from the rotating five handler and this rotted in five handler is going toe look a little bit long. But basically what we would like to say that this is on their home answerable. Yep. And we would like toa call this app that log. And after this is done, what we would like to do is to set the level off this handler so set level to something which is logging that info. And then what we would like to do is to said that the four matter off this So this is a custom handler, so this should be specified the same way. And then what we would like to do is to spit, say that longer that on Handler and then we would like to add the handler. So this is ah, kind off so longer equals. So this is is missing from our tree were set up or previous configuration. And then what we can and should do is to say that logging that in full or rather, lager that in full this is on in for level. And then we can simply save this and say that fight or 3.7 ep bite the nap, the P y and just run it. So as you can see here, now we have this ab that look. And if we cared, the abduct log, we can see a name forever log and another in full ever look. So we can also specify something which is cold. Logger, that warning This is a warning log and longer that critique. Oh, this is critical. So now if I run this once again, we seem to have the abduct look populated with information warning and critical logs. And in the next video, what we're going to do is to set up fluently the foreword, the logs from this file seeing in the next song 13. Kubernetes Forwarding Python app logs: Hello there. And the wire. Come back in this video. We're going to see how we can forward logs to our elasticsearch Cuba. Nine stance. And basically, this is the configuration. If I So what I did waas to is, uh, the d agent calm from previous when we forward the doctor logs and then created this configuration file. So currently we have a source which is going to tell with the tack, biting up the file under the answerable app, app that log and we will have a pause Ah, before I'll which would allow us to track the last day of position for that a lock file if the service gets restarted or whatever happens to it. And the let's go and execute our python at so currently what you see is that we have a meted these logs and here under abd that log, we have this what we would like to power bars. So now if he inserted here than what we can do is to create this much ing or named catcher groups. So the first name capture group is going to be debate. The second name capture group is going to be the application the third is the level which is information warning critically. But whatever you specify and whatever is after that is going to be the message. So this is basically what is configured here under our DD age and the cough. So this is the former that we would like to match and we also have this time format. So if you go back, this matches the following so year More day, hour, minute, second, and this rest whatever is there and what we would like to do is too much anything that comes out of the file with this format and then push it to our Santo S E machine. And then this is going to be prefixed by the pie web up with the date that we specify. And we will have this rest off the con figuration this present in the ghetto improvisatory , so you should be able to follow along. So now what we would like to do is to system city Ah, restart the D agent and the tail F war. Loti, the agent TDH is going to give us something interesting. So this says that we have this access error and the sex is several is coming from the fact that we do not have this app that log that pause and what we could do is to issue the following command to further trouble shoot it. So currently, this Opti the agent embodied bean through on the is what we would like to do. So now what we need to do also is to stop this TV agent and then around our flu. Indy. So this Randy is going to give us some more. Let's say interesting information here. So now it says that everything is fine and we should be able tow run our fight on application. So let me just exit the ones that are not necessary. So sido so and the password and home as about EP in the fightin 3.7 by thumb AP the P y Let's give it something The pars And as you can see, it picked up nicely that this is the date key. This is the EP key. This is the level key. This is the message g and so on. And if you go to our ah Cento US machine, what we can do is to create another index pattern And here what we should be able to see is that the pie Web app has pushed its own logs. We would like to filter by Timestamp and once this is done, what we can do is to co under discovery Greek on the Change Creek On the by were BAP and there we go. So currently we're seeing long messages from our application and the technically this is going to conclude our video. So see you in the next song. Well, though, see in the next 14. Kubernetes Outro: So this is the closing video out off our course. In this course you learned how you can set up docker on your realtor machines. You learned how you can create your own custom image and push it. The doctor help. You also learned how you can work our set up Kuban, it's or the Mini Cube Destin Monument. You got to be familiar with specific commands and other troubleshooting skills that are necessary to work with this environment and is closing. We have configured in Elasticsearch Cabana and flew Andy Environment, which allows you to collect logs from either docker containers or standalone files. And I think this is kind of a pretty neat develops tools that that you got to acquire. And, um, if you like this course, make sure that you leave a review. You can ask me in any kind of form how or what? How you can solve a specific problem that you're facing uring scores, and I would really love a feedback so that I can create a more Let's a resource for or better course in the future about the new or topics. So I hope that you have improved and what I'm asking is that you allow me to improve as well as a better in structure or alter. And ah, if you finish scores, you may as well at me on Linden. And if you add me and say that you're completed scores, I'm going to endorse you for your carbonates, docker, and keep on a skills. So a NTIA then see you in the next one by