当前位置:网站首页>[cloud native] continuous integration and deployment (Jenkins)
[cloud native] continuous integration and deployment (Jenkins)
2022-07-23 16:08:00 【Have a drink no】
List of articles
Use helm install Jenkins To k8s colony , To configure CI/CD
First , add to repo:
helm repo add jenkins https://charts.jenkins.io
secondly , Create a k8s The name space :
kubectl create ns jenkins
next , install jenkins:
bash helm install jenkins jenkins/jenkins -n jenkins
Last , Check login address
export SERVICE_IP=$(kubectl get svc --namespace default jenkins --template '{
{ range (index .status.loadBalancer.ingress 0) }}{
{ .}}{
{ end }}') && echo http://$SERVICE_IP:8080/login
CI/CD
CI(Continuous Integration) Continuous integration
CI Its English name is Continuous Integration, Chinese translation for : Continuous integration .
CI in , Developers will frequently submit code to the trunk , The newly submitted code is before it is finally merged into the trunk , It needs to be verified by compilation and automated test flow . Continuous integration (CI) Is automatically detected after source code changes 、 Pull 、 Build and ( in the majority of cases ) The process of unit testing . The goal of continuous integration is to quickly ensure that new changes submitted by developers are good , And suitable for further use in the code base .CI The process execution and theoretical practice of the new code allows us to determine whether the new code and the original code can be correctly integrated together .
CI The goal is to simplify the integration into a simple 、 Easy to repeat daily development tasks , This helps to reduce the overall construction cost and find defects early in the development cycle . To use effectively CI We must change the habits of the development team , Encourage frequent iterative builds , And find out bug Early positive solutions .
CD (Continuous Delivery) Continuous delivery and (Continuous Deployment) Continuous deployment
Continuous delivery (CD)
Continuous delivery (CD) It's actually CI An extension of , The software delivery process is further automated , So that it can be easily deployed to the build environment at any time . The mature continuous delivery solution also shows a always deployable code base . Use CD after , Software release will become a routine event without any tension . The development team can release products at any time during daily development , There is no need for a detailed release plan or special post test .
complete CI After the automation process of building and unit testing and integration testing in , Continuous delivery automatically publishes validated code to the repository . In order to achieve an efficient continuous delivery process , Make sure that CI Has been built into the development pipeline . The goal of continuous delivery is to have a code base that can be deployed to the production environment at any time .
CD Focus on the deployment pipeline , The team automates the testing and deployment process through pipeline . This pipeline is an automatic system , You can perform a progressive set of test suites for the build .CD Highly automated , And it is also easy to configure in some cloud computing environments . At every stage of the pipeline , Alerts the team if the build fails critical tests . otherwise , Will continue to the next test , And automatically enter the next stage after continuously passing the test . The last part of the pipeline deploys the build to an environment equivalent to the production environment . This is a whole process , Because building 、 The deployment and environment are executed and tested together , It makes the build deployable and verifiable in a real production environment .
Continuous deployment (CD)
Continuous deployment extends continuous delivery , So that the software build is automatically deployed when it passes all tests . In a process like this , There is no need to decide when and how to put into the production environment .CI/CD The final step of the system will be in the built components / Automatically deploy packages when they exit the pipeline . Such automated deployment can be configured to quickly distribute components to customers 、 Function module or patch , And accurately describe what is currently available . Organizations with continuous deployment can quickly deliver new functionality to users , Get quick feedback from users about the new version , And can quickly deal with any obvious defects . Quick feedback from users on features that are useless or misunderstood helps the team plan for investment , Avoid focusing on areas that are not easy to generate returns .
With DevOps The development of , The new is used to implement CI/CD Pipeline automation tools are also emerging . These tools usually work with a variety of development tools , Including images GitHub Such a code warehouse and Jira In this way bug Tracking tools . Besides , With SaaS This delivery method has become more popular , Many tools can run in a cloud environment where modern developers run applications , for example GCP and AWS. But for a mature CI/CD The Conduit (Pipeline) Come on , The final phase is continuous deployment . As continuous delivery —— Automatically publish production ready builds to the code repository —— Extension of , Continuous deployment can automatically publish applications to the production environment . At present, the most popular automation tool is Jenkins.
Continuous deployment means that all changes are automatically deployed to the production environment . Continuous delivery means that all changes can be deployed to the production environment , But for business reasons , You can choose not to deploy . If continuous deployment is to be implemented , Continuous delivery must be implemented first . Continuous delivery does not mean that every change of software should be deployed to the production environment as soon as possible , It means that any code change can be deployed at any time . Continuous delivery represents a capability , Continuous deployment is one way ; Continuous deployment is the highest stage of continuous delivery .
Once you land jenkins , You can configure a series of CI/CD action :
- CI
- Pull the code
- structure / test / pack
- Build a container image
- CD
- Push the container image to the image center
- perform k8s command , Pull the mirror image
- perform k8s command , Deploy
- perform k8s command , Scroll to update
This is the end of this article ,
If you have any harvest, you are welcome to like, collect and pay attention to ️, Your encouragement is my biggest motivation .
If you have any wrong questions, you are welcome to point out .
Home page : Share a cup of no blog summaryKeep loving , Go to the next mountain and sea .

边栏推荐
猜你喜欢

js过滤/替换敏感字符

One minute rule for sequential disk access

Google Earth engine -- null value problem in image statistics
![php:filter伪协议之[BSidesCF 2020]Had a bad day](/img/ad/1e23fadb3f1ce36b297aaa767d9099.png)
php:filter伪协议之[BSidesCF 2020]Had a bad day

什么是真正的 HTAP ?(二)挑战篇

Of the 24 almost inevitable JVM interview questions, I only know 7. How many can you answer?

Safe and reasonable use of electricity to harvest a cool "summer"

【云原生】持续集成和部署(Jenkins)

数字化转型时代的企业数据新基建 | 爱分析报告

Bug modification
随机推荐
List merging (summer vacation daily question 3)
ECS remote monitoring
(Zset) how is the underlying layer of redis stored with a hop table
太拼了!腾讯T4大佬凌晨4点还在熬夜,竟是在整理这分布式事务笔记
PHP code audit 4 - SQL injection vulnerability
Idées de conception sur l'initialisation des paramètres d'entrée de page
harbor镜像仓库
3D数学 - 矢量
C语言学习笔记
24 道几乎必问的 JVM 面试题,我只会 7 道,你能答出几道?
【攻防世界WEB】难度三星9分入门题(上):simple_js、mfw
FMDB的封装与使用
3D math - vector
ten thousand and one hundred
MySQL-字符串按照数值排序
From the big guy baptism! 2022 headline first hand play MySQL advanced notes, and it is expected to penetrate P7
Mysql—主从复制
10100
Learning summary of ugly code
【云原生】docker环境中安装mysql、redis服务