Deploy Application on Kubernetes Cluster | Kubernetes Deployment File Example | Kubernetes Service

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends and welcome back to my channel I am your friend ashwag and in today's video we will deploy the Reddit clone app on the kubernetes cluster in the previous video we had created kubernetes cluster using Cube ADM and today we will deploy the Reddit clone app on that cluster the link of this video I will provide you in the description I have logged into my Master node and the IP address of the master node is 192.168.0.148 and the IP address of my worker node is 192.168.0 Dot 158 if I give the command here Cube CTL get notes so my cluster is running this is my Master node and this is my worker node so first of all I will clone the GitHub repository I will build the image using that Repository and then I will push that image to the docker hub so I will go ahead and clone the GitHub repository this is the GitHub repository I will give the command git clone and the GitHub URL I will go to downloaded Repository so these are the my application files if I open the docker file so this is my Docker file this would be my working directory and my app is running on the port 3000 I will close the docker file I will go ahead and give the command to build the Docker image I will give the command Docker build hyphen t so this is my actually username on the Docker hub and this would be our image name I will hit enter Okay so image created if I give the command Docker images so you can see here our image has been cloned to push this image to the docker hub I will first log into the Docker Hub I will do the command Docker login my username is spark 9s 9x I will hit enter I will provide the password for the docker hub login succeeded I will now give the command to push the image to the docker hub this is my username on the Docker hub and this is our image name and the tag is latest I will hit enter so the push completed if I go to Docker hub and do the refresh here so you can see here images available to deploy this image on the kubernetes cluster we will have to create the deployment dot yaml file for that I will go to google.com I will search here kubernetes deployment yaml and I will open the first link so this is the format on the kubernetes documentation website for the deployment.yaml file I will copy this content and I will go to my master node and I will create here the deployment.yaml file and I will paste the copied content here kind is deployment metadata name we will give here Reddit clone deployment app name I will give Reddit hyphen clone replicas I will keep three selector name I will give here Reddit happen clone so note down the name which we are giving here under the selector because we will have to give this selector name in the service dot yaml file also under the template I will give the app name Reddit hyphen clone and under these specifications for the container name I will give Reddit headphone clone this would be our container name and image it will use from the docker up this is my Docker Hub username and this is the image name which we have pushed to the docker hub this image Reddit clone and container port our application is running on the port number 3000 I will save and close this file I will now do the command Cube CTL apply hyphen f deployment Dot yaml and I will hit enter so deployment created if I give the command Cube CTL get deploy our deployment is running and if I give the command Cube CTL get ports or all three ports are running now we have to create the service.yaml file for that I will go to kubernetes documentation and I will search here service I will open this link and I will copy this content for this service.yaml I will go to master and I will create here the service.ml file and I will paste the copied content here kind is service name I will give credit clone service type note port selector name I will give app colon Reddit heaven clone the selector name should match with the selector name given in the deployment.yaml file Port 80 and Target Port this is our application Port which is 3000 and the note Port is three triple zero seven so the application port 3000 will get mapped to the Port 80 and this port 80 will get mapped to node port with which is three triple zero seven I will save this file and I will close it I will give the command Cube CTL apply hyphen f service Dot yaml and I will hit enter so service created if I give the command Cube CTL get service so my service is running my worker node IP address is 192.168.0 Dot 158 so I will go to browser and I will browse this IP address with the node Port which is three triple zero seven and my app is running by this way you can deploy application on the highly scalable kubernetes cluster I hope you find this video helpful a lot of effort when behind this video so do subscribe to my channel to encourage my work like the video share it with the friends and spread the knowledge I look forward you to join me in the next video thank you
Info
Channel: Virtual TechBox
Views: 145
Rating: undefined out of 5
Keywords: kubernetes deployment, kubernetes tutorial for beginners, deploy application on kubernetes cluster, kubernetes deployment file example, kubernetes deployment and service example, kubernetes service tutorial, kubernetes yaml file explained - deployment and service, kubernetes create deployment and service, kubernetes deployment and service yaml, kubernetes access service from outside, kubernetes deployment file example github, kubernetes deployment file explained, deployment.yaml
Id: tHW4ADSeDq4
Channel Id: undefined
Length: 15min 50sec (950 seconds)
Published: Sat May 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.