Skip to content

GitOps deployment repository implementing ArgoCD's App of Apps pattern for Todo application. Manages staging/production environments with automated CI/CD integration via Jenkins. Enables declarative infrastructure, version control for deployments, environment separation, and continuous deployment

Notifications You must be signed in to change notification settings

KeremAR/todo-app-gitops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Todo App GitOps - ArgoCD Manifests Repository

GitOps Kubernetes Helm

This repository contains ArgoCD Application manifests for the Todo App project, implementing GitOps deployment patterns using the App of Apps methodology.

πŸ“‹ Repository Purpose

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

πŸ—οΈ App of Apps Pattern

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

πŸ“ Repository Structure

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

πŸ”„ Deployment Workflow

Staging Deployment (Automatic)

  1. Code changes pushed to master branch in local-devops-infrastructure
  2. Jenkins CI/CD pipeline builds and pushes images
  3. ArgoCD automatically syncs staging environment
  4. Application deployed to staging namespace

Production Deployment (Tag-based)

  1. Git tag created (e.g., v1.0.0) in local-devops-infrastructure repo
  2. Jenkins pipeline updates production.yaml with new tag
  3. Changes committed to this GitOps repository
  4. ArgoCD syncs production environment with specific version
  5. Application deployed to production namespace

πŸš€ Quick Start

Prerequisites

  • ArgoCD installed and configured
  • Access to Kubernetes cluster
  • Proper RBAC permissions

1. Deploy Root Application

# Apply the root application to ArgoCD
kubectl apply -f argocd-manifests/root-application.yaml -n argocd

This command will:

  • Create the root App of Apps application
  • Automatically deploy staging and production child applications
  • Set up continuous monitoring of this repository

2. Verify Deployment

# 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        Healthy

3. Access ArgoCD UI

Navigate to your ArgoCD installation and verify applications are deployed correctly.

πŸ”§ Configuration Details

Root Application (root-application.yaml)

  • Purpose: Entry point for App of Apps pattern
  • Source: This GitOps repository
  • Path: argocd-manifests/environments
  • Sync Policy: Automatic with prune and self-heal

Staging Application (environments/staging.yaml)

  • Target Namespace: staging
  • Source Branch: master (continuous deployment)
  • Helm Values: values.yaml + values-staging.yaml
  • Sync Policy: Automatic with namespace creation

Production Application (environments/production.yaml)

  • 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)

πŸ”’ Security Considerations

Image Pull Secrets

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>

RBAC Permissions

Ensure ArgoCD has proper permissions to deploy to target namespaces.

🎯 Environment-Specific Configuration

Staging Environment

  • 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

Production Environment

  • 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

πŸ”„ CI/CD Integration

This repository integrates with Jenkins CI/CD pipeline:

  1. Feature Branches: No GitOps changes (staging uses master branch)
  2. Master Branch: Automatic staging deployment via ArgoCD sync
  3. Git Tags: Jenkins updates production.yaml with new tag and commits to this repo

🀝 Contributing

Making Changes

  1. Fork this repository
  2. Create feature branch (git checkout -b feature/update-config)
  3. Make configuration changes
  4. Test changes in staging environment
  5. Create pull request

Best Practices

  • 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

πŸ”— Related Repositories

πŸ“ License

This project is licensed under the MIT License.

πŸ“ž Contact

Project Owner: Kerem AR


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.

About

GitOps deployment repository implementing ArgoCD's App of Apps pattern for Todo application. Manages staging/production environments with automated CI/CD integration via Jenkins. Enables declarative infrastructure, version control for deployments, environment separation, and continuous deployment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published