当前位置:网站首页>Understand and apply continuous deployment Argo CD
Understand and apply continuous deployment Argo CD
2022-07-21 02:57:00 【taoli-qiao】
Argo-CD yes Kubernetes A declarative 、GitOps Continuous delivery tools .argo-cd The advantage is that , Application definition 、 Configuration and environment are declarative , And subject to version control ; Application deployment and lifecycle management are automated .
argo-cd Be realized as kubernetes controller , The controller continuously monitors the running application , And the current active state and the desired target state ( stay git Specified in storage ) Compare . When the active state deviates from the target state and the deployed application is marked OutofSync. in addition ,argo-cd Report visual differences , At the same time, it provides the function of automatically or manually synchronizing the real-time state to the desired target state . And , stay Git Any changes made to the desired target state in the warehouse can be automatically applied and reflected in the specified target environment .
Next, we will demonstrate through practical examples argo-cd working process . First installation argo-cd.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
After installation argocd-server It is amended as follows NodePort Type of service, So that you can get through node node IP+ The port number is accessed and installed on the Internet argocd.
By looking at secret obtain argocd Login password for , User name is admin. The password you checked is through base64 Encrypted , You need to decrypt before logging in argocd Service .
kubectl get secret -n argocd argocd-initial-admin-secret -oyaml
echo '$password'|base64 --decode
Sign in argocd after , establish project, Creating project You need to set the code warehouse git Address , To configure Destination, That is, the deployed cluster address namespace,git The code warehouse address is a Deployment Of yaml file .
After the project is created , Click on Sync,argo-cd It will start from git Pull up depoyment Of yaml file , And complete the deployment .
At this time, if you do not modify git Medium deployment file , Instead, you can modify the deployment directly in the cluster deployment file , Change to a nonexistent image edition , After modification ,pod It should fail to start .
At this point to see argo-cd, Will see argo-cd Automatically update version information , Get the latest deployment , You can see argo-cd It also shows new pod Failed to start .
here , If you want to go back to git Warehouse yaml File configuration information , Just in argo-cd Click on the Sync button .
see pod Information , You can see that the startup failed pod It has been deleted ,deployment Of yaml Restore files to and git The versions stored in are consistent .
Look again argo-cd, You can see that the project also obtains Sync After pod Deployment .
Demonstrate through the above practical example , You can see the introduction of argo-cd It can effectively avoid misoperation in production , When problems are found , It can be quickly rolled back to git Stored in warehouse yaml Defined deployment version .
perform kubectl scale command , For deployment httpserver Of pod Expand horizontally , Run after executing the command pod from 1 One becomes 2 individual .
kubectl scale deployment httpserver --replicas=2
At this point to see argo-cd Project , The project status will show OutOfSync state , Because when creating a project, you set it manually Sync.
Do it manually Sync after , View deployment information , You can see argo-cd There is a 2 individual pod be in running state .
Of course, you can also set the project to automatic Sync Pattern , So in the production environment scale 了 deployment after ,argo-cd The latest deployment information will be automatically synchronized .
边栏推荐
- About Variables
- How should enterprise users choose aiops or APM?
- AI2 (APP inventor 2) offline version
- [wechat applet] text field input with maximum word limit (1/100)
- Software interface and simple system simulation
- 【英雄哥七月集训】第 19天:二叉树
- Practice of online problem feedback module (VIII): realize image upload function (Part 1)
- Technical dry goods | mindspire self-developed high-order optimizer source code analysis and practical application
- From concept to security practice: a basic guide to software supply chain
- 三极管原理
猜你喜欢
织梦添加栏目修改栏目时提示“保存目录数据时失败,请检查你的输入资料是否存在问题”
How to convert Excel to word format? Method of converting Excel to word format
How to delete headers, footers and horizontal lines in word documents
Doris connector and Flink CDC realize accurate access to MySQL database and table exactly once
How should enterprise users choose aiops or APM?
How to delete different text in Excel spreadsheet in batch?
How to set percentage color for Excel data bar? Excel data bar auto fill color by percentage tutorial
密码密钥硬编码检查
电子招标采购商城系统:优化传统采购业务,提速企业数字化升级
Do you dare to use BigDecimal without mastering these pits?
随机推荐
使用renren-generator逆向生成CRUD代码
Huawei's general card identification function enables multiple card bindings with one key
虚拟主机代理商需要注意什么?
Operation of STL Vector
Flag signal
STL list constructor, size
Swagger重点配置项
域名反查和whois反查是什么意思?
With high concurrency, ratelimiter and semaphore are used to limit the flow of access resources
AI2 (APP inventor 2) offline version
How to convert Excel to word format? Method of converting Excel to word format
[wechat applet]: paging request data, pull-up load, pull-down refresh.
[AD learning record] copper clad
解决mysql5.6数据库Specified key was too long; max key length is 767 bytes问题
Chinese anchors can also bring goods overseas! Simultaneous interpretation helps live broadcast applications expand overseas markets
[wechat applet] text field input with maximum word limit (1/100)
TASK02|EDA初体验
How to protect user privacy without password authentication?
How do independent website sellers use Facebook homepage for social media marketing?
[Muduo log system 2] timestamp time