DevOps Pipeline
A typical DevOps pipeline operates as follows:- A developer writes code in an Integrated Development Environment (IDE) and commits it to a source code management system.
- A Continuous Integration (CI) process detects the commit, runs tests, and builds the necessary artifacts.
- The pipeline then creates a container image and publishes it to a container repository.
- Finally, the Continuous Deployment (CD) process connects to a Kubernetes cluster and uses a command-line tool such as
kubectl(with imperative commands) to push updates directly to the cluster.
In DevOps, the deployment is initiated by pushing changes directly into the cluster.
GitOps Pipeline
While the CI processes in a GitOps pipeline mirror those of DevOps up to the point of publishing the container image, the deployment process is distinct:- Two separate Git repositories are maintained: one dedicated to application code and another for Kubernetes manifests.
- Once the image is published, the manifest repository is cloned and updated—typically the new image name is specified. These changes are then committed and pushed.
- The pipeline automatically raises a pull request for the manifest repository. A team member reviews the pull request, suggests adjustments if necessary, and merges the changes upon approval.
- A GitOps operator, running within the Kubernetes cluster, continuously monitors the repository. When changes are detected, it synchronizes the cluster state to match the repository configuration.
In a GitOps pipeline, the deployment operator pulls changes from the repository and applies them to the cluster, contrasting with the push-based approach in traditional DevOps workflows.
