Use the Azure Command Line Interface (CLI) and kubectl to open a proxy and allow you to connect to the Kubernetes UI Dashboard.
- [Instructor] Earlier in this chapter, when we created the CLI container, we exposed port 8,001 to our container. We are going to take advantage of that now to access our Kubernetes Dashboard from our computer. To allow us to access the dashboard, we create a proxy by using this command. Once the proxy is created, we can access the UI by going to local host port 8,001/UI.
Now that we are in the dashboard, we can view our nodes, which is our computers that we are running on, our agent, and our master. We can view our deployments. Here is the deployment that we created earlier and we can view our pods, which are all the instances of our application that are running. And in this case you can see that we are only running one. Now lets scale our deployment to more pods. We need to go up to the deployments area and over at the right, under these three dots, we'll click on this, and we'll say view our YAML file.
Now this will look familiar. This is the file we used to create our deployment and we are going to scroll down and change our replicas from one to ten. We'll click update, and then we are going to go down to pods, and we can see that we have one running pod, and we have nine other pods that are being created. If we refresh this screen, we'll see more and more pods coming online.
We'll refresh it a couple more times and pretty soon all of our pods will be running. Here, now all of our pods are running. One thing that we can do that is kind of fun, is we can show how our deployment is going to keep ten pods running, even if a pod fails. So I am going to pick one of these pods, click on actions and say delete. And we will say, OK, we want to delete this pod. Now you can see, as soon as this screen came back, down near the bottom we have a new pod being created.
So the release is going to just keep as many pods running as we requested. So now lets go back and scale our number of pods back down by clicking on deployments. And we will edit our YAML file. We'll change our replicas back down to one. Hit update, go back to our pods section. Now we can see that our pods are terminating. If we wait a minute and refresh the screen, we'll see all the pods have gone away.
That concludes the demonstration of using Kubernetes. The next step will be to delete all of our resources from Azure so we don't spend too much money keeping them going.
- Setting up your environment
- Adding Docker support to an application
- Debugging container-based apps in Visual Studio 2017
- The DevOps life cycle with Visual Studio and VS Team Services
- Configuring release and build
- Azure hosting options
- Using Kubernetes with Azure