 Welcome to the third and final video of this video miniseries journey of an app where we are modernizing a existing application all the way back from Windows Server 2012 R2 running on premises to a container running on Azure Kubernetes services or AKS. My name is Vinicius Apollinario, I'm a program manager at the Windows Container Platform team. And in this video, I'm going to show you the final part of our process where we are creating a Kubernetes cluster and then using the image that we uploaded to Azure Container Registry as a deployment of that application. So just to recap what we did on the first and the second video, we exported the application from Windows Server 2012 R2 running on premises using WebDeploy. And then we used Windows Admin Center to come here and create a new container image. And the container image that you see here, the Vinibir WD for WebDeploy is the image that we actually went ahead and using Windows Admin Center as well, we uploaded to Azure Container Registry. I highly recommend that if you haven't checked that you go back and check video number one and number two, choose the process of how this works. Now once we have the image available in a repository like Azure Container Registry, we can use that image either in other container hosts or other services like AKS. So here's what I'm going to do. I'm going to go ahead and on the Azure portal, click the option for Kubernetes services. And as you can see, I don't have any deployment here. Now before I go deeper on the Kubernetes portion of this whole process, of course Kubernetes is a very complex product and has a bunch of other concepts that you should grasp before you actually try to implement a cluster and deploy an application. So I highly recommend that you take a look on how Kubernetes work. The good news is that Azure Kubernetes services actually abstract a lot of the infrastructure for you. Azure Kubernetes services is kind of a Kubernetes as a service, so you don't have to deal with a lot of infrastructure components. You only have to deal with the application itself and the nodes that are actually running your application. So again, go ahead and take a look at the documentation that we have on AKS. Go check some concepts of how Kubernetes work. But once you understand how Kubernetes works, we can go ahead here and create a new cluster using AKS. So here's what I'm going to do. I'm going to click Add, the option to add a new Kubernetes cluster. And the Azure portal is going to take us through the process of creating the cluster here. I'm going to use a resource group on Azure that I had created already for the registry in high site. I should have used the better naming convention here, but it's okay, I'll use that one. I'm going to use a name for my Kubernetes cluster. In this case, I'm going to use ViniBeer cluster. I'm going to select the option to use the region West US2. There are different Kubernetes versions available, some of those are preview actually. The default one at the moment that we are recording this video is the 1.16.13. I'm going to keep that one depending on the features that you are going to use. You might need to change this option here. I recommend again that you check the AKS documentation for this. And then the first thing that we are asked for is what is your primary node pool? And your primary node pool is even that if you are deploying a Windows application, as it is in our case, the primary node pool needs to be a Linux-based node pool. And this is for running your AKS or your Kubernetes API and a lot of the components of Kubernetes that are actually running on a Linux machine. So in this case, we are going to use the standard option here for the node size. The recommendation from AKS is that if you have a production environment that you use at least three nodes for your node pools. I'm going to click Next. And here we have the option, again, we have the primary node pool here is a Linux type. We have a node count, so three nodes, so in case one fails or you have two others. And then we have the standard node size here that AKS recommends. Now what we are going to do, we are going to create an additional node pool for our Windows workload. So here's what I'm going to do. I'm going to click Create a Name. So WS for Windows Server and P for node pool. There are some limitations on the name convention here. But basically, the most important part here is to choose the size of this node pool. For the sake of the demo itself, I'm going to use the 2S V3. We have 8 gigs of RAM. We have two VCPUs. For the purpose of the demo, it works fine. But of course, for your application, you should check how much processor memory you want to dedicate to this application or the concurrent applications that you might have in a node pool or in each of the nodes. So then go ahead and check with all the options available. I'm going to select this option. The node count, I can of course scale up or down, but basically I'm going to use 3. Okay, now again, there's a bunch of other things during the process of deploying AKS that we are not going to touch. If you are interested in, for example, virtual nodes, VM scale sets, you are more than welcome to check the AKS documentation. We are going to keep the standard configuration or the default configuration for these options here. Next, we are going to check the authentication. And one important thing here, since we are going to use an image that is running on ACR, the simplest way to authenticate against that ACR service is to actually use a system assigned managed identity. There's nothing preventing you to use a service principle. Again, there's a bunch of documentation explaining each of the options here. It's just that the simplest way here is to use system assigned managed identity. Of course, again, a bunch of other configurations that you can select on your AKS deployment. We are not going to touch those at this point as the part of the deployment of our application in the proof of concept of this video, what we want to do is we want to go ahead and just deploy the application and show the whole process to you. One important thing about networking is that since we're going to use Windows workloads, we need to use the advanced option that basically creates a virtual network on Azure that you should be familiar with. So you have cluster, subnet, what is the virtual network that you're going to use, we're going to use a new one in this case. Then we have the address range, both for the Kubernetes cluster, as well as DNS service, as well as a Docker bridge so the nodes can actually talk to the containers running inside of those nodes and how the translation happens behind the scenes. Then we have a bunch of other networking settings for DNS load balancer. We're going to keep the default options here. Integration here is where I mentioned that we're going to talk to our container registry. And in this case, I can select the option here that I have in this resource group. I have already created a registry, which is the one that we chose to push the image to. So the image I want to use is in this registry. So that helps a lot in the process of authenticating against the registry on AKS. As your monitor options, we're moving forward, we have the options for tags. And then we can reveal and create this Kubernetes cluster. As you can see very straightforward, again, there's a bunch of other configurations that we did not touch. So I highly recommend that you go back and check the documentation. But primarily what I want to do is want to deploy this cluster. Most of the configuration can be changed anyway afterwards. So we're going to click create. And as this process takes a few minutes, we are going to come back when the process is finalized. All right, so the deployment went successfully and it's completed now. Let's go explore the resource then. So if we click the go to resource, we can see that we are now looking at the vini beer cluster, which is a AKS cluster. And there's a lot of stuff in here, again, just like the deployment itself, AKS has such a wide range of configurations that you can look into. For what we're going to do here, I'm going to explore just a few things. I'm going to touch base on some of the connection options. And we're going to look at the workloads option here, which is actually in preview, but it's actually a great way to actually go and deploy a new application on top of your Kubernetes cluster. So the first thing you probably want to do is after you deploy your cluster, let's look at the node pools to make sure that we have the same things that we said that we wanted to have at the deployment. So we can see that we have the primary one is a Linux type. We have the window server node pool as well, both node count are showing as three. I have options here for scale, upgrade the Kubernetes version or delete this node pool. Also the other thing I wanted to touch base is the insights option for monitoring because here you have a bunch of other things like since this is a compute resource, you have like CPU utilization, memory, node count and a pod count. You have a bunch of resources here that actually help you monitor how your deployment for your Kubernetes cluster is operating, again, such a wide range of things that you can do. We have configurations, scale, networking, we have a lot of things to look at in here. At the end of the day, what we want to do is we want to deploy our application that we extracted from an old server into AKS. So here's what I'm going to do. I'm going to open this YAML file that I have available on GitHub and the link to this is accompanying the video and the blog post. The way deployments work on Kubernetes is you have a YAML file that actually describes how the deployment of your application works and what Kubernetes will do is Kubernetes will try to match your request from the YAML file to what it is deployed on those nodes. So here's what I'm saying in this YAML file is I want to do a deployment. So this is the kind of YAML file that I'm creating here. And then I have some metadata and specifications about the application itself. In this case, I have my application called ViniBear. I have a label that actually matches the name. And then I have this pack and this pack option here describes the container or the pods. A pod is a set of containers that are running inside of that specific pod to actually support the application or support that pod. In this case, I'm giving, again, metadata information about this pack. I'm saying that this is going to have three replicas, so I'll have three containers at least running my application. I have the name, again, metadata for ViniBear as the spec, as well as the label. One important thing about Windows nodes is we are specifying here that the node selector should look for Windows nodes, because this is a Windows application, it wouldn't run on a Linux node. And then we have the container information itself. So the most important thing here is the image, and if you remember the name in our case is slightly different. I'm going to change that when I deploy. But basically this tells Kubernetes, this is where you get the image from in order to deploy the application. Then we have information about how many CPUs we are going to use as limits as well as requests. And then we have the container port that we want to open to ensure that we have connectivity here. Then next we have the information about the service, and service here is basically to have connectivity to your application. So in this case, we are giving, again, metadata name for ViniBear. We are saying that this is a load balancer, and then we have information about how we get to the container itself. So it's a protocol TCP, and then the port is 80. Very well. So what I'm going to do here, let's go back to the Azure portal, I'm going to click workloads. And as you can see, I have multiple deployments already in my Kubernetes cluster. And these are all native things or default deployments that you will find in a regular AKS deployment in order to support the system itself. You can see that the namespace here is actually a cube system. So what I'm going to do is I'm going to click add. And then this is the nice thing about this preview option here in the Azure portal. You can type in the YAML file directly in the Azure portal. So what I'm going to do is I'm going to copy this information here. I'm going to pass on the only thing that I'm going to change here is the ViniAP. Let me go back and actually check what I had previously to ensure I have my YAML file. Let me open with notepad. The link to my image in this case, because I changed from the last time I ran this demo is this one. There you go. So ViniAP test registry and then the rest of the URL plus the ViniBeer, WD and the tag is V1. I'm going to click add. And as you can see, we are creating the deployment, creating the service. The deployment itself actually succeeded. What I'm going to have to do here is I'm going to have to wait until the nodes actually go, pull the image to that node. And then they start the image on those specific nodes. So I'm going to click this deployment here. I can get more details on how the process is going. Since this is going to take a few minutes to actually pull the image to those nodes, I'm going to come back when this process is finalized and show you that the application is up and running in this case here. All right. So as we can see now, the deployment of my application, the ViniBeer application worked. One important thing I wanted to highlight that you understand is I never left the Azure portal, right? So this is a preview feature in the AKS set of features under the portal, under the Azure portal. It allows you to deploy or do other operations with the Azure cluster. I'm sorry, the Kubernetes cluster without ever leaving the Azure portal. So that's a pretty nice way to actually go and do stuff. Traditionally, the way you would do stuff is you actually use kubectl to actually connect to the cluster. I can show you how you do that and the Azure portal also provides the guidance on how to do that in a second. But here, before I leave this page, I wanted to show you that we have three deployments then. We have the replicas here that you can see. I selected, I desired three replicas and there are three. There are updated total of three and then three. There are actually available for use right now. So that three pods with the three containers that you saw in the YAML file are actually ready now for use. And we have the pod ID, I'm sorry, the pod IP. What is the node that will actually deploy? As you can see, it's using the naming convention that I used when I created the node pool. So everything here looks fine. Select, let's go back to the previous screen. You can see the deployment here for the workload itself is okay. Let me just refresh the screen. As you can see, it's now showing three of three already up to date and available. And now in order to look at how to access this application, I have the service, which if you remember from the YAML file, is the load balancing that I selected to use to go and connect to this server, to this application. And this is the IP address that was provided to me. So actually, customers can go and connect. So let's go and open. As you can see, of course, when it opens the landing page for the IP address, there's nothing there. But if I select the option to open my application VinnyBeer slash calculator, the application is here up and running. And just to ensure the application actually works, let's do the same thing we did in the first video. We're going to say that we are doing a half a devising and the temperature here, oops, sorry, 75 degrees, I'd say, and I'm producing five gallons of beer. As you can see, my application works fine. So I hope this gave you a good idea of how to deploy the application. As I mentioned, I wanted to show if you are connecting through the Cube CTL, one of the things that you have is the option here to use the connect. Then all you have to do is use the Azure CLI or any cloud shell connection. Use this option to connect to your account, get the AKS credentials from this with your Azure account, and then you're good to go with Azure, I'm sorry, with Cube CTL. But I hope this gave you an idea of how to deploy the application using a YAML file that was produced specifically for this app on top of the AKS. I hope you like the whole series, actually, where on video one, we showed how to containerize on video two, we showed how to take the container image and push it to ACR, and on video three, now we are showing how to deploy the application into a AKS cluster. The application is up and running. Our life is good now. I hope you like this video series. If you have any feedback, if you would like to see more stuff, how to do any other operation with containers, let us know. We're here to help. If you need any help from us, just make a comment on either the video or the blog post, and I hope to see you in another video and thanks for watching.