Learn Spring Modulith: Monolith to Microservices Seamlessly - Kubernetes | Ezekiel Eromosei | Skillshare

Playback Speed


1.0x


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

Learn Spring Modulith: Monolith to Microservices Seamlessly - Kubernetes

teacher avatar Ezekiel Eromosei

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

    • 1.

      Kubernetes intro

      1:01

    • 2.

      Kubernetes Docker Desktop Setup

      9:15

    • 3.

      Kubernetes Start

      3:55

    • 4.

      Kubernetes Install kubectl client

      8:33

    • 5.

      Kubernetes Explore and switch Contexts

      8:22

    • 6.

      Kubernetes namespace and base test project

      11:32

    • 7.

      K8s pod 1

      22:59

    • 8.

      K8s Pod 2

      6:59

    • 9.

      K8s pod 3 configmap

      16:56

    • 10.

      K8s pod 4 port forwarding

      8:22

    • 11.

      K8s service node port

      11:37

    • 12.

      K8s deployment

      23:00

    • 13.

      K8s test deployment

      3:30

    • 14.

      K8s test deployment modulith

      26:42

    • 15.

      K8s test deployment modulith 2

      10:26

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

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.

8

Students

--

Project

About This Class

This class is the third installment to class 1 and class 2

However, it can be taken in Isolation as the core concepts are class 1 and class 2 independent

Tools we will use:  Intellij community version, postman, docker desktop (Important)   (ALL ARE FREE)

  • You will learn how install Kubernetes on docker desktop
  • you will learn about allocating appropriate resources to the docker desktop Kubernetes cluster
  • you will learn to get, describe pods
  • you will learn to get, describe services
  • you will learn to get, describe deployments
  • you will learn to get, describe configmap
  • you will learn to build a deployment file understanding the syntax alongside
  • you will learn to scale up and down a Kubernetes cluster
  • you will learn to exec into a pod to troubleshoot
  • you will learn to build graalvm image
  • you will learn to dockerize a graalvm image
  • you will learn to deploy the graalvm image to the Kubernetes cluster

Meet Your Teacher

Level: All Levels

