No description
| apps/sample-app | ||
| argocd | ||
| secrets | ||
| local-hosts-example.txt | ||
| Makefile | ||
| QUICKSTART.md | ||
| README.md | ||
| test-local.sh | ||
| TESTING.md | ||
K8s Deployment Repository
Kubernetes manifests for deploying applications with Kustomize and ArgoCD GitOps.
Directory Structure
.
├── apps/ # Application deployments
│ └── sample-app/
│ ├── base/ # Base Kustomize configuration
│ └── overlays/ # Environment-specific overlays
│ ├── staging/
│ └── prod/
├── argocd/ # ArgoCD ApplicationSet for GitOps
├── configs/ # Shared configuration files
├── envs/ # Environment-specific values
├── secrets/ # Secret templates (not committed)
└── Makefile # Build and deployment commands
Environments
Staging
- URL: https://staging.local.bunk3r.dev
- Namespace:
staging-sample-app - Branch:
staging - Auto-sync: ✅ Enabled
- Replicas: 2
- Resources: 256Mi memory, 200m CPU
Production
- URLs:
- Namespace:
prod-sample-app - Branch:
main - Auto-sync: ❌ Manual approval required
- Replicas: 3-10 (HPA enabled)
- Resources: 512Mi memory, 500m CPU
Quick Start
1. Validate Configuration
# No cluster required - just validates YAML
make test
2. Build Manifests
make build-staging
make build-prod
3. Deploy Manually
# Deploy to staging
kubectl apply -k apps/sample-app/overlays/staging
# Deploy to production (with confirmation)
kubectl apply -k apps/sample-app/overlays/prod
4. Or Use ArgoCD (GitOps)
# Apply ApplicationSet - ArgoCD will handle deployments
make argocd-apply
ArgoCD GitOps
The argocd/applications.yaml configures automatic deployments:
- Watches
stagingbranch → deploys to staging environment - Watches
mainbranch → deploys to production environment (manual sync) - Auto-creates namespaces
- Monitors all apps in
apps/directory
Local DNS Setup
Add to /etc/hosts for local testing:
127.0.0.1 staging.local.bunk3r.dev
127.0.0.1 app.local.bunk3r.dev
127.0.0.1 prod.local.bunk3r.dev
Adding New Applications
- Create app structure:
mkdir -p apps/new-app/{base,overlays/{staging,prod}}
- Add base resources in
apps/new-app/base/ - Add environment overlays in
apps/new-app/overlays/ - ArgoCD will automatically discover and deploy
Commands
make help # Show all commands
make test # Validate manifests
make build-staging # Build staging YAML
make build-prod # Build production YAML
make status # Show deployment status
make clean # Clean generated files
Prerequisites
- kubectl (1.24+)
- kustomize (or kubectl 1.14+ with built-in kustomize)
- ArgoCD (optional, for GitOps)