Microsoft hitched its container strategy to Kubernetes, making it the centerpiece of its managed container deployment model and solidifying it as a technology that Azure users should get to know.
Microsoft will deprecate Azure Container Service and its proprietary orchestrator in favor of Azure Kubernetes Service (AKS). As a result, Microsoft's cloud customers need to know how to work with Kubernetes if they want to benefit from containers without the headaches of setting up and managing clusters on Azure.
In this video, Christopher Blackden, a TechSnips contributor and senior software engineer at Cerner Corp., explains how to set up an Azure Kubernetes cluster using the UI.
Start by creating a resource. It can be found in the popular services tab or containers tab in the Azure Marketplace. Fill out the basic subscription information, name the cluster and choose to deploy in the closest possible region to reduce latency. Blackden begins with the default Kubernetes version, which can be updated later.
A service principal must be established for authentication purposes. The Azure Kubernetes cluster will use the service principal to manage resources attached to a cluster. A developer can also turn on role-based access controls for the cluster.
Developers can add advanced networking and monitoring capabilities at the outset. They can configure a virtual network -- including the subnets, service address range, DNS service IP address and Docker Bridge address. They can also enable Azure Monitor to track application performance and receive crucial log data that can be used for troubleshooting when problems arise.
From there, tags can be assigned to track expenses by resources and the cluster can then be validated, reviewed and created. Once the AKS deployment is complete, Blackden walks through the importance of using Cloud Shell and how to run a simple, Microsoft-provided demo to show how to deploy apps on your cluster.
Check out the video or read the corresponding transcript below to learn the step-by-step process to create and deploy an Azure Kubernetes cluster and to get some additional tips, including how to download a template for automation using a script like PowerShell or Ruby.
Transcript - How to set up an Azure Kubernetes cluster using the UI
Hello. Today we're gonna talk about how to set up an Azure Kubernetes cluster using the UI.
So, to start off, let's go here to create a resource in Azure. And we see it's in the "popular services" drop down here, but we can also access it through the containers tab on the Azure Marketplace. Let's go ahead and start that up.
All right. And just to fill out some of the details, my subscription, in this case, is gonna be TechSnips and my resource group is my TechSnips resource group. Yours will vary by whatever your organization is using. The cluster name can be whatever you want as long as it's over three characters and unique to the resource group. So, mine is going to be TechSnipsAKSCluster. And you see that meets all the requirements there. Azure has already checked that for us. Region is going to be U.S. East because that's where I'm currently located. That'll reduce the latency for this application. We'll use the default Kubernetes version for now, but it's important to note that this can be updated later on, and the DNS prefix name, we'll keep the same for now as well.
In the next tab, as part of the Kubernetes cluster, we do have to create a service principal in Azure and this is simply how Kubernetes authentication and authorization uses. Let's go ahead and stick with the defaults for now and go to networking.
Now, if you have specific and complex networking needs for your Kubernetes cluster, you can select advanced and edit them here. I do not, so I'm gonna go ahead and select "basic" for this, but this is worth knowing that this is where you'd come in and edit your IP range or your Docker bridge or your cluster subnet. Another feature we have here is log analytics. Azure will create a log analytics blob where it will write all of our Kubernetes logs to. Now, I don't need this for demo purposes, so I'm gonna turn this off, but it's very useful for troubleshooting and console output if you ever need it in the future.
And next under "tags," we can assign this any tag we want. This is primarily used for billing. So, if you need to see all of the resources that are under tag X, Y, Z, and how much they're costing your organization, this is where you'd unadd the tag X, Y, Z to your Kubernetes cluster.
So, now that all that's done, I can review and create my AKS cluster here. It's already running some validation and creating the service principal to make sure that I'm OK to deploy this. All right. My validation has passed, I can go ahead and review all my settings one more time here. One more thing I want to bring to your attention is an option down here for downloading a template for automation. And this is if you wanted to deploy this AKS cluster as you've defined it here using a script like PowerShell or Ruby.
We're gonna ahead and skip that for now, but it's worth knowing about. And now all that's done, I'm gonna hit "create" and you see Azure is submitting the deployment and we're going to go ahead and wait for this to deploy.
So, now our AKS deployment has succeeded, let's go ahead and go to the resource. Here, we have a few of the things we need to know about it, but from here on out, we have to use Cloud Shell because Kubernetes is mostly done on the command line.
So, first things first, we have to make sure we're properly connected to our AKS cluster. To do that, we're gonna run this command here. I've got my resource group and cluster name specified here in this Azure AKS get-credentials command. And we run that and it's going to go ahead and merge that to our current context. And now we can run a get-nodes command and that'll show us that our three nodes we provisioned earlier are up and running. So, now that we've gone and done that, let's go ahead and start deploying an application to it.
So, Microsoft has actually provided a demo application we can use for this purpose, it's a voting application. So, I'm going to go ahead and open Nano, which is a text editor. Let's go ahead and maximize that and paste our deployment file in there. One thing I wanna draw attention to here is this Azure vote front app. I know it's a little bit hard to see here because of the way that Cloud Shell cuts our line here. But remember that because we're gonna be connecting to it in just a moment. I will go ahead and save this as azure-vote.yaml. And now when I run LS, I see we have our azure-vote.yaml file in our current working directory. And now all that we need to do for Kubernetes is to apply it. So, let's run kubectl, apply force on azure-vote.yaml, or file, excuse me, file azure-vote.yaml. All right. So, that's created, now, our pods are deploying. So, let's go ahead and see if we can see that working.
So, we're going to get our service, this is the Azure vote front that we mentioned earlier. Let's go ahead and throw the watch flag on there as well. And you'll see the external IP is pending. Once this app is fully deployed, that's going to go ahead and get a value that we can go ahead and hit in our Web browser and see the application. So, let's wait for that to finish.
So, now that that's finished, we've got an external IP address, let's go ahead and copy that and open it in a new tab here. And now we've got our Azure voting app. And that's how we deploy an AKS cluster to Azure. Thanks for watching.