Class Ratings

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

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: Hey, S here. You were able to make it here. Very big congratulations. Very big congratulations. Now you've got into Kuberneti section, uberti section, right? Okay, summer collicators. This actually scares most people, but it is actually one of my fun things working with. Kubernetis is very fun to work with. Trust me, I actually intend to pass on the exact same excitement to you because after looking at things like name spaces, port services, deployments, you're going to be blown out of your mind. Then you're going to be looking at gravy for performance. You're going to see the speed it will take for your application to start up and executing is going to actually wow your mind, and that is what we'll be detailing in this particular class. So be ready. Get seated, strap your belts and let's get started. I'll see you in the next video. 2. Kubernetes Docker Desktop Setup : In here. All right. So just type in Doa Dektop on Google, then just go into it. Do Deck Stop. So if you look at it carefully, everything is available for you, right? So you have for Mac, you have for Linux, and you have upright Lamazin Windows, right? So Mac we have the Apple Chip Intel chip. We have the Apple Chip Intel chip. So the Apple Chip type you start talking about the twos and the likes, right? So everything has been accounted for. So this you can use. Now, since if you know MAC, well, if you're using MAC, you would agree with me that MAC already has a Linux kernel, right? It's a Linux kernel. So there's no need for a WSL, because that is straight before Windows. That's called Windows, Linux system. So that's why you don't need that. But for Linux also, Linux is just straightforward, so you can install that directly and have a Docker desktop spring up. So you might not have a need for for what I'm about to say now, right? But however, this is how to install. So you can go ahead, guys, install the Docker desktop. Once you have it running, then you can follow me. You can skip what I'm about to say now for those that are not using Windows, but it's also good knowledge. I believe no knowledge is wasted. So you can just stay with me and get to see what I'm about to explain. All right, for Windows users. All right, for Windows users, it is always advisable you have a WSL, like I mentioned, have a WSL. So when you have a WSL, you can integrate that directly, right? That can be integrated directly. If you actually check this, let's just if you check under resources for Windows users, you see WSL integration. If you've enabled Ws find it automatically because once you actually install WSL, once enable WSL for Windows, right? I probably mentioned that the WS for a later build Windows ten and available for Windows 11. I think that's really key. You would have to install a Linux distro, right? I am big fan of Ubuntu. I seldom use Santos Santos, and I think I need to have pla Fedora, but I'm a big fan of Ubuntu, right? So the linear subsystem, what you use the Linux Distros will just automatically pop up, then you can integrate both. By clicking this spot in here under resources, the BSL integration, you have it. But if you have not installed WSL, that's also fine. You can just use it directly. Now, which brings me to the point I'm about to share right now. Guys, please pay full attention, wind this and listen to it again because this might be a key desider for Windows users to be able to use Docker Dktop Docker DktopKupertis. This is very very key. Now what I'm about to bring out is if you actually check carefully, right? Uh, let's go limits. I want to see exactly where that is. Let's go to go. Okay. Now, yes, we see under resources, right? The moment the moment you are using WSL, it is advisable, as you can see here. You are using WSL two. So resource limits are managed by Windows. This is very key, right? If you're not using WSL two, you can allocate the RAM. You want your Docker engine to use automatically, so it will be a shared a shared memory between your Docker engine and Cubants, right? So please keep the same mind, right? Please keep the same mind. So you can actually have this shared. And other guys you can also listen in on this, right? This is also key. So you can have this actually shared, right? But however, if you're using WSL two, you need to have a file called WSL config that dots WSL config, and you should place it under your path. Should place it under your path. I'll just show you exactly where this is on my Window system. So just bring this up. So I will share this in the results also, but I also want you guys to have it. So this should the WSL two file should be under a path. For those using Windows. I will just copy my path so that we can have better view. So you should find the file. So if you can see this, I'm sure you can see this. You should basically be Under C users, your username or user name has a username, the user name of your system, apparently you have a several user or the user name boy you actually doing all your operations. The C users, then the username, then slash the WSL two, SL configures to say. Basically, you have to place the file here. The file has to exist directly under your C user my username, the username I use is just my nickname. So I call Z, So call ZequZ. So you place this under. Let's say my username is Eco Z, C uses Zico Z, then I place the File directly under, right? You place the File directly under. It is very key for us to actually notice it's quite important, right? This is quite important. All this is quite important. The next thing I'm going to be doing, I'm going to be showing how the WSL tool should use. This is the basic configure should I will share this also. This is how we should look like, right? This is how it should look like. So what you want to have is what you want to have, so if you look at it carefully, should have this so you can see this is my username, Zicos, right? This is what I use on my local system. So you should have WSL two. Must be the headed just exactly as it is. You allocate the pass in the memo you want to allocate. I recommend you give it a swap file. Then you have a loca who's forwarded, is true, then this is more like the basic configure you can use, right? For those using WSL two, I would actually share a link also. I'll share a link for you guys to see exactly how this is configured. But this is my basic configuration, which you can also use. Now, you might wonder why I increase this to eight gig. I was previously using Six Gig. Now this is why I mentioned is very important. You might start up ubertis on your Docker and it might not come on for Windows users, right? Or for any other Pote system users. You need to increase the resource because I got to find out Docker actually takes a lot of space. I always recommend 4-6 gig for Docker engine to actually run all the components. Then Kubernets itself one single node cluster should be given at least two gig. If you want to run multiple node clusters for those I want to go to production, one single node cluster should actually take two gig depending on the resource you want to run on a single so that is why I added two more gig. So my memory so that it should be able to actually do what I wanted to do. Then the swap file, basically mean the amount of it has this extra space you've been using on your local hard disks SSD or HDD, right? So once the memory is full or once it's so basically it's an eight. The swap file is basically an eight to this. So I always recommend you give something very, very tangible to it. Acmbination just use the same len, the same size, right? Just a recommendation, but you can actually tweak as you use. So this part is very important, guys. That's what I'm taking my time to explain. That you guys can know exactly how to work with this, right? This is very key. So you get to understand and know to actually configure this. For non Windows users, please bear in mind, you actually see where you can allocate the amount of ram. Four gig is okay, or you can increase to six gig if you're running the local ubertis, if you're using four gig already, please add an extra two gig that would make it work. Else, it might just fine just keep on try to start but it's not friday and not a lot of resource and you might not even be able to debug. That's a funny thing might not be able to debug. Except that should go to the Kubernetis and you This doesn't show the log directly, I probably have not explored enough, but I don't think it shows the log, what I found out is just give it additional r and you are good to go. This is what I've done on my local system, and this is amazing. This is amazing. I have both actually set up. Next step, we actually explore some basic functionalities of ubertis before we now start moving our way up till we deploy our application to Kubernetis cluster. See you guys in the next video. 3. Kubernetes Start: Hey, guys, Z here. This is supposed to be a relatively short video, right? In the last video I recommended for Windows users should watch on why other users can actually skip like other operating system users could skip. But I would recommend once again, please, guys, watch the DA Watch the DA videos. Because I mentioned some key things might be a key desire for you to be able to start up your local uberts, right? So please look at that. All right, so I have gone ahead to just start up my local Cubansis because I think you wouldn't want to wait I don't want to wait like three or 5 minutes, right? So you just need to come to the uberts section, we can enable, then start it up, right? Just start it up. So just apply and restart or just start it up and that should atould what? Right, so just start it up. So if you're finding difficulty and it's not coming up like I mentioned earlier, this is very key. Kindly increase increase your Rm, add two more gig to it, right? Depending on the local amount of ram you have. I'm running a 32 gig 32 gig Ram, and if that two gigram means I say. So I would strongly advise you increase your Ram. Just whatever you're using, four gig is always enough to run local cobertti, but sometimes it drags. So if you have enough rum, please increase your six. If you don't four is fine. Then if you want to run cobontis please add two. So what I usually do to make this work, right, is that I try as much as possible to kill my chrome tabs. Remove some of the details I'm not using then start it up, so I'll be able to utilize my entire system. That is what I try to do. Go ahead and do the same thing. Enable cobnits and also enable it, give or take, if I'm not wrong 3-5 minutes. 108 to 5 minutes and it's also dependent on your bandwidth because I know once you're enabling Cuban, it pulls some resources, right to your local system to be able to start it up. So I I might not be accurate to say three to 5 minutes because your bandwidth might either be higher or lower than mine, right? So if you're using a higher, probably it will just start up way quicker, right? If I'm using low, I should actually should actually you should do so. Probably I can just look at my bandwidth right now to see exactly what I'm running on, to be able to give you guys accurate information so you can use to decipher Okay. So I'm running I'm running 40-40 to 50 MBPS. I'm 40-50 MPS. I just checked right now my other screen. So if you're using higher, then you should probably be something lesser. But so please keep this in mind. If it's now running more than if you know you have good bandwidth and it's now running more than five, 6 minutes, probably in relation to my bandwidth, you might just consider increasing your run, then try again. All right? Once you've done so and you get it started, good enough to come with me in the next video. One more thing, guys, remember you can drop a message in the comment section on the question and asks and I look at if you're having difficulty starting this up, then I can follow through. Now, if you're actually familiar with other Kuberneti services, and you want to do that, please go ahead. You can also use Mini cube. Mini cube is also available. I just decided to use the Cadexel because I think everybody can just easily follow along. I drop your questions, and probably I'll just follow through and see how I can assist. I sincerely hope everyone of you is able to start this up. I would actually make everything more excited. I'll see you guys in the next video. Let's now jump in to start exploring some core details of uberti See you guys in the next video. 4. Kubernetes Install kubectl client: Alright, guys, thank you for coming back with me. Thank you for coming back with me, and I'm excited, I believe, as you are, so we can explore this. Okay, so we've drilled enough on Intellij. I know some might be saying, Is it going to run the commands directly, Oh, sure, I can do that because it's a terminal here. So you can use any terminal of your choice, right? Any terminal of your choice. But just to make it more generic, right? I'll just pull up my power shell. I'll just pull up my pill. If you're using. You can also run this on GISBas Git Bash, pull up a command line and let's get things done. This is my local system, you can see, C uses cos you help this. I just leave this Ce as a bargain so we can see this is working, but we can actually close it after a while. I think we can just begin, right. So once you've been able to install that the next point, the next thing you probably need to do, you need to install Cube koto, Cube Koto. It's called cube. Koto, right? You need to install qcoto. Now, for Windows users and for Linux user, if type in qcoswe you can see I have access because I've installed it. This is how you interact with your component. The local Kuber system or any other cobonancs out there. You just need to actually connect to the writing resource. I'll show you guys how to connect to the writing source. So I think the next step here is to show you guys how to actually connect to actually install Qutu. I will just drop a link I'll bring up the site now and show you guys a link on now to actually install QKoswi because this is very key before you can actually proceed. All right, so this is it, right? This is it. As one might ask me, how did I get here? I just do random search as to install cub cattle on 12 on Windows. Just pick your choice. Then pick the Kuberneti section. Apparently, on this is Kubernetis. This is the official documentation, so they tell you how to install it. So this is how to set it up. If you're using Linux, this is how to go about it. So just follow this step, follow this step. Please read carefully, right? There's no rush. Read carefully. I think there are three ways if you want to install using a call you don't use the native package or any other package management, right? I have Q cards both on my Windows subsystem. That's Linux subsystem and my regular Windows, right? So I'm a regular Windows commander, so it's different installation. So I'm just showing you guys how to actually. So this is for Linux to just go through. It is very direct. It's what's thename now? It's a very straightforward process. So this is how to do so. So these are the 33 ways to install. There are three ways. So don't run everything. Just pick one way and just store. For Mac, Mac uses. So for Mac user, this is exactly how you go about it. So to install on Mac, you see, there's several ways also. You install using coral or I can use the hombre, right? Homebrew or Mac pots. So whichever you use to. Then please candy notes this section. You see? This is for Intel and this for Apple. Right? That's the two, the two chip and Lausi Intel, use this, right? So please I'll do that. Should I use it Homebrew. Brew, use the Homebrew dictly you should be fine. I brew should be a very straightforward command, so it's not difficult very straightforward. Just three commands and four. Sure. Then for Mac for McPots and all. Well, if you're like me, I'm a very curious engineer, and I like to check out everything. But for this course, just pick one in stall because I know sometimes when you get you might use some system you might want to do and you don't have access to directly use code for some weird reason. If you don't have access to pick whichever works. Then let's move on to Windows. All right, so there are two ways you can install on Windows. You can actually use curl also, or you use Chocolate Chocolatey. Please follow through step by step, right? I always I would always say, I always recommend use the latest version, right? As you can see, it says, for example, 130 card communicates with one to 29130 and 131 Control plate. What is Control plan? Control plate is basically the node in a Kubernetis cluster that manages other nodes, right? That's the master and what you guys would call master node, right? So you must ensure you install the latest one. Says 130 would work for this. I simply means if I were to check my ubertis cluster. I check my ubertis cluster. I'm running this is Cube Kat, cube at, I had to take this off. If I were to think of Docker desktop, you see, my ubernis is running on one or 292, one or 2902. Try to match your cube kat to the version you're seeing here. Try to match it. This will play a major role for you, right? Because if you're using a far lesser version, it might be another reason why it won't work. I need to actually explain this. For some people, what you might practical experiences. For those already have combines I've been using it for a couple of maybe one, two, three years and you have a way older way older up at clients, and you now been able to do car desktop and say on one or 29 and you are now on inversion, say 12, four, you have issues. I'll explain why you have issue. This is primarily how it works. Let me just bring up the notes part. This is primarily how it works. We have QC two, just like in the documentation. We have Q two, one, 24, right? One dot two, four. It means Cubats node you can interact which will be one.23. One do 24 and 125. If you notice incremental values, a version before, the exact version and a version higher. I forget about the other subversion, like the dot something, or maybe dot one dot two. Forget about that. Just look at these parts, right? So you see a version before, a version after and exact version. So that is what they explain in documentation saying if you using 1230, we can basically interact with one do 29, a version before, one do 30, the exact version, you come the result version, then 131. Guys, this is very, very important. Very important. Please kindly note the coberts version you're using. Or if you're even using another cobart say you have access to a cloud provider, you have cobants running, please always ensure you check your version. This is always a visi cobarts you can access with the Cup cut I mentioned they don't know what is wrong, please ensure you check out this. So as you can see, what version am I running? Let's see if confirm. What version am I running? Uh I think it's that Vashon Micro it. I think it's the DashonV. Let me just be sure. Windows, Windows Let's check hon clients. Let's check this out. Alright, so I can see I'm running on 12921 do 29 dot two. So it means I can interact with one do 30. I can interact with it one do 29, and I can touch it one I can touch it one do 28. I can attach one do 29, and I can touch one do 30. So meaning I can attach it everything that this has. Alright, guys, so I needed to be sure. Alright? Yeah, so that's what we have. Good, guys. Great. So Yeah. So we're good. We're good, right? We're good. So with this, I'm sure we are ready to proceed. Ready to proceed. So I'll show you guys how to install this. So I think I'm ready to proceed, I want to check out the length of the video. Okay, 8 minutes. Alright, so I need to explain this bit. I'm taking it step by step so that you guys can actually just follow along and you don't miss any process, right? I'll see you guys in the next video, right? 5. Kubernetes Explore and switch Contexts: All right, guys, thank you for coming back. All right, so let's start exploring a bit of Cubanits. I can't touch I can't even begin to say I would scratch about about 5% Cuberts. I just want to tail section towards us deploy, but you need to know the key functionalities of what we need, right? So I don't want you to be lost in between. That's why I'll keep mentioning some key details. So in the last section, we explore our cube cut I'll bring this up again. Remember, I have my cubants running, my single cluster cubants. Now, how do I even know I'm connecting to the right Cuberti? That's the right point. Because a client every client will connect to the server. A client to connect to the server. You need to point the clients to point to particular serve just like you're trying to reach a URL. You could say you want to reach Google, you could say you want to reach Facebook. You could say you want to reach Amazon. You need to point the URL to a specific source. The same thing with Kubernetis no, I have worked at several Cuberts clusters, right? Several combats clusters. So there is an option you would also at some point be working with several Cubans cluster. For those I've never run Cuberts before, you say if you can just connect because that will probably be the default you have right now. But for those that have run coberts, you have an issue of connecting to you write coberts you want to because I've had to work on several projects simultaneously where I'm having to switch clusters to deploy applications and to work on what I need to. So how do you find that out? So there is a command you can use. So you can use Q two configurate contests, right? So these are all the contests on. It's saying, this is the name of the current of all the contests you have in local system. As you can see, I've worked on, this is an AKS. This is Ajo. This is Azure ARN. This is Amazon, Amazon. I've worked on several parts. I worked on GKE which is Google Cloud. There's several of them, I worked on custom Azure. I just wanted to show you the I've actually worked out. Now look at this cluster. These are the clusters is cluster. This is authentication info, right? Indication info. Uh, this really really doesn't say much. All this doesn't say up itself. I'm safe basically. So if you want to check your details, I would love to show you a file, or maybe I can just briefly show you, but I'll take it off the screen immediately, right? Because contain some key details, but I would not just do that. What you do basically, if you want to get a full view of everything running on your local system, you would use something called CBC two. Let's clear this off. I'll show you the first command to sew the contest running. We'll get back in a second. I'll make this available, right? All these commands available too. Let's do a Q config view. Can you see this, right? You can see this. I am deliberately running through. Now, most of these tokens you're seeing I'm sharing are all expired, so they don't work. So if you try them, if you screenshot my screen and you try them, it will not work, right? It will not work. You will not have access. I need to actually make mention of that. It people are actually curious, but it won't work, so. Figure will show you all the details you've actually connected to everything you've connected to, right? So you need to actually have that. Okay. So that is one bit, right. Okay, guys. So like I mentioned, some of them are old. I've taken it off the screen. Like I mentioned, I'll just quickly review it. Now, a question is, how can I have a fine view on how to say this? Very easy. You need to basically go to go to Combs basically actually stores in your local file. This is my local file. Then you go to the users, then go to the username. This is my username. Then look for the dot cube. Dot cube. You see this dot cube. If you open up this file, I will not open it. If you open up this file, you see all the configurations and everything that you need to see there. It's just an exact replica of what I shed on the screen. Actually, it contains more details I don't want to show, it shows the keys and everything. It shows everything to you that you're using to connect a cluster. Apparently, I'm still connected to some amazing cluster which I don't definitely want to show. All right. So this is exactly. I'm just trying to go step by step, checks for Windows for Linux users, basically, for Linux users, just check your home. Where you check the home, then look for dot cube dot cube under your home. Let's just a CD, then go to your home. Then the user name, your user name you're using, then go to the dot cube, but you're actually fine. That is key. I need to actually mention that. I'm interacting with this right now, another example I can show you is let's go let's go too. So I can connect to my Ubuntu from here. So if I connect to my Ubuntu and I do let me do a PWD to see my current working directory. So I'm currently in my home, right? This is my home, right? So you can also do this. Use this and this takes you to your home directly, right? This is squiggle, right? It takes it to your home if you on a keyboard, I think it shifts, then shifts back tick Shift tick. There's this tick just beside one and you get this symbol. So when you're here, so now that I'm here a PWD, so let's explore this part, right? LS. So I'll do LS minus A to also show hiding F because when you have anything that is preceded with dots, it's actually adding fast. Let's well let's A. So if you look at this carefully, right, you see that's in dot cube, right? It's in dot cube. So let's go into dot cubecd dot cube. Right, SoC will have the same file, this config file five. Also cuts right now. If I cut it, you will see also see so you can just cats config I'm not going to hit this command, right? So once you hit this, you also see all the configured. This is very key, guys. I need to show you to know exactly how to explore this, and this is a great one for you. A, right. This is great. This is great. This is great. So I will show you the configuration files where to see the contest, everything about your components cluster. So you see everything in this configuration file. Keeps appending. When you connect to new clusters, it happens. It happens. So you have it there. I've been able to explore this in detail so you guys know exactly how to actually connect to it. I think we're good to move forward, good to move forward. With this, I'll come back to my power show and I'll say the last command we use we up cut that we get config. Config get contest. G contest actually give this. Now, because I'm missing the car desktop, you would automatically find Da desktop, right? So Theca desktop is what I'm interested in, and that is what I will switch to. T switch, cube cattle config, then use that's the word, use context. Oh my context is what Docker DktopTocadk stop here. So I would also make available this also. This command this command would also be available, right? So once you hit this, you see switched context to this. So now let's check. If you notice before now using, which has a star, which shows the current context. So if I do Keep coil config, then get contests. As you can see, I'm now in Docker Dk stop, right? I'm now in Docker Dk stop. So I've showed you guys layer by layer exactly how to get here, right? I've showed you explore some little bits and how to get here. So I think with this, we are now good to go because you are now in Docker Dk stop, and we can now explore everything that is within Docker Dektop apparently I can't explore everything. Cubans, but least. Basically, I meet with them follow through the parts to do everything we need to do. Alright, guys. I'll see you guys in the next video. 6. Kubernetes namespace and base test project: Okay, guys, Z here, thank you for coming back with me. So as you notice, I have a purple screen. I don't know if this is exactly proper, right. I'm not really good with colors. So I just want to show you that I could connect with both my WSL, which is on Windows and my power shell, so I could switch to any of them. It's actually since I'm connecting to Kubernetes and Docker Dektop basically the Kubernets and Docker Dektop I can access both, right? So don't be alarmed if you see me switching shells and use any one of them, it's just the same. So let's do a D Let's just run one of sorry, the Kubernetis. So a CC two config Config contest. This is on my partial, you can see I'm pointing to door Dexter. Let's check here. Let me just copy the command. I don't want to re type both, so just confirm if this is the case here. All right. As you can see, I'm on the same, there's really no different. I could use both because they're all connected to the same docket desktop that is within, remember I enabled for those who still can remember what I did. Remember I actually came in here the resources the BSL integration I integrated my Ubuntu right. So this actually integrate so I'm using both together and that works. Yeah. Now, I want to speak about a very unique concept which most Bogami language uses, which I'm going to actually explain here. They're all similar now, Cubontis All right guys. Thank you very much. Yeah. So actually posted the video a bit. That's why I mentioned, as I was thanking you guys for holding it, but you didn't see any lag. Yeah, there is a concept called name space in uberts. Now for those that actually for those that do Java, you'll be familiar with the concept of packages, to have some bit of code in a particular area. From those that do.net, you're familiar with things called name space, right? The same thing actually happens. We have a concept called Nspac cobertis in which you want to segregate an environment. Let's say you have, I think the typical example could be, if you have a Q environment, a development environment, a production environment, these are three different environments you don't want to actual interact with each other. They are separate spaces or let's say VPC in a virtual private Cloud, your user has a virtual private Cloud that doesn't tell you standing down user in a virtual private Cloud. The same concept exists here. We can see there are some defaults that are already made available to you. We would go ahead to show the default. You should already guess it. It'll be cheaper to get namespace, namespace. These are the name spaces that are available. There's a short form. I think it also at those are name spaces. I want to be sure Alright, so the S also available. The short cut I would use from NS is NS. So NS. So this is the short form. I want you guys to be using NS out of namespace to actually get things typed faster. Alright. So you see the default that is always made available to you is this, which is the default environment. Anything you type in, anything you try to create to try to explore would be seen from the default environment. So if you want to explore things within this cube system, you will not be able to access it by default. So take for yourself, if I say cube cut tube, get pods. Side, I see no salts found in default name space. However, I want to check if I want to check the names where I can pick this namespace, and I'll just say N, this can you see the difference? So this N is point to this cube system. I I don't have time to explore this, but these are the core details that make Cubans actually function, right? The Marques function. Take this scheduler. This scheduler is basically the guide that deploys actually schedules your pod. Well, I'm not exploring this, I'm not exploring this. Remember, I'm still in the default name space. If I go over this again, do bKotuG NS. I'm still in default name space. Let's see what's available with this node release. Let's see what's available. Let's just Kupe koto QCT get pods, let's check between. Let's check this. Oh, there's no resource. There's no pod here. All right, so another shortcut, I'll probably show you guys. Remember all this will be available, unless we watch the video to pick the commands. Qpc two gets PO, right? N, let's use the cube system, which is that namespace. Okay. Let's do this, as you can see, I can use PO for Potter using the entire name. I think explore enough. Now what I intend to do is I want to create a unique namespace for what you're going to be working on. That's what I want to do. I'll do a CK two, create create NS. Remember NS is namespace. Then just give you the name. I'll call it test. This has been created. This is created. Let's just do QK two get NS. As you can see, I now have a namespace called Tso? So, remember, even though we now have this poll, we now have this, what is the default name space that is still active? What's the default name space? The truth is the default name space is still the default until you specify or you switch it. So it defaults that's the only way I can confirm. How do I know? So what you can do is if I were to pick to pick this to pick this minified this covered. All right, so we could use this command to check so we could do a grab namespace. Right, grab namespace. Oh, sorry, mix the commands we Qu kato. This will not show us basically what we need at the moment, but this is for validating the command. Trigger when we just move to a new namespace, we can be able to see the name space we just actually switch to. What I would do is let's switch to this test name space that we just created. So they Kukato Kukatu config Then we do a set contest. You don't have to cram this, right? You don't have to keep it in your head. It's always available documentation. Just type in how to check the default names or how to switch a namespace and Cubans and you find it, right? Then currents, then dash toachnamespace, remember, name space. Then you use the dash toachnmspace, then we can just use the N. Whichever we prefer. N, then just pass test. Think it wants the four dits dash dash Emspace name space. So this is. So you're saying we've modified. So let's run this command again. Let's see this. Let's panidate it. Let's confirm this. That's a config view, then test. Okay. Now you see appropriate commands config set context, dash, dash, name space, then equals to test, then cube, config then view minify web name space. I think this is the error. I was using name space. I didn't type that correctly. Name space, right? There is a proper in here. Space test name space. Let's take it up. This one I was looking for. When it cuts to conflict view, this guy shows that names which are running now is the test. Anything we create, anything we do will be directly in in this particular name s to test a store name spaces. Now to proceed with this, I would quickly be showing us a demo projems that I created. Very quick simple demo project. Now, the easiest way to test cobonts as advised people when you're learning, have a demo project which you can easily just spin up and run. If you look at this project, this project doesn't do anything significant. It's just very minute details. All I do is just they have a single G method and the G method is just Teske, it tells us what you just call. I just return in response to you. That's all nothing else. One is even agoded. Then I'm expecting a param. I pass in a param, which is a mode. A mode is an ym. You see the mode, it's either developments or production. Pass in of this string and to actually get it out, then level, pass a level and the level is an nom, either a novice or SPaT. Then this is a response here. I built it a record. Nothing nextra. If you look at the configuration file, there is really nothing here. I just set the profile to be dev. We check here I just set one property which is to level novice, the auto level, then I actually use what I showed you guys earlier in case you want to actually set the default or the environment property, which will be expected. I wanted to show this guy, this is the project to be using from here on to actually test to test the basic functionalities. We use it to test how to create a pod, use it to actually declare using a service, then we actually deploy to copares using this project. Once we've done so and we hit this seen show that things are working well. Remember there's no database connection. Once once you've done this and you're comfortable with it, then we then pick the modulate image, then go through the same process and things then becomes much more clearer. This no complexity. But screen modulate have to connect with database or data source and we're trying to minimize I'm trying to minimize several the complexity, we have to actually thunder. Let's start with a very simple project. I'll commit this or rather I already committed this. I think the name of the project is demo, I think ATS. I would actually add this to I also provide this in the resource folder or in the resource pile, which you guys will actually be able to access also, I commit this also add this to the accessible. There's really nothing difficult here and I've already gone ahead to the Docker file and I've already corrected the error we made earlier this spring and this string in the polisher. I think are good to run into the next video. Guys see you in next video. 7. K8s pod 1: Hey, guys, Z here. Thank you for coming back with me. I have push this to Githu repository, and it's available in the resource folder in the resource file. At the same time, you would also notice I've already pushed this to the image is already available. Dokaimage. If you look at this, you can see we already have the demo k test, which I did about 18 hours ago. But however, for those that are couriers, let's just quickly do that. Envying clean package. There's no test, but our CIS keep tests. D skip tests. This will just do this thing and bring everything together with this done. We have this. Remember, I've already gone ahead to explain in the last video everything we have in here. Then secondly, Docer Dude T, then demo, K test is the name I use, then dots. Let me let me actually commence this out for now. So let's have this. Let me commend this comment if you want to comment out, you just put a hash symbol and I comment out all works for Bash and Linux Seminos. This is a combination of bash, partial and Linux seminars, which is for the windows. Okay, this for Linux seminar say. Now, this done, let me go ahead and delete Docker Image ARM, then Dahef then demo Ks. Then I did 1.0 really, 1.0. I've deleted. I can bring in this guy back, then remove this and recreate. Dose crits all of a sudden. This is going to you can see, this is done. This is done. We have this. Remember, I mentioned I can use any of this command either I use I use the Ubuntu or the power share. I can just switch in between the two. The reason is because I don't want anyone with different operating system to think I'm doing something different. It just can be used. Preferably, I'll just check with my terminal. This application terminal, basically works for me. Okay, so what is the next thing you're going to explore? The next thing you're going to explore is, we'll be creating a pod. Now, what is a pod? The way you have a container in a docker in the docker engine, which is the smallest unit. In Cuberts the smallest is a pod, not a container. However, a pod now can contain one or several containers. I'm going to take somewhat easy routes, but I just want you to have that knowledge that the pod contains one or more containers, right? So we'll be cutting the pod to create a pod, there are two ways to create a pod. There is the imperative style, and there's a declarative style. Now, the imperative style simply means that you would run a command to create the pod, specify the image, like all in one command. Declarative is you're going to be using a configuration file. You will set everything in the configuration file. I would do possible best to explore both, right? So I'll go ahead and do a Qu two. Remember, this will be available. Q two, then I would run. If you want to create the pod, you use run. Run, then give you the name, the name, so I'll call it demo. Demo. Then specify the image. Then the image, the image I'll be running on the image is demo, remember, demo KHS one dot zero. Then this count directly, but I want to show you guys something. Is an option called Dry Run. Dry run client. Then you specify the file version, I'll say Yamel. What does this do? This is saying, I want to run a pod that has this image. However, I don't want you to run it yet. I just wanted to generate a configuration file for me in Yamel. You can also generate it in JSON. What I'm going to do over here is that I would then for those that are not familiar with Linux, this means copy the output of this command into a file called demo dot Yamo. I hope you guys can relate that. So please watch this video if you want if you're mistaken. I saw this is the name that the pod we have, the image that we created, this is hyphen, the image that we created, and I mentioned that Dry run O Yama will generate the Yamal configuration file we need, then run it into and then pass the output in so a demo the Yamo file. So let's do this. So let's explore. I'll be a CAT demo dot Yamo. Can you see? This generates all these details s, Which is awesome. This is awesome. It generates all these details, Rose. Now, I could have gone ahead to just run it directly. I could have run it directly. But I just need to show us that if we wanted to create declarative this is exactly what we create. This is declarative formats, Delative format. If you check the configuration, I'll just quickly show you a stick pick. I actually actually go to see this part, this is Kubernetes. This is Kubernetis. You see? This is exactly how it looks like. If you compare with what we have over here, can you see? The somewhat look the same, right? You look the same. Now, the container part is not because I didn't specify part. If I specified parts, we would have seen it there, right? I want to show you that this is a very cool concept. I'm just trying I'm trying to kill two bear to 1 stone by showing you how to actually do boots and doing that. Okay. I think that is cool. Let's run this again. Then let's do dash dash pods, then dash dash pods. I think we're running on what This is 80, 80 80 because I didn't set the pot be 88. 88. Let's do this, and let's do this. Okay. Let's explore this now. Cats, demo, yamo. All right, can you see? We now have the container pot exposed. See, guys, this is interesting. Really awesome, man, really really awesome. V really awesome. All right. So now we ask you, but you've not run the command yet. No, the command is not a run. I'm just showing you I'm just out put in to show you guys how this basically work, right? So you'll find all this command basically available, all this command, I make it available to you guys. I'll set some to be imperative or set some to declarative, right? I showed you guys that you can actually by doing this Giron clients O YAML, this into a file, this actually puts into a file, you will get cut it. That's what we did. Let me show this. I hope you guys that is clear. What if I want to run it directly? Now that I have my demo Yamo I have my demo Jamo file. Let's first of all explore the aspect of running directly. I'm going to copy this command. I'll copy this command, I'll clear this. Now, let's do a up cut get pulled or get PO. Remember I told you sing. This running in the default space. I'll do this RN test. Remember, we created the test. Memorize cube cut gets NS. Remember, we have the test environments, right? I think because I was using the terminal. Let's come here. Let's cube gets PO. No resource in test name space because I've not switched my contest. I think it works per terminal, right? I save the peramial. Let's just go ahead and do the same thing here. I've text in the command before, so I'll just come in here, place the command in here, then do tests, right? Test. So around that's let's view. Let's move this in. Grabit. Okay, so this is not Linux, right? So it's not fine. So let's just it's not fully Linux. This is in between power shalar Linux, but some commands don't work. Crap don't work. So let's just do P All right. At least back now, we're saying no its in test name space unlike when we're getting in default name space. We can then go ahead and run the command directly. The command will actually run without the gyron. I showed you I explained what gyron means? You guys now understand what gyron I'm going to do this. I'll just command this one here. I've typed I don't want to type again, just take this out. All right. So let's just run this directly. So I hit it directly. Can you see pod demo created. So let's explore. Keep Cato gets peo. As you can see, it showed that the demo is trying to create but it can't find anything called image. That's what this is saying. So there's a way to find out. We see this saying there's nothing like image full backup. It's trying to look for the image. Why you looking for the image, let's explore. So I just showed you guys, I'm trying to switch terminals above consistency. I'll just stick to Ubuntu terminal, I'll stick to Boot terminal. I remember I just showed you I can use my Powershell, I can use this right. I just fancy this a bit when I'm actually dealing with Kubernetis. That's just a personal preference. That's be get PO. Now, let's see the reason why if you're not sure what is happening. You could do bekotu describe you can describe the pod. Remember shortcut. Then the name of the pod which is demo, what is happening. So this is saying, if you go down, saying, the scheduler automatically, remember I mentioned that scheduler is one that actually creates the pot for you guys. This has been done. This is fine. But it can't pull this image. It's trying to pull this image, but the image is not available, and it's looking for the image. The prostitute does not exist or may require docker login. Request access denied to this image. The same request access denied to this image. The next thing we'll do, I'll just do a Docker image S demo than a star. You see this is available demo hyphen, KTt. And this is regarded as latest, right? I can't see any one dot zero. So it would mean when we were creating the command elia, it was latest I was used. So one Broad zero was not used. So that is why we are having this issue. So I would do is I'll go back so I've showed you guys yet another command, right, how to show, which is what I showed you this. If the name of the pod, which you create remember when we were creating the pod, right? And we're creating the pod. I think I did it at this terminal. And we're creating the pod. I specified the name here, which is demo. So please keep that in mind. I'm trying to follow progressively so you are not confused. Let's keep this in mind. So coming back to my other terminal, now I tried describing and this describe showed us that the name or something doesn't match, which I was able to actually show you guys. I would actually paste here. I paste that in my notes so that you could actually I would make it available also saying this does not describe pod. All right, so coming back here, we see this. So next stop, cube Cuts PO. This is the issue we're having. So let's delete this pod. We can do a cube, cut delete PO. So once you delete the pod, the name of the pod is demo. Now, if you do this, you'll be waiting for Kubernetis to do a graceful shutdown. Then fy delete. This might have some what effect. If you were to attend the Kubernetis program or the uberntis certification, you won't have time to actually let this. This will waste a lot of time. So you can use something called dash dash grace period. Grace period, data force. I hope I got this command correctly, zero. You're saying, I want this one I want to give a grace period of zero, but I want to force it to close. I see. Immediate deletion does not wait for confirmation that the running process has been terminated. So it doesn't wait. Most time you don't have to wait. You do a cube cut two gets PO. It gone. If you don't do this, you said this was immediate, but if you don't do this, this will take time. Let's do the same thing again. Our service command, does the same thing again. Let me just create with what we did earlier. Keep cut runmo dash dash image, which is a demo hyphen K test, then I did 10, then what does dash pots. The index is 80 80, what I did. Then if you run this again, let's wait for it. You see, error image pull. You couldn't pull the image because you couldn't pull this image, let's now run this command again without the grace period. Let's move this grace period and let's see what happen. Count the more seconds? One. You see, I took about one to 2 seconds for it to delete. If the pod is heavy, it will take longer seconds. That's why I showed you these two difference. This is another way. Save this also to the notes, so you guys can actually available in the note in the notes and you guys can actually have access to it. All right. With this done, let's delete again. So I have deleted, so this is go. Let's do a cube to get peel. There's nothing here. Let's now run the image again. Remember, this is looking for latest so let's see. Cue cutter get peel. I can watch. What should just make it stick, get pulled, then watch. When you do a watch, what should keep it running open so you don't have to just exit the common see. Now we're saying the image is still having issues. Let's explore. Let me see exactly what the issue is here. All right. I'll quit this do you describe also? Do you describe, describe the demo. Let's see. So it's still finding it difficult to pull physically saying Asset denied for demo K test latest. There is the same error. You may require a Docker login or access resource is denied. Alright. So we are getting the same error, so I will just fix that bit. Okay, guys. So looking at this, I'm looking at it. It's trying to pull from it's trying to pull from from Docker from Docker Hub, right? This is trying to pull from Docker Hub because that's exactly what it's trying to do this pulling. Trying to pull from Docker Hub. We never pushed our image to Docker Hub, right? This image was never available in Docker Hub. Rent on local registry and that is exactly how Kubarncs work. Kubant doesn't know about Docker Local registry. We've been pushing to the local registry. So we need to push these images to my Docker Hub, and that's exactly what I need to do. I push it to Docker Hub, it will be accessible. What I'm going to do several ways to do that. You could just clear this up. First off, I'll clear this up. Then let's do I'll just do the Docker image. These two guys, I want to push this together. I'll do Docker push. Docker push, then just pick Modult. Since we'll be doing that at the end of the day under zero, let's push this. You can see it refers to I could have this is the full path because I didn't specify the full path, it just picked this guy, pick it. Now, Access is denied because it requires me to actually log in. I'll do a Docker logging Docker login. So my username, Okay. I'm trying to push. Login succeed I've logged in. Let's do the same thing. It's still not allowing me to push. Let me see the reason why I've logged in successfully, you're saying you can log in to password persona. This is learn more tt. If you don't have a Docker ID, C Let's see this Y is not allowing me to push. Okay? Let me go ahead and give it my name. So this so you want to push sometimes requires you to put your username in front. So let me push my username in front and let's see this. Let's see. Push this Docert does. Okay, so it's looking for this. All right. Let me just figure this out. Okay, so it's not saying and it's expecting my username because I'm looking at this, it's trying to push to the default Docker Hop. So it requires my username. Okay, I think I know what the issue is. Okay? All right, so let's clear it up. I will go to the projects, go to the project. This time around, I'm going to do Docker Bute T, then my username. Then demo, I think, Hs, then one Dot Ser one dot er. If you don't specify a tag to be used as latest, so I'll just specify tag because I need a tag. Let's do Docker BuT. Then let's pick this on this fact okay? All right, so we've pushed. Now this is now going to the default. So we check now. We do a Docker image, S you can see I have an image with my username in front. Now, please remember the reason why this is if I don't use my image, it should be trying to put the default Docker registry, which is on Docker Hub, which is not okay. This will not find it. But if I want to do this, I have to ensure that I specify my Docker Hub username, slash the name of the Tag and Placent. Then this will automatically go to my user nm, to my profile or Docker Hub. With this done so I can copy this let's go back to this terminal and Docker push. Then we want to push this S, then the tag is one do zero. I'm saying push to my own profile. This profile with this username. Let's see what happens? All right. You say this works. So it's saying now is pushing to IO Zico Z, then this. Before now, it was saying Docker IO Library Library default, which is the general available one on Docker Hub. But this is now going to my own projects, and this is awesome. While this is running, I would go ahead to push for modulator also so that we don't have to wait on this video to have that done because apparently I want that already available. What I'll do is I'll post this video. When this is done, I'll come back to you guys. All right. All right. This is done. As you can see, this is completed successfully. Let's go to my Docker Hub. I think we can even check from here, right? I believe this is available from Docker Desktop. If you've logged in, I've logged in here. I've logged in. I think I can see my remote images. Am I wrong? Okay, Hub, this is hub Hub Hub Is Local D Hop. So let's check my images, right? So can you see I've pushed the modulate and I pushed that for the Demo cad both are available on Docker Hub, right? You must ensure you do the same thing. Remember the command to use is Docker. Once virtually but the image, you must build the image with this tag. I just showed it earlier. Please kindly refresh the videos to check. You build this tag, which is your username on Docker Hub. If you don't have Docker Hub account, you create an account, it's free. Docker Hub, then the tag isn't in this, I think I showed it here. It over here. Let's just go up a little bit. You can see this I do I but it with this tag. Do a slash slash. What is before the slash indicates your username, after the slash is the tag name you want to use. Then if you don't put any of these column dis it will resolve to latest automatic coal but from this and dots means but from this directory, current directory. Then I can then push. I've done the same thing for the moduli, and that's why. Once you've done this, once you build this tag, what you will have here is this. You have this guy and the windows. This is tag I placed it. If you don't press it, remember you have latest there don't be alarmed if you forgot this and silt just means once you're doing that, you have to specify the keyword latest or you omit it, then to pull latest. If you use a number, I've used, you have to specify the exact same thing. This video is getting way longer. I'll get back to you guys in the next video. 8. K8s Pod 2: Alright, guys, thank you for coming back with me. So I showed you guys how to push the image to your Docker Hub. I took my time to explain. Please you can watch the video to watch and take note of the key points I mentioned in order to achieve this. Remember we're getting access denied. I tried login and I discovered it was not that I needed to pass in my username. So my username was very key. Passing the username I built using my username, I'm showing it again just for reference so that we can remember. We built passing your username, then slash the name of the projects you want to use, then one do or you use any tag name, then that's dub it from the core working dict explain this when you're building the Dale, you can check Doceri pat one to see what I used here. That's the first part, then you need to push. I need to push, just pick this exact same name you've used, use Docker push. Then this exact same name, which I showed in this terminal, Docker push the exact same name. I've gone ahead to do the same for modulate. All these are test project. With this done, I think we are good to go. Now, why did we do this to actually refresh? Kubernetis doesn't know about your local Docker registry. It pulls exactly from Docker Hub. Because I'm using Docker Registry, I'm using Docker Dektop, it will assume to pull from whatever registry I place it, honest if I don't look for that image anywhere on DockerHub because that's the default it uses except to give it a private ripple and you have to give it a full context. That is available on Cuberntis. But since you're using Dokaes just stick to what we're actually learning here. You have to give the user name, slash the project in just exactly like this. This is how you have to specify your image. If you don't do this, it will not find the image, and that is why we're getting the Docker Po because there was no image called demo hyphen K test one dot zero. With this done, I'll copy this and go back to the command we're running earlier, the command we're running earlier. I can just come back now up cutter get PO This is the area having image poll. Let's delete it. Let's delete this image directly because we don't need it right because this image isn't working for us, do a delete. It deletes, I think the start should be here on the command here. I don't think so. The cube cut you should be used to it, but this by now, deletes then pod, which is a short form of pod or pods, then demo, then dash dash grace period. I want you to end the mis immediately, then zero, then dash dash four. Alright, so that is done. So we do a cube, cut two, gets PO. You see, there's nothing here. Oh, default name space. Okay. I actually switched it, so let's go back to the other guy we were running earlier. So I would go to the command. But you don't have to just know the command you're picking. We're using the test name space, the test name space. So back to the text name space. Then let's view this Yeah, cool. This was for validation. Remember, if this command doesn't work for you, all you need to do is just to keep cut gets pulled. This is running on these guys, I just delete. So get called. You see? No, it's just in test name space. So now we are back to test namespace. Let's run the command we've been running before now, which I showed you guys earlier on what to use. That's a direct command without using the file, which is this. Remember, this was the issue we're having, so I'll place it as Z call Z slash. I expected to go and pick image from my registry, I'll pull this in. Let's test this out. So do a cube utu gets pulled. I told you can dash dash watch to see it run as if it pulls. Now, you see there's a difference. What's the difference? Before now, what we're having was this is running, there's an error. This is running, there's an error. The error is different. Is it what have you done wrong? Oh, very simple. What I've done wrong is this. Let's take this off. That's lats. A for lats. Let's not describe. Ubeutu describe. Pod demo. Let's see what's happening. I then let's look at this. An issue is happening. You can't find the issue. If you can't find the issue, there's now another option. If you can't find it in describe now you cannot check the logs of the container. Remember, I've show describes the describe that gave us this so let's clear this off. But the cube cut two Logs. Remember, demos pod. When logs, definitely works for pods, pods it works for and pod name is demo. You see, what is it? It's looking for spring profile, and that is very accurate. You see, I want you guys to see this. You guys see this. Remember, in the doc file, we are saying you should use whatever we pass in the profile to be the profile here, whatever we pass here should be the profile, either for Dev or for Docker. Remember what we are trying to mirror here is Docker desktop. I'm trying to simulate for the modules. So coming back here, I created the Dev environment, cred it Docker environment. So I want to actually pick the profile Docker. And because I didn't specify anything, it doesn't know which to use, it's actually defaulting to the default. And once it defaults to this, it doesn't see it. So now we have to specify, Hey, I want you to use Docker. Assuming we specified the tar level here, this will not cause an issue because the Dev would have actually resolved directly on the lights? So it's looking for the spring profile which is set within this guide. I'm repeating in different ways so that we can understand. Customer understand in a better way I place it. That's what I'm trying to achieve here, right? All right. You can rewatch it again. When you hear me say some things and I flip it around to send it different to you, I'm just trying to just pass on understanding in different ways. What do we do? What are we going to do? Now that exists the issue. The issue now is, I moved on from Pod Pod is now able to work, but now we're saying we need to pass in the environment variable. How do we pass in environment variable? Awesome question. That is where we now come to the next bit C config map, config map, and that is what we're looking at the next video. 9. K8s pod 3 configmap: Okay, thank you guys for sticking with me. Now before now, we've been doing everything from the imperative style. However, if you're now trying to create the config map from imperative style, yes, you can do that. This is very straightforward to do. But things start getting complicated, and that is what I need to show you guys that you could do this from the command line with one command to get in one. Imperative style, I can create the config map. But for you to now see how it wires in to then wire into the pod will become very confusing. I discovered that it took me a while for me to actually leverage this also. But please note you can create a config map. You can directly create the config map using you can create a config map using the path that I told you about using the imperative style, and that's exactly what I'll be showing you guys right now, to do that, what we will do is that I will show you how to create a config map. I'll just show you the documentation how to create a config map from from uberts documentation, how to create conflict map, then we then move on to using the declarative style because it's easier to be able to spot how to connect the config map from a declarative standpoint, d from the imperative standpoint, and that is what I'm going to do. So I will do this create a config Map. All right. Uh right. I'm showing now, I'm coming here and I'm showing how to create conflict map. This has to create conflict map. Just type in the documentation iscubanziO you can see, you can create using the imperative sys creates conflict map, conflict map, the short form or the short name is CM, CM, C and M, right? So it creates conflict map, then you pass in. Then we saying if you want to pass on file, then you actually set a key value pair. Or if you don't want to pass on file, you could then dash dash from literal, then the key and the value. Then if you use a gyro, remember what I told you about gyron is to create the file for you. Let's go ahead and do that. Let's go ahead and do that. I'll do Kipct creates CM, or you could do configmap it is both the same thing. Why see him, then dash dash from literal. If you do from file, I would suggest using from file. If you have a large number of environmental properties you want to pass, you list everything in the file in key value pairs, then you pass it in. But I'm always comfortable using this guy from Literal, which is always fun for his use. F literal, then I pass my key. The key, remember the key is spring, iphone profile. And the value is what? The value is Docker, right? Then I want a dry run. I don't want to run it on my compont yet. Dry run. I just want to get the file. When I get the file, then I will link it up in a different file that has a pot, then we'll see how it works. Then client, then O, YamuPlease note there's also you can place Jason here. We get Jason for you. Let's do Jason. Let's say I'm not wrong Le's just say Jason. Dash was this? Okay, sorry, I didn't pass the name. So creates ConfigMap. I'll just call it demo. Let's give it the same name as Demo. Can you see? This ret has Jason. You see, it gets the key value pay. I just want to show you guys that this is really amazing. You can pause it here guys and explore it a little bit, but I'll just move ahead so you can continue with. So I come in here and pass it Jamo, right? Amazing. So there we have it. This is exactly what we need. I will move this into a file called. Remember, we already have a file called Demo or Yama, Demodo Yamo. But I run this in a different terminal, so it will be on a different so I'll just place Demo or Yamo. If I do a cat, Demo or Yamo, can you see it's already exists in this file. Now, I would then go back to pick the last command we run for creating the pod, For creating the pod. What's the command again? What's the command or I didn't run it on this terminal? Okay, what I'll do is let's get pod. I see this one let's delete this. Let's delete it. We don't want to keep this. Let's delete it. This is the command I'm looking for. I pick this command, hold it, then let's delete. I'll delete the pod. I'll bring in this command here, This command, then I would say dash dash dry roun. The same, I don't want to run it. I just want to press everything together. Then client dash all YAML. Then I want to append into the demo or YAML. Remember, when you use a single a forward sign that's a greater than sign. It will recreate the file or it will cancel everything that's within that file and recreate it. But if you do the double greater than, it will append, let's try that out. Let's just do a CAT demo dot Yarmo. Can you see? This is a pen I look at it. It started from here. I need a space. Now, if you want the ubertith run a configuration file for you to have several resources, you don't need to go into the file and make it look like we do a VM, I have a VM. VMI is just how to actually edit. For guys that use Windows, I don't know what VMs, you don't have to worry about that. All you just need to know is just open the file in your notepad and do this. That's all it means. Come in here, then you put in three dashes, three hyphens, this, this, this. By placing this in you're saying, this is a resource, this is another resource, and that works for us. Alright, so if I do a CAT demo, guys, you can replay this video to check exactly what I've done, to say exact and you would understand. Now, remember, I did not create this manually. I used imperative start to get it for me. You could have gone to documentation to picket, but that's my style. I use imperative to get the command. I use that gyroon get the file or get the declarative format, pass it into a file, create another resource on it, pass it in the same file. Then I connect them together. So the question now is, how do I connect this config map into this pod so that the configuration for within the environment properties can be seen. Meaning this pod can be able to go into this config map and pick this property upset. How do I do that? So instead of me showing you directly, I want to also make you comfortable using the documentation. So I would do is we would then go to pick. Now, this is how to cut conflict map. So how do you use it in a pod? If you scroll down, right? So let's go down, so config maps, I'll do I'll just do ConfigMap. If I do config map, you would see configure pod to use a config map. If you do this, let's go down. You see, I create it just same where I showed you guys, then let's go to a pod. Now this is the output, create configmap on file. This is how to create from file. I show you guys you have a lot of properties, this is how to create from file. I showed you guys so much. So you can create from file. I show you guys earlier, so you can pick, then pick the name of the file and like spots. I want to wire to a pod. That's the goal here. That's the goal. Okay, I'm going to pod. All these are config maps. I'm going to pod, pod, pod, pod, pod. Define the container variable using? No. So that's easy within a pod. Use config map to find in port command. Okay, this is a port. Let's see. You see? Now, I can pass in a config map key ref. If you don't want to pass in the entire config map, you could pick only the property you use. But most times, I don't do this. What I do is, this is good. When you are using the same config map for a lot of value, let's say you have the same application that using the same config map. But I really don't find it ideal. If you have an application, let the application be wired to one confine. One application one conflict map, one application one config map. That is what I actually prefer. I just want to show you guys this also exists. Cobenc is quite seriously dynamic, and it's really, really fun to use. I just want to show you everything. Now, add convict map data to volume. Let's see. The volume populated volume, this is not what I'm looking for. Add convey specific park volume. That's not what I'm looking for. Let me just pause this video and I'll be back. Okay, guys, thank you. So I'm back. This is configure all key value pairs in a config map as a container environment everything will be used, all this will be used directly. So that's what I was looking for. So now that we have it, come back here, if you see this, we just need to pick this.Th would be under because this is Yam Under name image commerce environment from config map. So this is what I need. So if I come back here to my so I'll do a VM. What I'll do is let me see if I can split this screen. I think Windows side. Then this great. I think I can split this. This is what I need. I just need to actually set this part here. I'll just do VI demo I come down here, it has to be in the same line with this. Same line we see the same line. Image I see image, name, has to be the same line, else, it would not find it. EMV from Then this config map, the same name, please, the same name, how it looks like the exact same name. You shauld not show your typing correctly, just copy. Then column, then Sa space name. Remember it's MO, you have to ensure that too. What's the name and the name of our confining map is also demo, Is also called the demo. That's what I like to do. If your application is like a payment service, let's just configure the payment service. If your config map or payment service map, I like to give you the same name so that you know the exact same I'm using the exact same thing. All right. With this done, we've been able to successfully configure everything we need. So if I close system, if I credit if I cut the demo file, you see, this is now referring to this. Because this is appearing before this, this will be created, then it would then wire this would then be created looking for this config map. If it finds it, then it picks the property and it uses it. So that's the wonders of Cubans, that's the wonders. To then use it, you have to do cube, cut two, apply. So people wonder, but they've seen commands like ubcotu create and Qu Cotul apply. What's the difference? Cucuu create simply means you've not created a resource before. CuCtuL Apply means this resource already exists. However, the resource file I'm trying to define, the configuration final contain changes. So please check the changes and updates because we use CPC to create for an update, if you tell you it's already exists and ran but Cotul apply would always on. I like to just use Q Cotul Apply. If it's a new one, if it's an old one, it will always work. So that's the trick I used. Then F then I pick the file. My file is a demo amo. See config map created and this creator. Let's spa this config map will come back to this to see if everything work correctly. Due cube cut two config map. Remember, just get CMs demo. You see, this exists. This is not show anywhere. This creates successfully. I'll do it describe, that's what describe. This describe you see the data there is this and the value is this is awesome, guys, awesome. Now let's explore a pot. There's also a command Keep cut to get all. So this shows you the pod shows you the service through this deployment, we don't got the service yet. We're just running this. You see, I'm not even run everything, it shows this guy is already running. This is awesome, guys. Cube cattle gets peel. You see, this is running. Meaning it didn't fail. If I were to explore, let's log it. Cube catuGs logs, or Cucatu logs. Mm I showed you logs, it's for pod. Cat logs, then I pass in the name of the pod. Can you see everything created? I found this and was able to run successfully automatically wired the config map. This guy is definitely okay. So what is the command I used here? Let me see my scratch? Remember moles using open it. You can use a postman here. So I'm using deployment here. So this is what I'm supposed to call. Now, we would encounter an issue here. We will encounter an issue. I'll show you guys what the issue is. Remember this is just a getter. I can use a curl, right? If I use a curl, just pass this in This should basically work, right? You should not have any issue. If you're to connect, there's nothing on ATT. Why is it unable to connect? This is exactly what I'm trying to bring out. You must understand that a pod is an environment. You have a better way to actually explain this is to actually bring up my Joio so this might actually give us because if you don't understand this, you struggle, and you wouldn't even know what is actually happening, right? I want to reduce this a show. Yes, we can. Discard? No. Discard, okay, discard, yes. Okay. How about this stops I created some time ago. Let's get a new one, a blank. Alright? So there is. So think of it like this. This is your whole system. This is your whole system. Later, this is your whole system. Now, your whole system can be a node, Cuberntis node is a linear system. Every Kubernetis node is a system, right? It's a node. Now, each node, I'll just explain it might not be accurately, but as gas on the. Each system node now has a Kubernetis cluster. This is ubertis. So this is your operating system, the Hals Docker dektop, right? Which is your host, I suppose, where you can connect your 80 82. But there is an environment which is the ubertis cluster. Within this ubertis cluster, let's zoom you now have a pod in here. You can assess this. You're just hitting this when you do 80 80. AT ET is only hitting this guy here. So ATAT is only hitting this guy here. It doesn't come in here. This is your pod. Let me give this a text. Pod. Let's say this Kubernetes cluster. Let's say it's Cubernss cluster. This is your host. The host could be a Linux system where the Cubans was actually placed. Most times it's always a Linux server, and this is a host. While you hit ATT, this is what you're trying to hit. This cannot even come in here at all. That's a security layer. Now, which brings us to the next step? How do I assess the pod from the host from the host system or the host itself. I'm talking about quante did port. I want to assess it outside we are doing. How do you assess it? Then there is a concept called port forwarding, Port forwarding, which I'm going to explore in the next video. 10. K8s pod 4 port forwarding: All right, guys, thank you very much for coming back with me. All right. This is Z here. Now, I explained that this is what you're trying to hit. Every whole system, if you look at it, has zero to 65,535, I'm correct. Pots, right? So when trying to hit this is different from this server, right? Now you're having a Linux. Now, each container, remember I mentioned to you guys that the pod will contain containers, A pod will contain containers. You must understand that the environment which that's even running that your application is running on your container is like a system in itself, that has is on pod. The as is on pod, I mean to say. What I'm trying to bring out is this. Let me bring this out. Let's expand this a bit. Suspan these a bits. Let's span these a bits. This bod contains a container contains a container. I just want to explain this contains a container or containers. Contains these containers, right? And the containers itself ten guy to understand this, this container is running an application that has a system in itself that has zero to 65,535, right? Pots. This guy This guy has the same thing. So you're trying to connect these pots to these pots. You want to forward a pot here. These pots should be linked to a pot. So what we're trying to achieve is to link a pot here. Why is this item moving? I think it's trying to see take this out, so let's bring this guy here. So let me bring it here. So this should be connected here. And this guy should be connected to this. Alright, I think you should do. Yeah, this should do. So I'm trying to connect a pot here to a pot here. So if I hit a pot on this host, it would then come to this container, where my application is running, and there it hit it actually hit the same pots. Because I need you to rewind this video to listen to actually understand what I actually mentioned again. The pots running on your host wants to be linked to the pots running on this guy, and that is exactly what we want to do now. That's a concept in Cuban is called pot forwarding, right? Pots forwarding. Now application is running. You want to connect a pot on this particular system, remember this even Ubuntu, right? A Linux system to the container running this guy. So how do I do that? There is a concept you then do a cube cut a cube cut two, I hope I remember the command. Then we'll do first of all, what's the name of the pod? Get pod. This is the pod name, remember, please keep that in mind. Then what we then do is well then do cube cut pots forward. Pots forward. Then the name the name of the application name of the pod name of the pod, remember the name of the pod. That is the name of the pod is demo, remember the pod is demo. Then we want to link eight on the pod to wonderful audit to ATAT on the host. Now we can see this. What is it saying? It is forwarding from the local pots, this local pots. That's local container. It is forwarding TAT to the hosts, which is AT. This is not running in the background. Then I can come in here. Let me just come in here and then split this. You see, I was just split the screening. I can then do a call. What I tried assassinated, I wasn't working. Let's do a call. You see? I got the response back. I hope this concept is clear, guys. Let's make it pretty, right? Let's make it pretty. I think there's a way to make things pretty in I think it's Is it JQ or JP? I can't remember now. Sorry, I can't remember now. There's a way to pretty format Jason Jason entries on JQ or JP? Is it pretty format or something? I can't remember. Okay. Let me just how to pretty format. I think it pretty format pretty formats. Let me just set your line's pretty formats Jason and Linux. Put it former Jason Linux. What is it again? Pretty Prince. What is it? What's the command again? I think it's Jason. I think it's Jason Jason underscore PP. Is this correct? Yes. Yes. You can see? Jason underscore PP. You can see I'm able to actually connect. Guys, I hope this concept is clear. Let me go over it one more time. You have a server, which is a host. Cubansis was deployed within that container. Within that host. You now want to assess you want to call your service, which was deployed with Cubansis container. These two are two different environments. This is a different environment. It's an isolated environment within this environment. Both are running their own data, but their own pots. I want to connect the pots from here to the pot here so that when I hit this host, to forward to come into this and call whatever pot I forwarded here and that will work. To illustrate this further, now consider this concept here. Let's close this up. Let's forward Tight to 1991. So if I were to now call 80 eightK what would happen? Can you see? He doesn't understand this anymore. However, if I now forward it to 90 if I now call 1991. Did I get this correctly? What did I miss? Local hosts. Connection. This is okay, let's see. Handling this, this, this. Just the minutes. Am I mixing it up? Just the minutes. Let me push this 90 1991. The eight. I mixing direction, probably mixing it up. Okay, let's try this. Oh. All right. So this is for the hosts. This is for the container. I thought I was doing it the other way around. I believe you understand the concept now. So I can change post the pot I want to actually connect it to. So guys, we've touched pretty cool concept here. I've showed you guys how to do a whole lot of stuff. The concept you're currently looking at spot forwarding because you could not access we deployed a Cubertipod which is connected config map. I understand. I believe you can relate that, but we still did not know how to connect. So that's our application, and that is where the concept of put forward and comes up. There are better ways pod is not recommended it's not recommended for GD play to pod. That is where the concept of deployment come to be. But the concept of deployment now has to come with something called a service, and that service can then be like a load balancer to then reach out and get all those details. More of this coming up, but in the next step, you are going to explore service in the next video, see you guys in the next video. 11. K8s service node port: All right, guys, here, thank you for coming back with me. We've been able to explain these details, and we'll be able to see this. This was the path of pod forwarding, so we are no longer using that, so I'll just queue this. We still have our pod running. So keep it toil gets PO. See our pod running. So how do we expose Z a service? You could actually go in there. This is a very straightforward command, we just use expose. Then we want to expose then the name of the service expose pod, you are trying to expose the pod. Then we will probably give it a name want give it a name. Let's call it demo service. We can do this. Then you're trying to actually assess the pod from, let's say, let's just use the same thing, ATAT. Then the target pots. I would not run this. I would just do a dry run target pots. Target pods, T. With that in mind, let's see. Let's see now service. This is demo, yeah, yeah. We need the name. It is the name of the pod that which is demo. Then that's the name of the pod. Then what is the name of the service? Name? Then let's call it a demo service. I think I was mixing that up. That'll be demo service. Then I want to run as a dry run. Let's see how it will look like. Dry run, then lens, then O, DyamoH does this work? Alright. Can you see this guys? This is just interesting. Very interesting. So now, I'm able to run a service. So there's a concept called service. Services are of three types. We could have them as a cluster IP, could have them as a ud balancer. We could have them as a ud pot. What's the difference? Cluster IP is not accessible from the outside. This is the type of service you use within pods or within services in your coupons cluster that is not accessible to the outside. So no one will be able to assess you used to actually maybe wire service. A good example could be you have a front end running in the same environment as your back end but your front end wants to assess a back end that has several instances. So unless your front end also have several instances, I can't call it pod directly. I would rather want to call it services that would load balance to several several pods. That's the concept. I need you guys to listen to this part again. You want to actually connect to a service or to a pod that have several instances. A service is the idea. Service is like the interface that stands in front and connect. You could have it as a cluster IP. That way you could connect and once they're in the same environment, you could actually pick out the IP. I wal render the IP of your service and the IP of the service can resolve to your pods running your environment. That is one bit. If it's running as a node pod, node pod simply means I want to assess the pots of this service from the outside. Just the same way we did post forwarding. That's what node pots. Se node pots are spot forwarding. I want to see it from the outside. Then Load balance, as the name sounds, you want to just load balance everything out, but we would not explore load balance in this section because Load Balance typically work with service providers that have Load balance platforms, which would then probably have a domain name, actually mapping through it, which you can access probably HDP as wood.com and the like. I hope that actually sounds better. Okay, this part mean by side, we can't access load balancer, so I would change this. What I would do is I will then create this within I will create this and append it to sit to the same file. So demo dot Yarmo. I'm sure you guys know what I'm doing this. Carts or VI demo dot Yamo. We have this here. I will actually come in and do the same thing here, dash, dash, dash, right? This time around, Remember, the target spots, they say, there's this part. Now I'm going to add I'm going to add a concept. I'll show you guys bring up the documentation. Bring up documentation. Let's look at not ports. Not pots. I just a contrafind? Not pots. These are note pots see the usage, a type, notes. You see, we now have to use a type, note pots. See don't remembermPk it from Where is the label? Just fine. It's under spec place under spec. So under spec, I will have a type node pots, and when you have a type node pot, you have to ensure you pass in the note pots. You see, NodePots is only available in this range. You can't do 88 with the node pods. Remember, I mentioned that pot is 0-65535, right? But however when you're using node pots you have to pick within this range. That's what is only available to you. I'll pick this guy already allocated in the pots. Pot is a pot is what the pot that the service is on on. The target spot, the target pot is pod the pots of the pod, the pod you are trying to access, right? I explained that in the last bit. Then the last part we're trying to do here. I'll come in here and I'll set a node pot. Node Nude Hots. What did I just do? Oh, man, I messed the file up. Let's do a boots. Let's edit. This is what we're doing. Okay. So spec type node pots. Node pots. Is that accurate? So let's confirm that. Yeah. No pots, then the last parts that come in here. Okay, still in edit mood. The node pots. Then let's pick the range. Remember, 3,000. 30,000, I just pick 10,007 or I can just use something different that we're using here. I can just pick 32,007 60. It's still within the range, 30,000. 2000 sorry, 2760, still within the range. 32,760. Yeah, I can pick this and this would work. Now, we're now using a load balancer, so I can basically use it. I can take this one off. Now using a load balancer. I've taken this off. Remember, I have distinguished it. I haven't. The file was messed up so some here. I'll do this. I'll save this. All right. So Kat's demo. All right. So we have this. What I'm going to do, remember, I mentioned if you have the service on before you can then apply. Other than we run, create, we run, we want to apply now, do a cube. I use this guy to actually expose. I'm sure you guys can relate in case you need this, right? Show you guys out to actually put forward. You show that also. Yeah, we show that. So uh yes. We will do this. I just want to go up a bit and pick the pot forward. Remember, the first guy here is for the host, while the second one is for the pod itself. I just want to show you guys for pot forward. I've actually added the commands in, so I wanted to just update my list. Now that we have this, what do we do? I do remember CAT demo amo, then we have all this. Everything we set it up, can then do cube cut two apply. Remember the difference in demo. So can you see this didn't change. This didn't change, just like, oh, it's been configured. Concord was just created new. This was just created new. Let's explore. Keep cut Kcat two gets PO SVC. And you guys wonder, what did I just do? I didn't do anything. When you want to call two Vss or three visors together, you could do this. You could separate them with a command and it will get everything for you. This is everything I'm running. I'm saying, get me the pod. Get me the configuration map, get me the pod and get me the service. I'll actually add this command also, so it's also available to be used. So you get that and you can see, we're running all this. Now, Asumi isn't a load balancer, a load balancer automatic be mapped a public IP that IP were available but we're not doing that now. So this is what we are doing. So we have to you see this somewhat like a pot forwarding that is now forwarding 80 80 to 32,007 60. That's what is being done almost like internally. Do you understand? So with this, let's now assess so we can't assess IT to be assessing from 32,760. Let's do our Kern. Just the same we'll be doing it or kern. What is it call call? Okay, yeah. So the Kern, this time around will be assessing from that pot like 2760 then as we've done before, let's format, Jason on the Sco PP. All right. You see, this works. This works good. I've been able to explain to you guys how you can use service in coberts, how you can expose. Once you have a pod running, you don't need to actually start worrying your head. Just use the command to expose, expose it. Then remember, as I also mentioned, you need to actually change. You need to actually make the mode pots Notep I told you note pots is more like pot forwarding. I told there are three types closed IP, note pot, load balancer. Load balancer is for cloud providers that automatically map a public IP, which you are not doing here. What's the name? Close type is used internally to communicate internally why mood pots is what we are using right now to assess it from the outside. And that's exactly what we've been able to achieve here. I hope this is cool, guys, and I hope you found this very engaging so far. All right, with this done, we've been able to actually connect their services, right? And the last but not the least we'll be talking about, which is the gun master of it all, which is used in production. So pot forward is not used in production. Service exposure for pod is not as in production. What is used is deployment. I repeat what is what deployment. So deployment is what is used because deployment avails us to be able to set the number of instances of the pod running at will. We can scale down, we can scale up. We do all this? Who do all this. I'll show you guys how it works in the next video. 12. K8s deployment: All right guys, thank you for coming back with me. This is Z here. Now we've gotten to the most exciting part of using Cuperti which is deployments, right? Not the most exciting about this. Pretty fun, really. At least that's the crux of what we're trying to achieve here. Now, we can't use the already created pod because deployment is supposed to manage your pods, supposed to manage your pods and supposed to build to scale up scale down, you can increase instance, instances. With that concept in mind, we need to queue the pod. We need to quell the services are available. We need to queue, but we can leave the config map because the config map will be used still wire it in. What do we do? I would explain this in detail. Cube two. For those that are tired like me, typing this in so you can just alias. Alias, Q two, you can just set key. So we go to Keep Koto, right? Kupkato. So you see a skip Koto. I can do K. Okay, get CM, SVC. SVC means services. You can type in services or the short form in SVC. Then what PO pod. Then services in no particular order. Then you do this, so we have everything, right? So I want to remove this guy because you don't need it anymore. What do we do? I would queue Delete pod. Okay, what, let's delete the service first. Delete SVC SVC, the name is Demo service. All right. So let's run this again. So you see, we don't have service anymore. So let's delete the pod now. This is POT service sorry, this is Demo rather. So demo Grace period. Grace period DF. Oh, sorry, dash, what you dash. That's go. Let's check it again. All right. We only have this available. Now we then need to then create the deployment file now. We wouldn't be using the service would be exposing the deployment file. Not the pod anymore. Remember the pod, the service expose a single pod, which is the pod we did earlier. But imagine if you now have several instances of a pod. The service would then be connected with the deployment which is managing all the pods and exposing them from one single entry points. So once you hit it, it will be going to any of the pods by default. I'm sure it's more like it would not be a round robin, like a load balance and automatic load balancing within the deployment when you hit it via the service, to then tick which one is less busy and come back to you. Keeping that in mind, how do you create a pod? K, create, deploy or use deployments in full. Deploy is a short form, deploy, then the name of the deployment, I'll call it demo deployments. Then dash dash image. What's the image we're using? The image you're using is Zico Z, remember? Then demo hyphen, KHS, then 10. I'm sure this is Clays, then the pot, what is the pot you're targeting? Pot is ATAT. We? Yeah, ATT. Then let's do a gyron. Dash gyroun lines, O, Yarmo. How many replicas we want dash dash replica, Replicas. Is it replicas or replicas or finals if it doesn't see it. We want less three replicas, dash dash replicas, three. This is what the pod doesn't have. All right, Sky easy. I'm a replicas here, and this has given me exactly what I need guys. I would leave the demo file we've created so far, I would leave it alone and I would process that I would actually post that in a resource folder. So we are going to do is let's wire this in into a file called Deploy. I'll call it demo. Demo deploy. This should be the best demo deploy Yarmo, Thermo deployed or Yarmo. So do CATs, then deploy, so we can just have everything together. Then deploy. You can see we have it. I will go ahead and then do a CATS demo dot Yarmo. I remember we need the pass because it needs to actually assess the pass for the conflict map. I'll do a VI demo deploy, then I will do an insert, then pass this here, then come back here, then do hyphen hyphen, hyphen. Now I have my config map. My config map will be coming here to wire it in. Remember we also need to then come in here to then wiring you're wiring the config map. Remember? This is in the same level as this part, this environment from hope I got this correctly. Then let me just go to this file. Let's just go to this file. So I want to do is let's go to this file here. I can just cut it directly demo yamo. So this is what I need environment from then config MapRef. Then what's the name? Name is Demo. All right. You can see guys have been able to do this success with it. This is exactly what we need and we've been able to actually achieve this. All right, guys, this is looking good. This is looking real good. We have been able to actually do everything we needed so far, and this is actually quite accurate. Alright, so we actually have this actually settled. So I believe guys, you guys understand what we've done so far. We've been able to actually wire this in replacing the deployment file. Deployment file now uses the config. So the deployment file is what we're using now. So let's run this. Let's see this accessible. If this is accessible, that's a great win for us, guys. Then we'll just be able to just expose the deployment from the service, and I'll just take this exact same format, right? Exact same format. And it would be good to go, guys. Alright, so let's do this. So I will do this. And all right let's run this file. Let's run it. I'll do, once again, let's ensure nothing is running. You see, only the conflict map is running, so I'm just going to clear this. I'll just cut two apply because conflict map is existing. I don't want to recreate it F, then Deploymo deploy, let's run this. You see, demo created, deployment created. Let's run other command This time around just start deploy. Give me everything. You see, we have three instances running. Is this not interesting, guys? You have three install because you see the pod, is showing the number of pod existing. Three pods are running because it's three. Three deployment because you get the three instances using three available three, and this is what we find. This is just amazing. This is amazing. Kubernetes is just amazing. I need to show you guys for you guys to see how it is and enjoy using Kubernetes. Now that we've done this, we need to know if it's working. We need to really know is this working or not? We need to expose. We need to expose the deployment. We need to expose the deployment right? And to expose deployments, we have to run we have to run the application. We have to run the expose service to actually do so. So the same way we achieve the last one, I'll just do that and I would append it to a deployment file, and that would make things actually move more more spontaneous manner. So how do I do that? I do PC two, expose deployments deployments. Let's do something. I need the name of my deployment file. Okay, that's the name. So you remember I've used that as, expose deployment, or I can say expose deployment, whichever works for you, deployment. What's the name? The name is demo Deployment. Demo deployment. Demo deployment, that's the name, demo deployment. Then what's the type? I want type. I want type. I want type node pots because that's what we need, Node pots. Remember, we could create this declaratively. You can go check documentation, but I'm just showing you guys a simple way to just have this actually wired. Then, what is the pot of the pod you are trying to assess? The pod the pod is 80 80. Let's do a Gyro on it. Gyron liens O. That's O Yarmo. You see? This gives it to me. It gets the service. I'll just do what I will append it to my demo deploy file. Awesome. I'll clear this up. Then do VI demo, deploy, and I have that. If I come down here, this is exactly where it is. It starts from here. My do this, then I just do dash, dash, dash and completes everything I need. Remember, when you're using a node pot like I showed you for the last part when we're exposing a pod, you need to add two things. Number one, you see the type node pot has been added to it, so it doesn't matter it's above or below, but must be in the same line with this pot section. This is done. The next target is you need to add your node pots NodePort, which node pot you want to access it from. So I'll just stick around. I just use random. So 32 000. Okay. That's so 32,000, so that works the rest. So with this done, I'll just do this. I'll just all right. Now that I've set everything up, you can pause it, guys. Let me just cut it again in case you want to pause here, just to cut them case to cut, so you see, is that what it looks like. So you can pause and see compare with what you've generated from your own end. I make sure everything is accurate. Once you show everything is accurate, then you can do a K apply. Remember, I'm applying because I now have two resources created. I don't want to recreate. But as you cube, apply, then demo deploy. So you see, this is not created. This is not created. This is created. So let's now do let's now do all this to get everything. You see, we have a config map, we have a demo, we have a port that is running, no errors, you have a note ports. This has a closed no exon explained what the En yp is in the last video. Then we also have this, which is pot forwarded to 32,000. This done, I'm going to show you guys something a little bit amazing, right? So I'm glad I'm using this guy. I'm glad I'm using what's the name? This terminal. This terminal assist me I can split screen, several screens. You can see I have another screen here, right? Now under screen. Then let's get one more screen here because we have three. So what am I going to do? I want to show you guys. Remember we could use logs. Logs could tell us which we are hitting per time. I don't know if I added logs to it, but hopefully we'll be able to get. I don't know. I didn't comment. Man, I think I didn't do that. What I wish I added some logs here. We see the log coming in, so we know which one is being assessed per time. We'll see which one is being assessed per time. I think that would be a great one because I would have exposed the three. I would have shown you three applications, right? The three applications. All right. Let's just do a demo. If I don't get it, then it's probably something I'll quickly rush to do then set everything up again. Wha I'll do is I'll pick this guy. And I'll do K. Remember, I can't do K here because I'm not done as, AasK Kekutu. So Alias, K to Kukatu I don't have to type a four K tenias K to Ku katu. Windows, I really don't know how to use in Windows. Okay. So with this, I then do a Kog K logs. You see? This gives me the logs. Now I want I want to watch it. I want to watch the logs. Log Kupkotpp Let's follow. I think it's F. I think it's F. Great. You see? I can follow. I pick this second guy. I come in here and I do K, logs, F. Remember, you could do DF before or after it doesn't matter. I follow him. Now you see. Then last one, I pick this guy and I do K logs, F. The last one. I had these three instances running. Let's do a call. Now, do a call. Then let me pick it from my sketch. Where's the sketch? This guy, I'll do a call, then I'll do a V. V gives more context. Me context. Then you get Gen. I want to run it I want to run it I want to run it in Was the name now. I want to run it. Let's say, everything in 1 second, and it should run very fast. I could use a watch, right? I think I can use a watch because I just want to keep hitting it several times. I just want to watch trying to remember the command now. There's a command on Linux that allows you. You just give it a time and you keep calling the endpoints. I think what I'll do is I'll do a call. Let me search dash, dash help. Is it here? For all options, use the manner of dash help, all. They have. Let's see, does it have it think's N or something. I can't remember now. N. Using pasa, that's not what I'm looking for. See now, Yes. I think I forget the commander was looking for. You could do a watch. A watch would always hit can watch N on Linux, then 02, then curl then what I'm trying to run, which is until 2000. Remember we send it to 2000. What this will do is when we add this will keep on calling the application rely every 0.2 seconds. Then you can see that it's hitting all these nodes, everything together, or everything. You see every one of them moving randomly, meaning it's actually load balancing automatically. But however, you won't see because I didn't add any log, so you'll be able to see which one is moving. What I'm going to do to enable this to ensure that we have that functionality and you could actually see that what I will do is I will add a log within this container. I'll do at SLL for J at SLF at SLL for J, as I left for J, then I'll come in here just before it prints, and I'll do Log dot info. Then I'll say I'll say it's code. Test Keke's code. Then I'll put a timestamp. I'll put a timestamp. I'll just say the timestamp and the timestamp will be system that's current times. Let's do this. Let's. Once it's on this definitely change. We see this being outputs every single time. What I'll do is let's quickly push this commits added log to end points. I just do this. I just push this very fast, very fast. I'm trying to watch the times almost 17 minutes already. Okay, so now that we've pushed this, the next thing I'm going to do to actually have this tone is VN clean package. Then dash this keep test. You guys are already familiar with these commands, guys. I'm just doing the same thing just to get this up to where we can actually deploy? So this to. Then the next step is Docker. I'll do it DRM Image. I want to delete the d Demo hyphens, then one do serve. Let's see. What's the issue g? No such image. Yes, yes, yes, that's ZZ deleted. Now let's build the image. I'll be Docker. I'll just go in just help myself. Docker build. Dash T, right? Dash T. Then I come in here dots. Dots. Alright? Okay. All right. So with that, so let just push gets Doka sorry. Docker push. The same thing. I'll just pick this. Let's call this 2.0. Let's code this 2.0. That would just be more awesome. Let's code this 2.0 to look like the next version, right? That would make it Docker Bud, 2.0. 2.0. This is more cvates. 2.0. With that done, I'll then do Docker, the same thing. But this time around, I'll do it Docker push, push the same thing. Push. That's not the p. But then I push, push Okay. All right. This will then push through because it doesn't have much details very fast because I already have most layers already available. With this available, while this is running, I'll then come here and pull everything down. Do cube cut, sorry. Delete, deploy. Is a demo deployment. That's what I called it. Deleted everything I stopped. So let's call everything that we have. Is let's delete the service delete service.This is Service or delete as we see, we see the name is what? The name is this guy. Okay. So there's no need for services. That's right. That's fine. That's fine. That's all. Okay, so let's get everything again. You see, everything is deleted. Now, let's check has this pushed successfully? This has pushed successfully. And that's pushed successfully. Come back here. I'll do a VI demo, deploy, then I'll change the image. The image in service, remember, is now what 2.0. It's now 2.0. 2.0. All right. I'm going to do with this, I'll go to Docker Hub. So if we check Docker Hub, if you refresh this, what's this guy? Refresh this, come back here. Why is there no refreshi? This guy is not refreshion. How do I refresh you? This guy, let's see. I don't want to go to Docker Hub. I just want to be here, call this here. Call this search this guy. Okay. I need this give me this. I know. Find this. Then now this is getting tricky. Let's go to DocHub Hub Hub. I'll just go in. This is D Hop. I'll just sign in. Username password. That's my username. My password is there same use the same guy. Okay, so you can say push this. Let's open this guy we check the tags. You have several tags available. So there's a 2.0. You can see. All right, no problem. I'll fix this later. So it is 2.0. So you have a 2.0. That's what I was trying to illustrate. Let's quickly go back. Now that we've done this, let's just come back in the next video to test this out. See you in the next video. 13. K8s test deployment: Hey, guys, Z here, this is time for testing. As you can see, I've created I've opened the Windows terminal, the Linux terminal. The first thing I will do is let's clear the screen. Let's bring in this. This deployment, let's be sure this is what we have here as you can see this ends with the seven F five, 785. So I brought it in here. So I'm just clearing first of all, this is a Clare so as to clear the logs and bring in and start up, right? So the logs. Then for this, same thing. If you see this ends with a 785j VR 77, JVR 77. So this is correct. I think what does this end with? I didn't check that. Okay. Do, NH correct. And the last one is Z nine, right? This one is Z nine. Let's see. Okay. All right. Now, I have there is a concept called watch which I showed you can use watch. Watch, let's clear this Watch, then it will hit the endpoint at the time you place, this is available only for Linux. When we do this, you will see everything being touched at the same time. That's shows that is being load balance. Remember, we are calling the local hosts 2000, which is the note pod you access. It's going through the service load balance into all the pods. Let's hit this now. Can you see? Everything is being assessed. This, this, this is just going all the way, right? So this is a good test for you to know that things are working accurately, right? So tests for Linux, Windows guys that got you covered, don't dismay. So the same thing for Windows, you just do a watch. So our providers watch those bats to be in the exact formats. Our providers watch that bats for you guys to use for Windows. Then do a call and do the same thing unless hits this. You see, it's working accurately. So this is awesome, man. All right, guys, this is exactly what I wanted to show you guys. And for those that are curious about the content of the watch file or this is the content of the watch file, the content is just that's all you need to do, right? So you can credit yourself. If you don't use the file, you can just copy this or just type it in. But I provide a file, I make it available to you guys. Now that we've been able to test this and we see things working accurately the way they should what is next? Remember, we have to shift to a demo project to quickly assess how things would work and were able to accomplish that. So the next thing we need to do now is we need to our base projects we are working on which you are aware about before we use this demo project, our base pod which is exactly what we use in this course. We will now bring in the image, configure the config service, use and set up the deployments. Now, I won't expose pod anymore because I just showed you how to do port forwarding, but we expose the deployment, create a service, then we then test it out to see how things work. This time we're also wiring the database. See be a bit tricky, but it get it done. See how the database can be used. Rather than using a local who soul probably be using the IP of my system. So the IP of my system is exactly what's going to be used and that would be found. All right, guys, we'll come back. We'll come back to that. For this one, the IP, so there's a Neto CP. There's a IP that can be accessed or Sos the netoop I'll probably use. I'll show you guys how to do that. Once you hit the next video for the Base application we're working on. I'll see you guys in the next video. 14. K8s test deployment modulith: Hey, guys, thank you for coming back with me. All right. So now that we've actually done touched on the last session about combints and we use the demo project. Now we know the process is to cut the convict map, cut deployments that would actually point to the image, then a service that would expose some notebod for us to test. With that in mind, I've already gone ahead to do this. So you do Combintcrets, and bring in areas so I don't have to re type. So C creates, C. Then I just speak just two values. This is how it goes. Okay, you know what? Let me just re type this. That'll be quits creates don't follow when you type along, then CM is config map, I tris. Then I want to call it modulate, then dash from literal. Then you pick the property. Let's pick one, then let's pick the value. Then dash from literal nature, let's pick one with a number. This part, then there's five, four, three, two. Then let's do gyro. Clients. That should be a double dash, gyroun then Yama. You see? We have I'm going ahead to create the modulitFle for every one of them. If you just cut it, you just see modult right? So what do I do in may? So this is done. So how do I then poply do the values? Now, there's also an option of reading from a file. You could do the key value pair in a file, then read it in. If that works then that could be a great addition, right? I just consider it a bit of stress. But if your properties are much and you have people and you have people having to update it every single time when the application updated, I would strongly recommend you use the option of a file, then you read it in. It's daily documentation just to create conflict map from file and you say exactly how it is. You just need to create a key value pair a simple file with just be sure to name the file, key value pair, key value pair like this format. Actually have something in the formats, Key one value one, Key value two. Then check the combination sales wires and just wif where you guys save it. And that would actually populate it for you. That's a good one. So for me, I just manually updated it because apparently, it's not much. So I just manually updated it before I started this video so we could sell. I've already gone ahead wiring all this. For the strings, these strings should not have the book codes. The numbers, you have the book codes. If you're using Boolean true fours true four should also have the book codes. So please keep that in mind. All right, so this is it. So this guy is also Duba member. I want to expose heals and model it. So this done, we've actually hit the right parts. Now, you would notice that I did not pass in the right host here. The reason I didn't pass in the host is because it's personal and you guys need to actually keep that safe too. Why do you need to keep that safe? You must understand that the IPV, what you're going to pass in here will primarily be your IP VIF address because you can't pass in local host. Local host, remember the diagram I showed you guys earlier this diagram? I showed you guys a diagram that this is a host where you have your combining system. You don't even know the IP. Now, the system, which we want to assess, apparently, that's what we want to assess, that goes all the way down. Remember, we deployed the container, which is the Docker container within this pod, right? Remember we deployed within the pod within this host system because we exposed on Docker, we expose it so we can assess the local host, right? So we want to assume. I want to take this a little bit slowly so you guys can understand. Remember, we have a Docker container. This is a Kubernetis. Remember we have yet another let's expand this. Let's expand this. This will make more sense. We had Kubernetes here. Then we created Docker here. Docker Engine. Docker engine is ring here. A Docker engine. We created a docker engineer. Ticker, everything that we placed here, we are making it accessible from the host. Everything is accessible, no, care. This is accessible from the host. Everything is accessible from the host. The post guess accessible from the host. Anything we created is accessible from the host. I need us to understand these concepts. All right. So everything is accessible from the host. Now, we pushed our image from this Docker to remote, and from here, we are pulling from remote into this Kubernetes cause because Kubernetes don't know about this guy. They don't have any affiliation. You just need to specify where he can remotely pull the image, and that's what we did. If I know using Docker Hub, use the private registry. I hope I kind of explained that in the last video so it's quite clear, right? So I saw in subsequent videos, I meant as previous videos, then the same way too, you were trying to assess a database. You have to treat your database. Don't say because you're developing on the same system, you can access directly to not work. Because remember, this is an environment in the fibone has its own local host zero to 65,535 pots. You host CCL habits. This car engine is an isolated path also. So what you have to do, you have to connect to these host. You have to find a way to connect to it from the Internet. The way to connect to your host on the Internet is to find what is the IPV for address mapped to your a Router. The router you're using to connect to the Internet, that's the only way you can connect because except you've actually found a way to tunnel to the Internet and you have a IPV for that you have directly to your system or how. But the shortest way to use moment is you're connected to the Internet and if you're connected to the Internet, you practically be using a router. There isn't a router or you're using a mobile Dongo whichever you're using, you'll be assigned the IPV for. How do you get it? On Windows, the command is this. I'm not going to run the command guys because it's a very sensitive command. That shows a lot of sensitive details. On Windows, use IP config. Just IP coffee, type this. It should give you something like this. If you go ahead to cancel everything, and just cancel it some more. So you don't even assume. Nobody assumes anything here, right? Because the data are very sensitive, right? You go ahead, do this. You would see you have your wireless land that has an IPV f, right? You would see you have an ether that have an IPV ph, right? You will see there is this Etherin Vnet that has an IPV four. You see the IP VF address, one of these guys would work for you, right? So you need to pick best bet is most times your wireless Lane, right? You check your wireless the IP is accessible. Do you understand? That's exactly what you place in as your host. I will go ahead and place in as my host. I'll pose the video, place it on the host and I will not expose the configured file anymore. That's what I would do. That way, if it works, I'll be able to tell. I would then figure out the exact one I'm supposed to use here, which I would actually show for it, right? Then you would also for Mac users and Linux users, you are supposed to use there's called IPADDR. I think it's IPDDRO one word, ADDR is one of the two. It will also show you all the connection details of your application that you pick your IPV for the one that connects your land, right? Or just do research to see how to get the IPV for of my land, connected to my system. You can just use those keywords and you get it. Alright, with that being said, let me post the video. Let me connect it to my configuration, my config map, and I'll just show on the configt map, and I'll expose it anymore. All right? So this is a very sensitive path I need to take my time to explain so that you guys understand starting from this for you guys to know. That is why you discover most times when you play Kubernetis cluster, you would have to create database somewhere. Probably like AWS, they offer a database service. They'll give you an address IP, right? That is what you would access from this part because this is connected to the Internet. So to see it as a remote network, right or a remote address. Alright, with that being said, let me pause the video, fix it in and I'll be back. See you guys in a minute. Okay, guys, I'm going to add the host file, then we can then proceed. So having added the host file, what is the next thing? So we now have let me create that, so I'll do a K, apply then F modules. That has been configured. If I do a K, if I do a K, K gets CM, moduli its. CM, sorry, CM. All right. We have this actually, it shows all the data that have been processed. All right. The next thing is we need to credit deployments. Remember I told you guys how to do that, do a K, create, deploy or deployment, whichever. Then the name, let's just call it Modulus deployments, then dash dash image. The same way, This is Zc Z, remember, you have to use user name or you deploy it. Or if you use the privacy registry, you check documentation to how to the private, but default is DockerHub. Then module it, which is one dot zero. Then dash dash pots. The pots is connected and what's the pot again? It's using t 81, right? What did I pass in the config map? I need to check. That's what I pass in the config map. I think I use a T 81, so I just use T 81 here. But I'll confirm, right? By the time I check in, I'll confirm which actually works. Okay. So this being done, Okay. Yes, this being done. Then this is supports, then is anything less gyroon. Gyroon KlinsO Yamo. Okay, so we have this. I will move this into the modulus file. Yarmo I've placed in a positive video to take out the parts that will show my hosts, then I'll come back here. I've deleted I've deleted my host file. I'll bring it in, but let's just quickly go ahead and wire things in here. What I would do is so I don't think I need this part anymore. I'll just expose this. I'll just bring this in, and I'll just bring this guy here, right? So I'll do a CAT demo for the one we used earlier, demo dot amo. So to show us how to wire things in. So we use environment from then pick it in. So come here. So come here. So don't look for my host. I've deleted the host because I don't want to give you the host right. Then we pick we need this. I just pick this in. No, this is not accurate. Didn't copy properly. It has to be from here. Then I can copy this from here. It has to match spec. Sorry. No spec, just too much. That touch just to match this then have to come this way. 12. I think under the maps. The name is what Modi Modulits. Modulit. This is great. If you run the application, if everything works accurately, everything should work by default, except I missed up something. I would post the video, quickly add back put in my what's the name down the host, then I'll try to run. Then we explore if it connects successfully or not. All right. Okay. So having done that I've been able to do that, so let's run it. I'll do a K, applyhef Modulit that's yam. Okay, so saying error decoding model the Yama deployments in version, but decoding or known field data, decoding or non field data. Let's see what it is. Guys, I found the issue. The issue is placing in this that's hyphen nife pen, right? That's the exact issue. I've placed it in. I believe we should be able to see probably a different error if any error still exists. Let's apply. Let's do this. All right. I can see this has been created, this has been configured. Let's see if this is quit successful if it's not quite successful, we see the arrow, then we race what the arrow is. I'll clear this, I'll do the commands I've been running that brings the three together. I run quite a bit of command. I don't want to keep running everything again. Speed of command I run brings everything once. I just go ahead and type it again. K CM, gets pod, gets the service, and gets the deployments. So okay. All right. So you see this spot is failing. This spot is failing. So we need to dig in to see exactly why this spot is failing. All right. So I'll then pick this I then say K, logs. I think I can delete this. I don't need this anymore. Logs and I pass this in. Let's see. What's the problem. This is spring profile. Remember, guys, we missed this, This spring profile is also needed. I'll go ahead and add this within the config file. All right. All right, guys. I've gone ahead to add it. This is it spring profile Docker, which is what we did because supposed to actually channel that's what's supposed to actually match this. Supposed to match this application profile. Yeah. These are Docker. This are profile. Yeah, done that done, still don't look for my host. I've removed it. By the time running it, I would have added it and we'll see if this actually runs accurately. I'm back here. I'll just go in here. Then let's apply this again. As we made a change, let's apply it again. This was change was changed so let's run the command. This work? Let's say a cashback. They're saying there's a cashback and there is an error within this. Let's debug this again. Let's see why this is. Kelogs. This is what I avoided when I mentioned to you guys that we should use the demo project when we show demo coma because you always face the issues most often times until you actually get it right. Let's check what's the issue. We could see this is going in, then what's the problem? This went in. Then, let me follow. Okay. So what's the error? You're saying it's trying to connect the issue to the database. Trying to connect to the database, but the database is basically not connected. And let's see if you have extra details. You're saying a particular detail is null, right? Particular detail is null, let's see. The URL complaining about the URL. So the URL, something is missing in the URL, caused due to, let's see. Let's see. So it's caused by the URL. Let's go in and see what is happening there. So here we are. So let's compare. I had my username, right. This username, I have my password. Is my password. I have my host, it's my host. I removed it. I have the pots, it's my pots. I have my dBi name. Yes, my dBi name. I have the event. I have the event, right? I have the actuator, endpoints, and I have this part. Ah. Okay. So we're using 1990, so it doesn't matter to use 1990 as a default. Okay? Yeah, then this would be an issue. We're using 1990. We need to use 1990 here. Remember, ts to match. Starts to match accurately. 1990. Okay. 1990. So starts in March 1919. Alright. Alright. So let me add in my host. Let's test it out again. Let's see what happens. You guys, that's done. Let's run this. Okay. Let's check this out. Okay, we've seen this. So sect mirror, sry this again. All right. This is running. This is running. I'll just try it again. Okay, it's failing. It's running, it's failing. So something is still up, something is not connected. So it means a detail is not connected. So we need to find out exactly what that detail is, right? So it runs, it works, it runs, it breaks. So let's see what causes the issue. I'll do heir logs. And this then chef. Okay, so what is this? Let's see. So I'm getting so supposed to connect. Okay. Remember this is tricky. As long as you're connecting to a remote database, you would not have any issue. But because you're using the same local system, and I'm trying to prefer you another option for you to have something internal to use. So that's exactly why this disconnect. So it's still the same thing. Not obtaining. I think I'm still using the wrong IPV for address, soo but all right guys. Thank you for holding on. So what happened was I did not actually start up my post girds. Remember using Docker compose. So when the application starts up, so I didn't bother. So I was thinking I already started up, and that is why I was having issues. So just pick your IPV four from IP config, for those of you using Windows IPV four. Then for Linux, for Linux and also please try to find your IP address and all then place that in, and that would automatically work, right? That's what automatically Please remember. You just need to use it directly, and that actually saves the entire details for you. Sorry that actually makes it work. Yeah. I remember remember to place the IP within double codes. Remember to place the IP within double codes and it shouldn't have any issue. With that said, what I'll do is I'll try to delete the pod. Let's try to run that again. I would do that and I would file this up. Let's do this again. I'll just K apply Say it again. So model it. This saves, saves, then let's do this cube coil that's K which iat, keep Cotil then can get all the services we put in layer. So, you get the CM, we get this, you see everything is running. The reason why we have this was one is because we did not add in the replicas. So to add in the replicas, we are going to do this, as you can see, I've added in the replicas, which is a three. Then if we save this and I would expect it to work as it should we just hit it. We have this and I've go ahead, added this, then I've added this change it to three. Just hit this and let's apply. Apply it. Configured, let's check again. You see, we have three. These two are just spun up and this has been running and these are good guys. These things are good. You can go with us, you can scale up. There are commands to actually scale up and scale down which you can do automatically. Basically, all you need to do, just say deployment, scale. And you see exactly what you need. The other details which would actually I can talk about but I think I want to keep this focus, very focused so you could scale your replica. This is for scaling. Let's check the deployments. Set a new size for deployments, replica set are okay. Scale a resource identified by a type and IGT we have this scale this. All right, so we could use this because this is the deployment. If the deployment deployment name this, covet size is to scale to three. Want to name this to three. Could actually do this. I can just pick this. I can pick this copy. Come in here, then place this here. This is our deployment name. This is our deployment name. I pick this to move my skill, Add this in. So with that in, I can change this to this is three. Then I can change this to one. Let's check. As you can see, we only have one now. So we can also come in here, change to four and automatically change to four. So the initial is so and so. So we'll check, as you can see, so this works. So the next bit I want to show us is this part, which we tested while we're doing the other bits. So let's test the same thing now. So what I'll do is I'll scale down to three. We just need three pods, three, actually. So I'll just so we can just okay, let's go. Let's come back here. I just CM PO. Remember, I'm just trying to get everything at once. You could just pick just the play alone, get deployed and get deployed. This should miss deployment file. I can just say pot, give me the port. The command I was using that had a comma was just bringing everything together. So let's do this. I'll bring this pod interested in this pot. So I'll do KogsT and I'll follow F. All right. Then the same thing here, K logs, F. Then I'll pick this I'm not skilled down, okay? I think three is enough. I'll scale down in the bits. Okay, I just scale down directly. What's the command we used again? So the command is four, let's scale down to three. So we can just see the three screens, right? Si down to three, right? So that is. Okay, so that is done. So let's recall this. Okay, so J J six. So this is what we need now. So six All right. And lastly, this guy pick this then KogsF All right. So we have this, we're going to do the same thing we did while we actually exploring Cubonttis. Then I'll do a watch watch N. But I'll make you reduce er points one so we can see this. Let's do a call. Let's pick the endpoints. Let's pick the endpoint we actually used. Remember this is outside of my service. So coming here, we coming here, what's the sketch? This is a sketch. Let me see. Can I find it now. So we did where is it? Okay, I think this is what I just need we would need to create action payments so we don't have a g. They are all posts. We need to create a post. I think we can just pick one of these let's go where are you? I think let's see. We've used this for so many projects, so I'm trying difficult to look for. I think it's order. Let me just confirm. Oder controller, order, order order. I'll just do this order. Then I'll just pick this guy. So not to get a call. This is what I usually do. If you don't know exactly how to use call to use a post data, you bring up a postman, right? This video it's gotten very long. So let's just jump in in the next video, right, to do this. See you next video. 15. K8s test deployment modulith 2: All right, thank you for coming back with me and see here. We're trying to fire the event and I want to bring this in so we can actually run a post on this. I want to get the accurate car to use, and this is how to make dt. Now, I put actually placing placing the service. Now before we can try this, remember we've not exposed our service. We've not exposed our service, so we need to do that since our deployment is now running. I think I missed that bit. If you check, let's do this. Gets PO CM, CM, SVC, then then deploy. Okay, so we don't have this so let's expose this. So do a K, expose. I run this on a separate shelf so that we can actually have it, do a K expose deployment. And what's the name of the deployment? Name of deployment is this. Expose deployments. Then, then, dash pots. What's the port again? Let's see. I think 1990. We're running on 1990 right. 1990. Let's say driver who fix it later. D's dry run, then clients, and that's all are. Let's look for containers targets. Pots. Can we do this? 1990. Okay. So we have the parts of the application, then the target pots. We actually have this. We fix this up. Can we do a type? Can I use a type note pots? I think I can use type node pots. I believe explains this. Yes, we can use a type note pods. I'll copy this. We can do this. This guy then append append it to a modulate file. Right. So yes, we can do that. All right. So I have scores up so my host doesn't show. I'm particularly mentioning this because it is very important. You don't expose your IPV four address that can be used to actually do some hacking on your local system. So please guys try to be very mindful of that. Now we have let's expose this then let's get the node pods. The pod using I think I have this. The pot we'll be using is node pods 32,000 thousand is fine. The container pots is 1980. The pots we'll be assessing is this, everything is fine now. We'll be assessing 32,000, which is exactly what we need. That's done. You can just save this. Then pick this up. All right. This is what we need. Let's clear this up. Then I'll do K, apply the chef hundreds so you see, this is changed, this is changed. Service service is created. This is created. The modulate this is that's fine. Let's do. Let's just do this. We have a service now. You see the service is exposed, it's connecting to 1990 and you have this. We've already discussed this in the last video. I'll show you guys aware so I can just come in here and go to my local host, hit it from local host. I'm using 2000. The 2000, my body, I just want to show you how to get the c you don't know how to use CR data. You actually place this, then I can come to my sketch. Where's my sketch? Where is my sketch? Let me just go to here this part. This is my sketch. Let's pick this guy. Come back here. Then I just pass this here. This is a post. Test it out if it works. Cool just say gets my email. Test at test seven.com. So we just done. I just hit this. If we get our details back, then we can then start firing from that part. Okay. Can you see? It was able to access it. So this works beautifully. So what I'll do, you click on this code like symbol. Then you see call. You can pick several one. There's several ones here, right? I want to pick call. Call is what I need. I pick call. After picking call, I go back to my Linux terminal, right? I clear this up. I do my watch N. I watch that. What's the next? Yeah, 0.1. Let's 0.1 now because I want to see everything moving now through here. Then my co, this is my co. This is my core. Then let's hit this. Okay. You can see we have something here. I think this is the first one. Let's see. I've gotten something here. That's in something here. I think this is overwhelming. Let me quit it. Let's come back to this. I can try to make this a one liner to ensure that we do this. Okay, let me go back. This parts, then this is a post. Did I save this, save this guy? Don't save it, come back, cancel this. There is a post? This is a car, location, Where is the post? All right. So I want to add this This is just so matter. Let me try to adjust this as a one liner, right? Let's see if I can bring this to one line. So if I come back here, all this will be a single line, right? So this way, you won't have to span over multiple lines. Right? So I'm going this route so that you guys can see exactly how it works. Else the closest we can do is that you keep hitting this hitting this and we come and check. We'll come check if everything actually hits that part. Let me come back here. Not I'll come up here. I'll come here. Let's do a post. Other than using a location, that's the location, Header contacts Jason. Jason, this is data row. Other ones do exposed. Let's see. So you're saying you contest stream because of the type you're actually passing it. So I'm trying to avoid that. Okay. Spot the media type. Okay. Now, it's checking because the media type you're actually passing it. That is not going through, so I'm trying to see how we can hit this properly. Okay, you know what? I'll just hit it from my postman couple of times, just watch the screen. I just hit it a couple of times. You see that? You see that? You see one is going through. That's the part I'm trying to avoid because it's quite slow, is just one that is being assessed, one, one. Just one because this is sufficient to handle the task. Assuming we're actually pushing at a very high speed would see everything actually being engaged. You see this has picked up another one. The other one has been assessed. I'm trying to hit it very fast. So you see, this has been touched also. I just a demonstration on there to show you guys that everything actually works. Now you see this is basically how combinators work. Now, we've been able to test with demo projects. Now we face the issue with database, which I felt might be an issue. We're able to wrap it up and how we're able to get there was to use our IPV for, basically works. Now, the IP ADDR I mentioned for Linux, I'm not sure that's exactly accurate. I'll probably just pause this video and CFF get exact the exact command for those that using Linux or or Mac. But we've been able to demonstrate this let me just pause this. I suggest that you try IP ADDR IPspace ADDR and try to place in your host and see if that works. Else you might need to do a little bit of googling around, right? That's basically how you can test for how you can test the Cuba nets for Modif I've walked you through on end to end, and I'm sure this should actually help you guys figure out on your next deployment to know exactly how to do things end to end. All right guys, I'll see you in the next video.