Deploy Docker image to Azure Kubernetes Service AKS using YAML files & kubectl

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi developers and this video will learn how to deploy a docker container into Azure kubernetes service IKS for that we'll be using the ML files will have a young'n file for deployment in which mainly we'll specify which docker container to use and also the number of replicas that we want to create each replica or each pod will run a docker container a second DML file we'll be using is the service and the service will be used in order to route the traffic coming from our users to the pods or to our docker images for this part we'll be using the load balancer which is available as a service on Microsoft Azure then we will try to use cube CTL in order to deploy those files to create this application and to IKS then we'll try to scale the application so instead of using three pots we want now to use ten ports so we'll learn how to do that and how to apply those new changes then if we don't need anymore our application running on I guess we can go and delete it so we'll see how to do that on the previous video we have so how we can do that from the create right here using the dashboard where we have this simplified form but today we want to do that from using the ml deployment files in a previous video we saw how we can create this file so we said that here we'll have the deployment and also we have the service and all is inside a file with the extension dot yeah Mel so for the deployment it will describe how should have should our app deploy it so this one will have a name then it will have a selector or name this one will be used if I want to reference my application from other apps then for the template we are specific specifying a tag for our template then we'll be specifying the container that should be used here we are specifying a name for this container and also the path from where to find this container and this one the container that we have already created in the next video that's the container that runs my angular application with the tag v1 you can find this container and the link right here but of course you can use and run your own container from docker hub we said that here the container port should be the port 80 then for the second part of this file which is the service here we'll have the API version as p1 this one is the API used by kubernetes in order to read this file validated and then run it to deploy it to kubernetes the metadata is the name of the service I call it angular - service than the selector to be able to reference it from other services for example than the port's which we used the TCP it will point to port 80 but here for the node port and for the type at the third video uses the node port because we said we want to deploy to our two kubernetes on our local machine and and in our local machine we don't have the load balancer but now we want to deploy to Microsoft Azure and there I have the option to use the load balancer so I switch this one from using the node port to use the load balancer but I don't want to do that inside this file so I create a new file for deployment specific to Microsoft Azure so I'll go and copy this file then I'll paste it inside the same directory and here I go and rename it to say this is for Asher and the first or the original fire it's gonna be the one used it outside my local kubernetes and stuff so for the azure fire I go and say this this no longer uses the node port but it uses the load balancer and with the option of using the load balancer right here I don't need to specify the node port so I can get rid of this property right here great you see that here I have colors for my Yama so you can get that through this extension kubernetes extension which you can get it from the extensions menu inside vs code here you you go and look for kubernetes and you will get this extension which you can install it to give you colors and support for kubernetes so now we have the description or the deployment file in order to create a deployment and a service for our application now we want to run it how we can do that so we can do that the same way as we have deployed the file to our local kubernetes so here from the command line we need to connect to a sure and we already done that if you didn't then when you go to your asher or to your aks service you can click on view kubernetes dashboard right here and then it will give you those four steps in order to install the address the ally then run those three commands in order to connect to a Microsoft Azure I have already done this from the previous video so now I'm connected to a IKS on Azure through my through my cube fctl and from here I'm ready to run the deployment files so let's go and do that here I'll use the terminal from inside vs code so here I to view terminar then right here let's make sure we have the deployment file inside the angular app so I need to see the inside angular app then from here I do have my deployment dot a dremel I going to use the command for deploying and you for deploying a deployment and serve spire so I'll go and say cube city L apply minus F then the name of my deployment a file I run this command and here it will tell me that it created a deployment for an application called angular deployment then it created the service for angular service now if we go back to the dashboard for our other IKS we go to refresh so just make sure here we have already some pods and stamp deployments for the previous application that we have created from the dashboard so now I go and refresh and in addition to those resources I should be able to see my new application deployed from Yammer files which is right here the angular deployment and with the pods for my angular deployment here you see the difference between the other or the old pods and the new pods and you have now 15 parts because the previous deployment we have deployed 10 angular app pods and here we are deploying how many here we are telling it to deploy 5 pods this value inside the replica property great then that creates the service and here it's still in progress its creation because it will take a bit of time in order to create an external IP that is accessible from and users this will take about three to four minutes so let's take let's wait a while and it's available and now it's available so I can go and click on the link this will open an external 8 IP which maps to my pods that are running my 5 instances of docker image for my angular application and here is my angular app running on Azure kubernetes service using kubernetes and docker images now if we go back to Microsoft Azure portal right here we could click on monitor container health right here to get some insights and get some metrics about the health of the pods and the kubernetes cluster and the deployments and the services and so on so here we can start from the by the cluster we see here the CPU utilization the memory utilization and other useful insights we can also see the check the status for our nodes right here then we can also see the controllers the containers and so on we can also see the other option right here which is for the logs so if I click on it then right you will be able to get some logs coming from a kubernetes cluster where here we have the list of logs and we can query those table or those list of logs using the query syntax right here so we get you can get those insights or those metrics from the azure portal but we can also get dues from using the command line because right here I'm connected to my cluster on add row I can go and say cube city L get services for example and this will get the status of my services great I hope you like it this video and you'll learn how you can deploy simply add a docker image inside either a kubernetes service and just a few minutes so join me in the next video where we'll be deploying the Hamel deployment files not through the command line but through DevOps CI CD pipelines where we'll take the source code will create the docker image we'll push it to docker hub van from the deployment or the CD pipeline will get those image and then we'll deploy it to our kubernetes service on Azure after creating the connection to it so we'll have the complete CI CD pipeline to run our application from source code to deployment and to IKS so see you in the next video thank you
Info
Channel: Houssem Dellai
Views: 11,771
Rating: undefined out of 5
Keywords: microsoft, azure, kubernetes, deployment, docker, yaml, kubectl, minikube, container
Id: 9iHsPGbPSlQ
Channel Id: undefined
Length: 12min 1sec (721 seconds)
Published: Sat Sep 08 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.