Bash automation for managing the local GitOps development environment.
All operations are performed through the main gitops script:
./scripts/gitops <command> [subcommand]| Command | Description |
|---|---|
./scripts/gitops setup |
Complete setup of all clusters and stack (15-20 min) |
./scripts/gitops teardown |
Delete all clusters and resources |
| Command | Description |
|---|---|
./scripts/gitops cluster status |
Show status of all clusters |
./scripts/gitops context <cluster> |
Switch kubectl context (management, dev, prod) |
| Command | Description |
|---|---|
./scripts/gitops secrets backup |
Backup sealed secrets encryption key |
./scripts/gitops secrets restore |
Restore encryption key from .sealed-secrets-key.yaml |
./scripts/gitops secrets status |
Show sealed secrets controller status |
| Command | Description |
|---|---|
./scripts/gitops help |
Show usage information |
The setup command checks for these tools:
| Tool | Install Command |
|---|---|
| kind | brew install kind |
| kubectl | brew install kubectl |
| helm | brew install helm |
| yq | brew install yq |
- CPU: 6 cores recommended
- RAM: 24 GB recommended
- Disk: 40 GB free space
- Time: 15-20 minutes for full setup
The lib/ directory contains modular bash libraries sourced by the main script:
| Module | Description |
|---|---|
utils.sh |
Utility functions: header, info, warn, error, success, require_command |
network.sh |
Network and DNS configuration utilities |
cluster.sh |
Kind cluster creation, deletion, and status checking |
argocd.sh |
ArgoCD bootstrap on clusters |
kargo-shards.sh |
Kargo controller shard configuration for multi-cluster |
stack.sh |
Stack deployment (creates root ArgoCD Application) |
secrets.sh |
Sealed Secrets encryption key backup and restore |
Dev and prod clusters run Kargo as root (UID 0). This is required because Kargo needs write access to the /gitops hostPath volume for git commits during promotions, and macOS Docker bind mounts don't allow permission changes from inside containers.
The management cluster runs Kargo as non-root (UID 1001) since it only needs read access to the git repository.
# Complete setup from scratch
./scripts/gitops setup
# Check cluster health
./scripts/gitops cluster status
# Switch to dev cluster
./scripts/gitops context dev
# Backup sealed secrets before teardown
./scripts/gitops secrets backup
# Teardown everything
./scripts/gitops teardown
# Restore and setup again
./scripts/gitops secrets restore
./scripts/gitops setup- Root README - Repository overview
- apps/README.md - ArgoCD Application structure
- manifests/README.md - Component manifests