- The Application Repository contains all the application code along with its associated resources, such as configuration data, certificates, and container images.
- The Manifest Repository houses the Kubernetes manifest YAML files that define how the application is deployed.
Whenever a developer pushes changes to the application repository—this might include modifications to a Dockerfile, Jenkins configuration, or application code—a CI/CD system (such as Jenkins Pipelines) automatically triggers a series of stages, such as unit testing, application builds, Docker image creation, and image pushes to a container registry.
- Clone the Manifest Repository: The pipeline retrieves the repository that holds the Kubernetes manifests.
- Update Image Version: The deployment YAML file is updated to reference the newly built Docker image.
- Feature Branch and Pull Request: The changes are pushed to a feature branch, and a pull request is opened against the main Manifest Repository.
If the newly deployed image introduces any issues, you can easily rollback to a stable state. Administrators or developers can inspect the application history using the ArgoCD CLI. This process allows quick identification and execution of a rollback.
Summary
This article has provided an overview of how a CI/CD pipeline integrates with GitOps, explaining the role of separate Git repositories, the operation of the ArgoCD operator, and the steps needed to update and rollback deployments in a Kubernetes environment. In upcoming demos, we will cover:- Creating a Jenkinsfile with all necessary stages.
- Opening pull requests to update the Manifest Repository.
- Observing how ArgoCD pulls changes and performs rollbacks when needed.