This guide walks through bootstrapping a cluster from scratch.
Option A: Homebrew (recommended)
brew install user-cube/tap/cluster-bootstrap-cliOption B: Install globally with go install
# From GitHub
go install github.com/user-cube/cluster-bootstrap/cluster-bootstrap-cli@latest
# Verify installation
cluster-bootstrap-cli --helpOption C: Install from local source
# Clone the repository
git clone git@github.com:user-cube/cluster-bootstrap.git
cd cluster-bootstrap
# Install globally
go install ./cluster-bootstrap-cliOption D: Build locally
task build
# Binary will be at: cluster-bootstrap-cli/cluster-bootstrap-cli
./cluster-bootstrap-cli/cluster-bootstrap-cli --helpRun the interactive init command to configure encryption and create per-environment secrets files:
./cluster-bootstrap-cli/cluster-bootstrap-cli initThis will:
- Prompt you to choose an encryption provider (age, AWS KMS, GCP KMS, or git-crypt)
- For SOPS providers: collect the encryption key, generate
.sops.yaml, create encryptedsecrets.<env>.enc.yamlfiles - For git-crypt: verify
git-crypt inithas been run, update.gitattributes, create plaintextsecrets.<env>.yamlfiles
git-crypt init
./cluster-bootstrap-cli/cluster-bootstrap-cli init --provider git-cryptRun the bootstrap command with your target environment:
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap devThis performs the following steps:
- Loads secrets — decrypts via SOPS (default) or reads plaintext git-crypt files
- Creates the
argocdnamespace - Creates the
repo-ssh-keySecret with your Git SSH credentials - Installs ArgoCD via Helm (using
components/argocd/chart and values) - Deploys the App of Apps root Application
- Prints ArgoCD access instructions
# Use a specific secrets file
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --secrets-file ./my-secrets.enc.yaml
# Use a specific kubeconfig or context
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --kubeconfig ~/.kube/my-config --context my-cluster
# Specify age key location (SOPS)
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --age-key-file ./age-key.txt
# Use git-crypt encryption
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --encryption git-crypt
# git-crypt with key stored in cluster
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --encryption git-crypt --gitcrypt-key-file ./git-crypt-key
# Dry run — print manifests without applying
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --dry-run
# Dry run — write manifests to a file
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --dry-run --dry-run-output /tmp/bootstrap.json
# Skip ArgoCD Helm install (if already installed)
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --skip-argocd-install
# Repo content in a subdirectory with custom app path
# First, update apps/values.yaml to set repo.basePath: "k8s"
./cluster-bootstrap-cli/cluster-bootstrap-cli --base-dir ./k8s bootstrap dev --app-path k8s/apps
# Wait for components to be ready after bootstrap
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --wait-for-health
# Wait for health with longer timeout (5 minutes)
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --wait-for-health --health-timeout 300Note: when using --secrets-file or the auto-detected secrets path, the file must already exist.
Use --wait-for-health to verify that critical components (ArgoCD, Vault, External Secrets) are ready after bootstrap completes:
./cluster-bootstrap-cli/cluster-bootstrap-cli bootstrap dev --wait-for-healthThis will poll the cluster every 2 seconds for up to 180 seconds (3 minutes) and display a health status report showing which components are ready.
After bootstrap completes, access the ArgoCD UI:
kubectl port-forward svc/argocd-server -n argocd 8080:443Get the initial admin password:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -dOpen https://localhost:8080 and log in with admin and the password above.
For staging and production, after Vault initializes you need to store the root token:
./cluster-bootstrap-cli/cluster-bootstrap-cli vault-token --token <vault-root-token>
echo "<vault-root-token>" | ./cluster-bootstrap-cli/cluster-bootstrap-cli vault-token
./cluster-bootstrap-cli/cluster-bootstrap-cli vault-tokenThis creates a vault-root-token Secret in the vault namespace, which the Vault configuration and seed jobs use.
Once ArgoCD is running with the App of Apps deployed, it will automatically sync all enabled components in sync wave order:
- Wave 0: ArgoCD (self-manages)
- Wave 1: Vault, External Secrets
- Wave 2: Prometheus Operator CRDs, ArgoCD Repo Secret, Reloader
- Wave 3: Kube Prometheus Stack, Trivy Operator
All components use automated sync with pruning and self-healing enabled.