This repository contains Kubernetes infrastructure configurations managed by ArgoCD.
k8s-infra/
├── operators/ # Infrastructure operators organized by environment
│ ├── argocd/ # ArgoCD configuration (values, ingress)
│ ├── cert-manager/ # cert-manager cluster issuers
│ ├── dev/ # Dev environment operators
│ │ ├── argocd-ingress-app-dev.yml
│ │ ├── cert-manager-app.yml
│ │ ├── ingress-nginx-app-dev.yml
│ │ ├── loki-app.yml
│ │ ├── prometheus-operator-app.yml
│ │ └── promtail-app.yml
│ ├── staging/ # Staging environment operators
│ │ └── ...
│ └── prod/ # Production environment operators
│ └── ...
├── apps/ # Application deployments organized by environment
│ ├── dev/ # Dev environment applications
│ │ ├── morichal-ai-frontend-app.yml
│ │ └── morichal-ai-backend-app.yml
│ ├── staging/ # Staging environment applications
│ │ └── ...
│ └── prod/ # Production environment applications
│ └── ...
├── argocd/ # ArgoCD bootstrap configuration
│ ├── appproject.yml # Shared AppProject definition
│ └── environments/
│ ├── dev/
│ │ ├── morichal-ai-dev-appproject.yml
│ │ ├── operators-app-of-apps.yml
│ │ └── apps-app-of-apps.yml
│ ├── staging/
│ │ ├── morichal-ai-staging-appproject.yml
│ │ ├── operators-app-of-apps.yml
│ │ └── apps-app-of-apps.yml
│ └── prod/
│ ├── morichal-ai-prod-appproject.yml
│ ├── operators-app-of-apps.yml
│ └── apps-app-of-apps.yml
├── scripts/
│ ├── bootstrap-dev.sh
│ ├── bootstrap-staging.sh
│ └── bootstrap-prod.sh
└── docs/
└── MULTI_CLUSTER_SETUP.md
Quick Start: Use the bootstrap scripts for your environment:
# Dev
./scripts/bootstrap-dev.sh
# Staging
./scripts/bootstrap-staging.sh
# Production
./scripts/bootstrap-prod.sh-
Install ArgoCD (handled by bootstrap scripts):
kubectl create namespace argocd helm repo add argo https://argoproj.github.io/argo-helm helm repo update helm upgrade --install argocd argo/argo-cd \ --namespace argocd \ --values operators/argocd/values-<env>.yaml \ --wait
-
Apply AppProjects:
# Shared AppProject kubectl apply -f argocd/appproject.yml # Environment-specific AppProject # Dev kubectl apply -f argocd/environments/dev/morichal-ai-dev-appproject.yml # Staging kubectl apply -f argocd/environments/staging/morichal-ai-staging-appproject.yml # Prod kubectl apply -f argocd/environments/prod/morichal-ai-prod-appproject.yml
-
Apply App-of-Apps (choose environment):
# Dev kubectl apply -f argocd/environments/dev/operators-app-of-apps.yml kubectl apply -f argocd/environments/dev/apps-app-of-apps.yml # Staging kubectl apply -f argocd/environments/staging/operators-app-of-apps.yml kubectl apply -f argocd/environments/staging/apps-app-of-apps.yml # Prod kubectl apply -f argocd/environments/prod/operators-app-of-apps.yml kubectl apply -f argocd/environments/prod/apps-app-of-apps.yml
This repository uses the App of Apps pattern with environment-specific entry points:
operators-app-of-apps.yml- Manages infrastructure operators for each environmentapps-app-of-apps.yml- Manages application deployments for each environment
ArgoCD will automatically discover and sync all Application manifests in the respective directories:
- Operators:
operators/<env>/ - Applications:
apps/<env>/
Infrastructure operators that provide cluster-wide capabilities.
- Application:
operators/ingress-nginx-app.yml - Source: Helm chart from
https://kubernetes.github.io/ingress-nginx - Namespace:
ingress-nginx - Project:
k8s-infra - Manages the NGINX Ingress Controller for the cluster
- Application:
operators/cert-manager-app.yml - Source: Helm chart from
https://charts.jetstack.io - Namespace:
cert-manager - Project:
k8s-infra - Manages TLS certificates using Let's Encrypt
- Ingress Application:
operators/argocd-ingress-app.yml - Manages the ArgoCD server ingress for external access
- Application:
operators/prometheus-operator-app.yml - Source: Helm chart from
https://prometheus-community.github.io/helm-charts - Namespace:
monitoring - Project:
k8s-infra - Includes Prometheus, Grafana, and Alertmanager
- Provides cluster-wide metrics collection and monitoring
- Application:
operators/loki-app.yml - Source: Helm chart from
https://grafana.github.io/helm-charts - Namespace:
monitoring - Project:
k8s-infra - Provides log aggregation and storage
- Includes Promtail for log collection
Application deployments managed by ArgoCD.
- Application:
apps/morichal-ai-frontend-app.yml - Namespace:
morichal-ai-frontend - Project:
morichal-ai-dev
- Application:
apps/morichal-ai-backend-app.yml - Namespace:
morichal-ai-backend - Project:
morichal-ai-dev
This repository supports deploying the same infrastructure stack across multiple Kubernetes clusters using branch-based GitOps:
devbranch → Dev clusterstagingbranch → Staging cluster (DigitalOcean)mainbranch → Production cluster
Key Benefits:
- ✅ Same resource files across all environments (no duplication)
- ✅ No environment-specific naming in resources
- ✅ Natural promotion path: dev → staging → prod
- ✅ Complete isolation between environments
See docs/MULTI_CLUSTER_SETUP.md for detailed setup instructions.
- Repository:
git@github.com:Deploy-Staff/morichal-k8s-infra.git - Branches:
main- Production environmentstaging- Staging environmentdev- Development environment
- Create a directory in
operators/your-operator/ - Create the Application manifest:
operators/your-operator/your-operator-app.yml - Add operator manifests to the directory
- Commit and push to the repository
- ArgoCD will automatically discover and sync it
- Create the Application manifest in
apps/<env>/your-app-app.yml(where<env>isdev,staging, orprod) - Commit and push to the repository
- ArgoCD will automatically discover and sync it
- Modify the Application manifest or the resource manifests
- Commit and push to the repository
- ArgoCD will automatically sync the changes