Skip to content

lurodrisilva/gitops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AKS Baseline - GitOps Repository

A GitOps repository for managing AKS cluster addons and platform services using ArgoCD. This repository works in conjunction with 01-aks-tf which deploys the infrastructure (AKS, ArgoCD, Crossplane, Azure Service Operators).

πŸš€ Quick Start

This repository is automatically deployed by ArgoCD once the infrastructure is provisioned:

  1. Deploy Infrastructure (from 01-aks-tf)

    cd ../01-aks-tf
    make init ENV=dev
    make apply
  2. ArgoCD Auto-Deploys This Repo

    • ArgoCD automatically syncs base_chart/ from this repository
    • Enabled addons are deployed based on base_chart/values.yaml
  3. Access ArgoCD

    # ArgoCD URL
    http://luciano-argocd.eastus.cloudapp.azure.com
    
    # Get admin password
    kubectl -n devops-system get secret argocd-initial-admin-secret \
      -o jsonpath="{.data.password}" | base64 -d

πŸ“‹ Table of Contents

🎯 Overview

This GitOps repository manages Kubernetes platform addons through ArgoCD Applications. Each addon is:

  • Declaratively defined in base_chart/templates/
  • Configured via base_chart/values.yaml
  • Automatically deployed by ArgoCD when enabled
  • Self-healing with automated sync policies

Key Features

  • GitOps Workflow: All changes through Git
  • ArgoCD Applications: Declarative addon management
  • Helm-based: Addons use Helm charts with dependencies
  • Namespace Isolation: Organized by system component
  • Automated Sync: Self-healing and pruning enabled
  • Sync Waves: Controlled deployment order

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    AKS Cluster (01-aks-tf)                      β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚                  ArgoCD (devops-system)                    β”‚ β”‚
β”‚  β”‚                                                            β”‚ β”‚
β”‚  β”‚  Monitors: https://github.com/lurodrisilva/gitops         β”‚ β”‚
β”‚  β”‚  Path: base_chart/                                        β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                           ↓                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚            ArgoCD Applications (from base_chart)           β”‚ β”‚
β”‚  β”‚                                                            β”‚ β”‚
β”‚  β”‚  Each addon in values.yaml (enabled: true) creates:       β”‚ β”‚
β”‚  β”‚  β€’ ArgoCD Application resource                            β”‚ β”‚
β”‚  β”‚  β€’ Points to: addon_charts/<addon_name>/                 β”‚ β”‚
β”‚  β”‚  β€’ Deploys: Helm chart with values                       β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                           ↓                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚                   Deployed Addons                          β”‚ β”‚
β”‚  β”‚                                                            β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚ β”‚
β”‚  β”‚  β”‚ Cert-Manager β”‚  β”‚   Reloader   β”‚  β”‚CloudNative-PGβ”‚   β”‚ β”‚
β”‚  β”‚  β”‚  (enabled)   β”‚  β”‚  (enabled)   β”‚  β”‚  (enabled)   β”‚   β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚ β”‚
β”‚  β”‚                                                            β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚  β”‚  β”‚     More Addons (as enabled in values.yaml)         β”‚ β”‚ β”‚
β”‚  β”‚  β”‚  Metrics β€’ Observability β€’ Karpenter β€’ etc.          β”‚ β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How It Works

  1. Infrastructure Deployment (01-aks-tf):

    • Terraform deploys AKS cluster
    • Installs ArgoCD, Crossplane, Vault
    • Configures ArgoCD to watch this repository
  2. GitOps Application (this repo):

    • ArgoCD deploys the base_chart Helm chart
    • Chart reads values.yaml for enabled addons
    • Creates ArgoCD Application for each enabled addon
  3. Addon Deployment:

    • Each Application points to addon_charts/<addon_name>/
    • Helm chart with dependencies deployed
    • Continuous sync and self-healing

πŸ“ Project Structure

