DevOps Deployment Workflow
In a traditional DevOps pipeline, the CI server (e.g., Jenkins, GitLab CI, CircleCI) handles both build and deployment:-
Commit & Build
- A developer pushes code to a Git repository.
- The CI server runs unit tests, builds the application, and packages it into a Docker image.
-
Push Image
- The image is tagged (e.g.,
repo/app:v1.2.3) and pushed to a container registry (Docker Hub, ECR, GCR).
- The image is tagged (e.g.,
-
Deploy to Kubernetes
- The same CI pipeline uses stored Kubernetes credentials to apply manifests directly:
Challenges in DevOps Deployment
Storing Kubernetes credentials in your CI/CD server can expose your cluster if the server is compromised.
GitOps Deployment Workflow
GitOps decouples build from deploy by introducing an in-cluster agent (often called an operator) that continuously reconciles Git state with the live cluster.Common CI Steps (Same as DevOps)
- Developer commits code.
- CI server builds, tests, and pushes the Docker image to the registry.
Deployment Options
- Agent watches registry tags or watches the Git repo directly.
- On detecting a new tag, agent updates or pulls manifests and applies changes. | | B | 1. Extend CI pipeline to clone the manifests repo.
- CI updates
deployment.yamlwith the new image tag:
- CI opens a Pull Request against the manifest repository.
- After review & merge, the in-cluster agent pulls and applies the updated manifests. |
In both options, the CI server never needs direct access to Kubernetes. All deployment actions are driven by Git operations.