1 00:00:01,040 --> 00:00:04,390 Now that we have successfully built the container image, we need to deploy it. 2 00:00:04,390 --> 00:00:08,180 So under Deployment specifications, I specified AKS, 3 00:00:08,180 --> 00:00:11,730 and I found that although you can create a new cluster right here, 4 00:00:11,730 --> 00:00:14,750 I would strongly recommend that you build it using an ARM 5 00:00:14,750 --> 00:00:20,140 or a Bicep script or in the portal, given all of the configuration options. 6 00:00:20,140 --> 00:00:24,540 Specifically, in this case, I'm going to need not a Linux agent pool, 7 00:00:24,540 --> 00:00:28,940 but a Windows agent pool, and I'm going to need to make sure to use CNI, 8 00:00:28,940 --> 00:00:32,540 rather than kubenet, there is a lot of presumed knowledge there. 9 00:00:32,540 --> 00:00:33,500 Long story short, 10 00:00:33,500 --> 00:00:39,220 I have a windows pool right here so I will validate that AKS cluster here, 11 00:00:39,220 --> 00:00:40,500 and then we'll continue. 12 00:00:40,500 --> 00:00:44,850 Hopefully it makes sense that if you go the route of Java on Linux, 13 00:00:44,850 --> 00:00:48,300 you're going to need Linux for your underlying infrastructure. 14 00:00:48,300 --> 00:00:53,540 And if we're doing ASP.NET Windows, the containers will be running Windows. 15 00:00:53,540 --> 00:00:56,020 Okay, so let's see here, no application. 16 00:00:56,020 --> 00:01:00,630 We don't need to parameterize here because we don't have an app config file, 17 00:01:00,630 --> 00:01:01,540 and if we did, 18 00:01:01,540 --> 00:01:06,190 we would need to specify a secret store to store things like certificates. 19 00:01:06,190 --> 00:01:08,010 Were not using persistent volumes. 20 00:01:08,010 --> 00:01:10,930 This is a consideration for some businesses where 21 00:01:10,930 --> 00:01:13,610 you've got Docker containers running, and you know, 22 00:01:13,610 --> 00:01:16,250 the idea is that containers are meant to be ephemeral, 23 00:01:16,250 --> 00:01:18,190 so they're relatively stateless. 24 00:01:18,190 --> 00:01:21,250 If you have need to maintain state in a container, 25 00:01:21,250 --> 00:01:24,720 you will create what's called a Docker volume, and the way that's implemented 26 00:01:24,720 --> 00:01:30,410 here in AKS is that you use a file share in an Azure Storage account and 27 00:01:30,410 --> 00:01:33,200 that's where your persistent volume will be stored. 28 00:01:33,200 --> 00:01:36,880 I'm not doing any in this simple case, so we'll click Continue, 29 00:01:36,880 --> 00:01:40,760 and then we have our deployment configuration that we can verify. 30 00:01:40,760 --> 00:01:46,740 I'm not doing anything with SSL TLS so it's just going to be port 80. 31 00:01:46,740 --> 00:01:50,350 Let's click, again, Configure, verify the settings, 32 00:01:50,350 --> 00:01:55,940 and click Apply in order to commit our choices and then Continue. 33 00:01:55,940 --> 00:01:57,240 Ready to go? 34 00:01:57,240 --> 00:01:57,830 Let's do it. 35 00:01:57,830 --> 00:01:59,250 Let's click Deploy, 36 00:01:59,250 --> 00:02:02,680 and there is going to be a lot of moving parts going on under 37 00:02:02,680 --> 00:02:05,740 the hood that are all abstracted away from us. 38 00:02:05,740 --> 00:02:09,410 Docker push of our image into the Azure Container Registry, 39 00:02:09,410 --> 00:02:14,730 then the Container Registry is tied in with my AKS cluster. 40 00:02:14,730 --> 00:02:17,370 This is because I've created that integration. 41 00:02:17,370 --> 00:02:20,990 Let me go to the Azure portal and do a search for registries. 42 00:02:20,990 --> 00:02:25,940 We can go to Container registries, there is my registry right here, 43 00:02:25,940 --> 00:02:32,690 and if we come over to Repositories, we have our webapp image. 44 00:02:32,690 --> 00:02:35,740 It looks like it's already there and ready to go, 45 00:02:35,740 --> 00:02:42,740 and then as far as AKS is concerned, I've got my akswin cluster right here, 46 00:02:42,740 --> 00:02:46,690 and if we come down under Settings, Node pools, 47 00:02:46,690 --> 00:02:51,800 you can see my win2 node pool consists of 3 virtual 48 00:02:51,800 --> 00:02:54,640 machines running on a particular size, 49 00:02:54,640 --> 00:02:57,520 and I want to make sure that those are Windows nodes so that they 50 00:02:57,520 --> 00:03:01,040 can host this workflow in this application. 51 00:03:01,040 --> 00:03:03,260 Okay, it looks like our deployment completed. 52 00:03:03,260 --> 00:03:08,880 We can browse to the public IP associated with the service on Port 80. 53 00:03:08,880 --> 00:03:10,330 There is a guidance link here. 54 00:03:10,330 --> 00:03:12,840 We can reset the configuration. 55 00:03:12,840 --> 00:03:16,620 If we come to the Workloads page in our AKS cluster, 56 00:03:16,620 --> 00:03:20,120 it looks like I've got a crash loop going on there, 57 00:03:20,120 --> 00:03:23,940 so I've got some more debugging to do in this case. 58 00:03:23,940 --> 00:03:26,100 Yeah, it looks like it's in a problematic state, 59 00:03:26,100 --> 00:03:28,950 but we can verify that it is, in fact, running as a pod. 60 00:03:28,950 --> 00:03:31,380 It's been running for 6 minutes, 61 00:03:31,380 --> 00:03:35,090 and the image that it's pulled from is from our Container Registry. 62 00:03:35,090 --> 00:03:37,890 This is a good real world case because I found, 63 00:03:37,890 --> 00:03:40,980 in most cases, no matter how much we automate, 64 00:03:40,980 --> 00:03:46,000 well there is still normally a little bit of tweaking and refinement that's necessary as well.