In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Jenkins how to use Kubernetes to achieve continuous service integration, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
The overall process is shown in the following figure:
It is divided into five processes.
1. The prototype development of the requirements is completed, and the developer is involved in the development. 2. The developer submits the code to the code warehouse git/SVN;3, the hook triggers jenkins master to start a build, or the developer clicks on the build. According to the situation, jenkins pulls the substitution code and maven to compile.
It is assumed that you have completed Jenkins installation, remote tools, java compilation environment configuration, and so on. If there is no configuration, look for it online and have a lot of information. In fact, this part is relatively similar to the way you used Jenkins before. If you use git, this is still the git pull code, and before it was packaged by maven/ant, then it is still packaged by maven/ant.
4. Docker image construction and image submission to the repository; docker image construction needs to be different from the previous form. If you have installed the docker plug-in on Jenkins, you can build it directly on the current machine. If not, no problem, remote SSH to a server that can build docker image to pack the image.
There are two points to note in the packaging process of docker build-t docker.hub.com/dev/tomcat-webapps:$version .docker push docker.hub.om/dev/tomcat-webapps:$version. First, docker requires tag to build an image. This tag can be parameterized by Jenkins. Enter the version number before building. If you do not enter it, enter the default value.
Second, how to deal with the historical mirror image? It is recommended that after each image construction is completed, delete the images that are not running through the Jenkins configuration command.
Deal with these intermediates according to the use scenario.
Docker rm $(docker ps-a-Q)
5. The Kubernetes yaml running process pulls the docker image construction product from the warehouse to start the entire service, and the tester starts the full function and performance test. Kubectl apply-f config.yamlsed-I's tomcat_deployment.yaml kubectl apply-f webappsUniverse ${version} / 'web-f tomcat_deployment.yaml
3. We should pay attention to the problems in the process of construction.
The construction of tag for each image of docker is different, how to pass it to K8s yaml?
The version number can already be changed by parameterized construction during the construction of the docker image. Similarly, we first add a known placeholder to the image part of the k8s orchestration file.
Then the version number is dynamically passed and replaced into K8s yaml
Will it be helpful for you to read the above content after reading the above sed-I-I-tomcat_deployment.yaml;, which will help you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.