Tamil CI/CD Deploy An Application in Kubernetes Cluster Using Jenkins Pipeline Docker | InterviewDOT
ฝัง
- เผยแพร่เมื่อ 23 ม.ค. 2020
- Click here - / @interviewdot to get notifications.
Tamil Deploy An Application in Kubernetes Cluster Using Jenkins Pipeline Docker | InterviewDOT
Jenkins is an open source automation tool written in Java with plugins built for Continuous Integration purpose. Jenkins is used to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build.
They usually make shipping and deploying your application much easier. They make consistent testing much, much easier.
Containerising your application is like shoving your app and all its dependencies into a box. Except the box is infinitely replicable. Whatever happens in the box, stays in the box - unless you explicitly take something out or put something in. And when it breaks, you'll just throw it away and get a new one.
Containers make your app easy to run on different computers - ideally, the same image should be used to run containers in every environment stage from development to production.
This post is your guide for building a Docker image, and then setting up Jenkins 2 to build and publish the image automatically, whenever you commit changes to your code repository.
Requirements
To run through this guide, you will need the following:
To build and run the Docker image locally: Mac OS X or Linux, and Docker installed
To set up Jenkins to build the image automatically: Access to a Jenkins 2.x installation
Writing a Dockerfile
To be able to build a Docker image with our app, we'll need a Dockerfile. You can think of it as a blueprint for Docker: it tells Docker what the contents and parameters of our image should be.
Docker images are often based on other images. For this exercise, we are basing our image on the official Node Docker image. This makes our job easy, and our Dockerfile very short. The grunt work of installing Node and its dependencies in the image is already done in our base image; we'll just need to include our application.
The Dockerfile is best stored with the code - this way any changes to it are versioned along with the actual application code.
Building the image in Jenkins
Now that we know our Docker image can be built, we'll want to do it automatically every time there is a change to the application code.
For this, we'll use Jenkins. Jenkins is an automation server often used to build and deploy applications.
Note: this guide assumes you are running Jenkins 2.0 or newer, with the Docker Pipeline plugin and Docker installed.
If you don't have access to a Jenkins installation, refer to wiki.jenkins-ci.org/display/J...
PIPELINES AS CODE: THE JENKINSFILE
Just like Dockerfiles, I'm a firm believer in storing Jenkins pipeline configuration as code, along with the application code.
It generally makes sense to have everything in the same repository; the application code, what the build artifact should look like (Dockerfile), and how said artifact is created automatically (Jenkinsfile).
We'll need to tell Jenkins what our stages are, and what to do in each one of them. For this we'll write a Jenkins Pipeline specification in a Jenkinsfile.
That's the entirety of our pipeline specification for Jenkins. Now, we'll just need to tell Jenkins two things:
Where to find our code
What credentials to use to publish the Docker image
We'll start by configuring the credentials:
CONFIGURING DOCKER HUB WITH JENKINS
To store the Docker image resulting from our build, we'll be using Docker Hub. You can sign up for a free account at hub.docker.com.
We'll need to give Jenkins access to push the image to Docker Hub. For this, we'll create Credentials in Jenkins, and refer to them in the Jenkinsfile.
As you might have noticed in the above Jenkinsfile, we're using docker.withRegistry to wrap the app.push commands - this instructs Jenkins to log in to a specified registry with the specified credential id (docker-hub-credentials).
We have successfully containerised an application, and set up a Jenkins job to build and publish the image on every change to a repository. Great work!
Next steps
Now that we have set up a basic delivery pipeline, there are a few more things to consider.
DEPLOYMENT
The next logical step in the pipeline would be to deploy the container automatically into a testing environment. For this, we could use something like Amazon Elastic Container Service or Rancher.
github.com/net-vinothkumar/ci... - วิทยาศาสตร์และเทคโนโลยี
you have covered 2 hours topic in 10 minutes Great Great Great work...All the best
Thanks a million for your valuable feedback happy learning interviewDot 🙏🎉
Clearly understand bro tq so much Pls do more videos
Short video but with all relevant details, great job. Thank you
Thanks a million
Thanks for wonderful session, its very clear. :)
Thanks a million for your excellent feedback, if you not yet subscribed kindly subscribe to InterviewDOT channel for latest software updates - happy learning - InterviewDOT
Thanks for wonderful session, with simple and valuable demo with sample use case. Much appreciated for your thought of sharing your knowledge to others.
Hi Baranidharan S, Wow, that was really an excellent feedback, I am really happy that it helped you, happy learning - InterviewDOT
your explanation is really amazing.. thanks for the video Brother
Thanks a million for your excellent feedback, if you not yet subscribed kindly subscribe to InterviewDOT channel for latest software updates - happy learning - InterviewDOT
Great! Your videos helpful for upskilling !
Dear Muthu Kumar, wow, thanks for your great feedback, I am really happy that you are able to learn, happy learning - InterviewDOT
Sir you mentioned about timer interval in Jenkins can you show us how it uses the timer interval of 1 minute for rebuilding and re deploying the application. That is the main of pipeline right
Wonderful explanation to know the complete process of DevOps process. covers all the required tools for an application deployment
Thanks a million for your excellent feedback, if you not yet subscribed kindly subscribe to InterviewDOT channel for latest software updates - happy learning - InterviewDOT
superb, romba vala vala kozhla kozhla illamal superaa oru presentation
Romba thanks for the great feedback , please stay tune for more educational videos ❤️
Excellent CICD explanation bro..keep up the good work. 👍
Thanks a lot for your excellent feedback Suresh, happy learning, all the best for your job search , InterviewDOT 👍
@@InterviewDOT sure..thank you 👍
semma explaination ,,,oru doubt how to upload .env files
Boss... REQUEST- Please create docker playlist if you have time.... So that it will be easy for the people like me who wants to take their DevOps or Cloud carrier into next level..
Dear Jaykumar Anburaja, Thanks for your request, sure will make a playlist when the time permits, happy learning, InterviewDOT
Tnks for the video can you explain me how to configure jenkins with kubernetes cluster
wonderful bro , Thanks a lot
Hi Sankar Dev , Thanks a million for your excellent feedback - InterviewDOT
really super and help ful for me please do more videos.
Thank you, I will
Great work
Thank you
Dear Sugeivan Senthinathan, Thanks a lot for your excellent feedback, I am so happy that effort finally was worth, thanks happy learning - InterviewDOT
Anna thank you so much for this video
Thanks a million for your excellent feedback, if you not yet subscribed kindly subscribe to InterviewDOT channel for latest software updates - happy learning - InterviewDOT
This is what i have been looking for a long time to understand cicd in a granular level. Thank you very much.
Dear Ganesh saravanan, Thanks a lot for your excellent feedback, I am really happy that you found it, happy learning, please share with your friends if you like, how did you find this tutorial ? in youtube search ? - InterviewDOT
@@InterviewDOT i have already subscribed to your channel ji.
wow - thanks - hope I will do my best to teach you - have a great day - InterviewDOT
@@InterviewDOT yes ji. Please create a playlist for each devops tools. It would be great learning for beginners like me. Thank you very much.
sure will create a devops playlist ,thanks for asking.
Excellent demo
Thanks a million - happy learning - InterviewDOT
Super ji wonderful appreciate it
Thanks a million Anand for your valuable feedback happy learning interviewDot 🙏
Boss, Nice Demo in native language :)
Also, I am looking Linux host hardening remediation scripts in reference to CIS benchmark, if you have any details keeps me posted. Thanks in Advance
Thanks a million for your excellent feedback,sure - please subscribe to InterviewDOT channel for software updates, happy learning - InterviewDOT
Thank you so much!!!
Glad it helped!
In Selenium with java using testng we can group the testcases and run particular group in maven.. same way is it possible to run particular testcases In Jenkins? If so can I know how it has to be done?
before enter i am empty after see this video you made me a devops engineer.
Thanks a million for your excellent feedback, if you not yet subscribed kindly subscribe to InterviewDOT channel for latest software updates - happy learning - InterviewDOT
Already subscribed
Cool, thanks a lot
Nice super All the best
Thanks a million Palani Vel for your valuable feedback happy learning InterviewDOT 🎊🙏
Do u have any seperate devops collection playlist bro ?
Nice Explanation
Thanks a million for your excellent feedback - InterviewDOT
How the jenkins is going to authenticate the K8s and docker. Please explain.
Thank you boss
Dear Jaykumar Anburaja, Thanks a lot for your excellent feedback, I am happy that it helped you, happy learning - InterviewDOT
Excellent
Thanks a million for your excellent feedback, if you not yet subscribed kindly subscribe to InterviewDOT channel for latest software updates - happy learning - InterviewDOT
Can you please explain about the CICD branches and docker registry, I was asked this question.
Thanks a million for your valuable feedback happy learning , sure will make it, InterviewDOT 🎊🙏
Does jenkins required program knowledge
Super 🎉
Super, thanks for the feedback
how jenkins is configured for executing shell commands using kubectl like "kubectl apply -f deployment.yml"? what are the plugins for minikube and how to configure? any help?
Thanks for the question, as far as I know, there is no need of plugins, in the build machine before executing kubectl commands, it has to be installed and configured, its a precondition - InterviewDOT
HI bro , to run this application whether Docker should be installed in our local machine . I am getting below error [INFO] --- dockerfile-maven-plugin:1.4.12:build (default) @ spring-boot-k8S ---
[INFO] dockerfile: null
[INFO] contextDirectory: C:\ProgramData\Jenkins\.jenkins\workspace\my pipeline after installed git locally
[INFO] Building Docker context C:\ProgramData\Jenkins\.jenkins\workspace\my pipeline after installed git locally
[INFO] Path(dockerfile): null
but dockerfile is available in the mentioned path]
bro i followed ur steps but i have error pls can u help me ?
sir i am a vmware admin. who will provide us the jenkins file