GitOps Suggested Flow
Glossary
Repository Types
- Application
- Application GitOps
- ArgoCD Configuration
- Helm base chart
The Process
Prerequisites
GitOps Repo Branch Protection
- Set rules on
main:
- Require PRs
- Require status checks to pass
- Require reviews (conditionally via CODEOWNERS)
- Disallow force pushes
CODEOWNERS Rules
- Require manual review for production changes (
/prod/ @sre-team, /non-prod/ @ci-bot)
- In branch protection rules, enable:
✅ “Require review from Code Owners”
Effect:
- Changes to
/prod/ require human review
- Changes to
/non-prod/ can be auto-approved if the CI bot is a code owner
Flows
Application Change
- Developer makes a source code change and merges to
main.
- Application CI pipeline runs:
- Generates a new version (e.g.,
10.0.0-202508071234-abcdef12345)
- Compiles and tests the application
- Uploads a JAR with the new version
- Uploads a Docker image with the new JAR
- Creates a PR to the GitOps repo to update
values.yml for the dev environment
- PR auto-merges when the GitOps repo build passes
- ArgoCD detects the repo change:
- Deploys the application to the dev environment
- Triggers component tests in CI
- CI tool runs component tests:
- After passing, tags the application and image
- Repeats for other environments until production
- Continuous delivery: PR for production version change requires manual merge
- Continuous deployment: PR set to auto-merge
Config Change
New Application
- Create new application Git repo
- Ops team updates ArgoCD repo with new application configuration
- ArgoCD picks it up automatically and creates a new Application
Additional Topics
Security – Access
- Introduce PR reviews and disable auto-merge for sensitive environments
- Additional safeguard: Disable automatic ArgoCD sync
- Use ArgoCD’s sync preview feature
- Fully automated testing for PRs
Security – Credentials
- Use SealedSecrets stored in Git, encrypted with the cluster’s public key and decrypted with the private key
- Alternative: Use ExternalSecrets with Vault
Database Schema Updates
- Spring Boot + Flyway/Liquibase: Schema updates happen on app startup
- Alternative: Use a Kubernetes Batch Job for schema upgrades with ArgoCD presync hook
Configuration – Reloading
- Use a dynamic annotation in Kubernetes deployment based on config checksum (example in
base-helm-charts)
- Config change updates checksum → K8s restarts application
Base Chart
- Maintain separately versioned Helm chart, overridden by teams via native Helm mechanisms
- Run
helm lint and unit tests with Helm plugin
- Optionally run end-to-end tests with Kind
Observability
- Scrape Argo’s built-in Prometheus metrics
- Use ArgoCD Notification Controller for alerts and notifications
Proof of Concept (POC)
Examples
Books