This repository contains ArgoCD Application manifests for the Todo App project, implementing GitOps deployment patterns using the App of Apps methodology.
This GitOps repository serves as the single source of truth for deployment configurations across different environments. It decouples deployment manifests from application code, enabling:
- Declarative Infrastructure: All deployments defined as code
- Version Control: Full history of infrastructure changes
- Automated Deployment: Continuous deployment via ArgoCD
- Environment Separation: Isolated staging and production configurations
- Audit Trail: Complete deployment history and rollback capabilities
This repository implements ArgoCD's App of Apps pattern:
Root Application (this repo)
βββ Staging Application
β βββ Source: local-devops-infrastructure repo
β βββ Path: helm-charts/todo-app
β βββ Branch: master (continuous deployment)
β βββ Values: values.yaml + values-staging.yaml
βββ Production Application
βββ Source: local-devops-infrastructure repo
βββ Path: helm-charts/todo-app
βββ Branch: git tags (v1.0.0, v1.1.0, etc.)
βββ Values: values.yaml + values-prod.yaml
todo-app-gitops/
βββ argocd-manifests/
β βββ root-application.yaml # App of Apps root
β βββ environments/
β βββ staging.yaml # Staging environment app
β βββ production.yaml # Production environment app
βββ README.md # This file
- Code changes pushed to
masterbranch in local-devops-infrastructure - Jenkins CI/CD pipeline builds and pushes images
- ArgoCD automatically syncs staging environment
- Application deployed to
stagingnamespace
- Git tag created (e.g.,
v1.0.0) in local-devops-infrastructure repo - Jenkins pipeline updates
production.yamlwith new tag - Changes committed to this GitOps repository
- ArgoCD syncs production environment with specific version
- Application deployed to
productionnamespace
- ArgoCD installed and configured
- Access to Kubernetes cluster
- Proper RBAC permissions
# Apply the root application to ArgoCD
kubectl apply -f argocd-manifests/root-application.yaml -n argocdThis command will:
- Create the root App of Apps application
- Automatically deploy staging and production child applications
- Set up continuous monitoring of this repository
# Check ArgoCD applications
kubectl get applications -n argocd
# Expected output:
# NAME SYNC STATUS HEALTH STATUS
# root-app Synced Healthy
# staging-todo-app Synced Healthy
# production-todo-app Synced HealthyNavigate to your ArgoCD installation and verify applications are deployed correctly.
- Purpose: Entry point for App of Apps pattern
- Source: This GitOps repository
- Path:
argocd-manifests/environments - Sync Policy: Automatic with prune and self-heal
- Target Namespace:
staging - Source Branch:
master(continuous deployment) - Helm Values:
values.yaml+values-staging.yaml - Sync Policy: Automatic with namespace creation
- Target Namespace:
production - Source Branch: Git tags (e.g.,
v1.0.0) - Helm Values:
values.yaml+values-prod.yaml - Sync Policy: Manual (no automatic sync)
Applications require Docker registry secrets in each namespace:
# Create secrets for staging
kubectl create secret docker-registry github-registry-secret \
--namespace=staging \
--docker-server=ghcr.io \
--docker-username=<GITHUB_USERNAME> \
--docker-password=<GITHUB_TOKEN>
# Create secrets for production
kubectl create secret docker-registry github-registry-secret \
--namespace=production \
--docker-server=ghcr.io \
--docker-username=<GITHUB_USERNAME> \
--docker-password=<GITHUB_TOKEN>Ensure ArgoCD has proper permissions to deploy to target namespaces.
- Resource Limits: Lower CPU/memory for cost optimization
- Replica Count: Single replica for most services
- Monitoring: Basic health checks
- Data: Test data and mock services
- Resource Limits: Production-grade CPU/memory allocation
- Replica Count: Multiple replicas for high availability
- Monitoring: Comprehensive health checks and metrics
- Data: Production data with proper backups
This repository integrates with Jenkins CI/CD pipeline:
- Feature Branches: No GitOps changes (staging uses master branch)
- Master Branch: Automatic staging deployment via ArgoCD sync
- Git Tags: Jenkins updates
production.yamlwith new tag and commits to this repo
- Fork this repository
- Create feature branch (
git checkout -b feature/update-config) - Make configuration changes
- Test changes in staging environment
- Create pull request
- Small Changes: Keep commits focused and atomic
- Descriptive Messages: Use clear commit messages
- Test First: Validate changes in staging before production
- Review Process: Require PR reviews for production changes
- local-devops-infrastructure: Main application code and Helm charts
- jenkins-shared-library: Reusable Jenkins pipeline functions
This project is licensed under the MIT License.
Project Owner: Kerem AR
- GitHub: @KeremAR
Note: This is a GitOps repository. Direct changes to Kubernetes clusters should be avoided. All infrastructure changes should go through this repository for proper version control and audit trails.