ArgoCD+Jenkins Pipeline Automated Application Deployment
Create helm repository
First, create a basic Helm template repository:
|
|
For actual deployment, you need to customize your own helm template according to your business. I will directly use our internal custom universal template for quick deployment; you can also refer to the helm chart maintained by bitnami (https://github.com/bitnami/charts/tree/master/bitnami)
Jenkins credential configuration argocd token information
Configure Jenkins pipeline writing
Here we take the gotest project (https://code.test.cn/hqliang/gotest) as an example
|
|
Configure gitlab webhook to trigger Jenkins
Jenkins configuration to trigger build
gitlab configuration webhook
Push tag to remote branch
Jenkins pipeline build
Go to Jenkins to view the pipeline build results as follows:
Docker automatically packages and pushes to harbor
Create the Argo application and deploy it to the k8s cluster
Finally, check the synchronization status. It shows that it has been published to the k8s cluster normally:
Let’s go to the argocd dashboard to see the application flow chart. The various components of the application are running normally.
Use kubectl to obtain the created resources:
Finally, verify whether the business is accessible. Visit http://gotest.test.cn/df to view the container disk space
Summary & Optimization
Whether through the jenkins pipeline or through gitlab CI, we can better integrate argocd and finally achieve one-click deployment of business applications.