-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
We currently manage our Kubernetes manifests by storing them in our Git repository under the k8s/ directory. However,
deployments are likely triggered manually or via CI scripts using kubectl apply.
To improve this, we will adopt a GitOps workflow using Argo CD, making Git the single source of truth for our
application's desired state.
Goal
- Automate the deployment process by making Git the single source of truth.
- Ensure that any change merged to the
mainbranch is automatically and safely reflected in the Kubernetes cluster. - Increase security by removing the need for direct
kubectlaccess for deployments. - Provide a clear audit trail and an easy rollback mechanism through Git history.
Task Overview
- Create a dedicated namespace for Argo CD (e.g.,
argocd). - Install Argo CD into the cluster using the official manifests or Helm chart.
- Configure repository access so Argo CD can read from our Git repository.
- Implement the "App of Apps" pattern:
- Create a new directory (
k8s/argo-cd/) to hold the Argo CDApplicationmanifests. - Define "child"
Applicationresources for our existing components (app,logging,monitoring). - Create a "root"
Applicationthat manages all other applications.
- Create a new directory (
- Bootstrap Argo CD by manually applying the "root" application manifest once.
- Verify the synchronization by making a test change in a manifest (e.g., update an image tag or replica count)
and observing that Argo CD automatically applies it. - Update CI/CD pipelines to remove the old
kubectl applydeployment steps. The pipeline's role will be to
build and push the container image. - Update project documentation (
README.md) to reflect the new GitOps deployment workflow.
Requirements
- The state of the Kubernetes cluster must match the configuration defined in the
k8s/directory of the Git
repository. - The
camera-onboardingapplication, along withloggingandmonitoringstacks, must be managed by Argo CD and
report aSyncedandHealthystatus. - Manual deployments via
kubectl applyshould be deprecated as the standard workflow.
Notes
- The initial setup should be performed on a test/staging cluster, not directly in production.
- The "App of Apps" pattern is recommended to manage multiple components declaratively.
- Argo CD's UI can be exposed via
kubectl port-forwardfor initial setup and verification. - Remember to secure Argo CD by changing the default admin password after installation.
Deliverables
- Argo CD is deployed and configured in the cluster.
- All applications (
app,logging,monitoring) are managed by Argo CD. - A change pushed to the
k8s/directory in themainbranch results in an automatic update on the cluster. - Updated documentation outlining the new deployment process.
Metadata
Metadata
Assignees
Labels
No labels