00-aks-baseline/
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ docs/                              # Documentation
β”‚   β”œβ”€β”€ README.md                      # Documentation index
β”‚   β”œβ”€β”€ setup/
β”‚   β”‚   └── quickstart.md              # Getting started
β”‚   β”œβ”€β”€ guides/
β”‚   β”‚   β”œβ”€β”€ adding-addons.md           # How to add new addons
β”‚   β”‚   └── enabling-addons.md         # How to enable/disable addons
β”‚   β”œβ”€β”€ architecture/
β”‚   β”‚   └── gitops-workflow.md         # GitOps architecture details
β”‚   └── reference/
β”‚       β”œβ”€β”€ addon-list.md              # Complete addon reference
β”‚       └── values-schema.md           # values.yaml documentation
β”‚
β”œβ”€β”€ base_chart/                        # Main Helm chart (ArgoCD app-of-apps)
β”‚   β”œβ”€β”€ Chart.yaml                     # Chart metadata
β”‚   β”œβ”€β”€ values.yaml                    # Addon enable/disable configuration
β”‚   └── templates/                     # ArgoCD Application templates
β”‚       β”œβ”€β”€ 00-resources.yaml          # Crossplane resources
β”‚       β”œβ”€β”€ 01-karpenter.yaml          # Karpenter autoscaler
β”‚       β”œβ”€β”€ 02-metrics-server.yaml     # Metrics server
β”‚       β”œβ”€β”€ 03-providers.yaml          # Crossplane providers
β”‚       β”œβ”€β”€ 04-kube-state-metrics.yaml # Kube state metrics
β”‚       β”œβ”€β”€ 09-cert-manager.yaml       # Certificate manager
β”‚       β”œβ”€β”€ 10-reloader.yaml           # Config/Secret reloader
β”‚       β”œβ”€β”€ 14-cloudnative-pg.yaml     # PostgreSQL operator
β”‚       └── ...                        # Other addons
β”‚
└── addon_charts/                      # Individual addon Helm charts
    β”œβ”€β”€ cert-manager/                  # Certificate management
    β”‚   β”œβ”€β”€ Chart.yaml                 # Chart with upstream dependency
    β”‚   └── values.yaml                # Custom values
    β”œβ”€β”€ reloader/                      # Automatic pod reloader
    β”œβ”€β”€ cloudnative-pg/                # PostgreSQL operator
    β”œβ”€β”€ karpenter/                     # Cluster autoscaler
    β”œβ”€β”€ metrics-server/                # Resource metrics
    β”œβ”€β”€ kube-state-metrics/            # Cluster state metrics
    β”œβ”€β”€ observability/                 # Monitoring stack
    β”œβ”€β”€ opentelemetry-operator/        # OpenTelemetry
    β”œβ”€β”€ opentelemetry-collector/       # Telemetry collector
    β”œβ”€β”€ providers/                     # Crossplane providers
    β”œβ”€β”€ providers-config/              # Provider configurations
    β”œβ”€β”€ resources/                     # Crossplane managed resources
    └── ...                            # Additional addons

πŸŽ›οΈ Available Addons

Currently Enabled

Addon Purpose Namespace
cert-manager TLS certificate management control-plane-system
reloader Auto-reload pods on ConfigMap/Secret changes control-plane-system
cloudnative-pg PostgreSQL operator for databases resources-system

Available (Disabled)

Addon Purpose Namespace
resources Crossplane managed Azure resources resources-system
providers Crossplane provider installations resources-system
providers-config Crossplane provider configurations resources-system
karpenter Kubernetes cluster autoscaler karpenter
metrics-server Core resource metrics control-plane-system
kube-state-metrics Kubernetes object metrics control-plane-system
node-problem-detector Node health monitoring control-plane-system
opentelemetry-operator OpenTelemetry operator control-plane-system
opentelemetry-collector Telemetry collection control-plane-system
datadog-operator Datadog monitoring control-plane-system
cluster-secret Secret replication control-plane-system
kubecost Cost monitoring control-plane-system
observability Full monitoring stack control-plane-system
backup Backup solutions backup-system

πŸ“š Documentation

Getting Started

Guides

Reference

⚑ Quick Reference

Enable an Addon

  1. Edit base_chart/values.yaml:

    metrics_server:
      addon_name: metrics-server
      enabled: true              # Change to true
      namespace: control-plane-system
  2. Commit and push:

    git add base_chart/values.yaml
    git commit -m "Enable metrics-server addon"
    git push
  3. ArgoCD auto-syncs within ~3 minutes (or sync manually)

Check Addon Status

# List all ArgoCD applications
kubectl get applications -n control-plane-system

# Check specific addon
kubectl get application cert-manager -n control-plane-system

# View addon resources
kubectl get all -n control-plane-system -l app.kubernetes.io/instance=cert-manager

Access ArgoCD UI

# URL
http://luciano-argocd.eastus.cloudapp.azure.com

# Username
admin

# Password
kubectl -n devops-system get secret argocd-initial-admin-secret \
  -o jsonpath="{.data.password}" | base64 -d

Manual Sync

# Via kubectl
kubectl patch application cert-manager -n control-plane-system \
  --type merge -p '{"operation":{"sync":{}}}'

# Via ArgoCD CLI
argocd app sync cert-manager

πŸ”§ Configuration

Global Settings

Edit base_chart/values.yaml:

global:
  control_plane:
    namespace: control-plane-system      # ArgoCD namespace
    project: addons-project              # ArgoCD project
    repo: https://github.com/lurodrisilva/gitops  # This repo
    deployment:
      limit: 5                           # Retry limit
      backoff:
        duration: 240s                   # Initial backoff
        factor: 2                        # Backoff multiplier
        maxDuration: 10m                 # Max backoff duration

Addon Configuration

Each addon in values.yaml:

addon_name:
  addon_name: <name>          # Matches directory in addon_charts/
  enabled: true/false         # Enable/disable addon
  namespace: <namespace>      # Target namespace

πŸ”— Related Projects

  • 01-aks-tf - Infrastructure provisioning with Terraform
    • Deploys AKS cluster
    • Installs ArgoCD, Crossplane, Vault
    • Configures Azure infrastructure

πŸ“– Additional Resources

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes and test locally
  4. Submit a pull request

Note: This repository is designed to work with the infrastructure deployed by 01-aks-tf. Make sure the infrastructure is deployed first before using this GitOps repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published