Skip to main content

Reference

Important Files

FilePurpose
build/scripts/bootstrap.shBootstrap cluster with ArgoCD and system apps
build/scripts/deploy.shDeploy apps using Git tags
build/scripts/prepare-release.shCreate release with Git tag
charts/system-apps/templates/*.yamlSystem app ArgoCD templates
cluster/*/config.yamlEnvironment-specific settings
cluster/*/argocd-values.yamlArgoCD Helm values
config/*/applications/*-values.yamlApp-specific values
charts/argocd-project/values.yamlArgoCD AppProject definitions

Make Targets

# Bootstrap cluster
make bootstrap

# List environments
make list-envs

# List apps
make list-apps

# Render values (dry run)
make render-values ENV=dev

# Deploy specific app (local, bypass ArgoCD)
make deploy-app ENV=dev APP=namespace-manager

# Deploy all apps to environment (local)
make deploy-env ENV=dev

# Create release
make prepare-release REPO_ARGS="--repo owner/repo --message 'Release v1.0.0'"

# Deploy latest to environment
make deploy ENV=dev

# Dry run
make deploy-dry-run ENV=dev

Deploy Script Options

# Deploy latest tag
./build/scripts/deploy.sh -e dev

# Deploy specific version
./build/scripts/deploy.sh -e dev -v v1.0.0

# Dry run
./build/scripts/deploy.sh -e dev -d

# Force deploy
./build/scripts/deploy.sh -e dev -f

Environment Variables

VariableRequiredDescription
GITHUB_TOKENYesGitHub personal access token for ArgoCD repo access
CLOUDFLARE_TOKENYesCloudflare API token for DNS-01 challenges

Helm Template Conventions

  • Use clusterEnv variable to reference correct values file
  • Wrap wildcards (*) in quotes: namespace: '*'
  • Templates must check apps.<appName>.enabled before rendering
  • Always quote namespace/server values with | quote
  • Use nindent for proper indentation in included templates

Adding a New Environment

Create cluster/<env>/config.yaml:

clusterEnv: <env>
clusterPath: cluster/<env>

repoURL: https://github.com/<org>/k8s-playground-cluster
targetRevision: main

argocd:
version: "9.4.10"

apps:
namespace-manager:
enabled: true
destinationNamespace: default
cert-manager:
enabled: true
version: "1.17.2"
# ... other apps

Create cluster/<env>/argocd-values.yaml for ArgoCD configuration.

Adding AppProject

Edit charts/argocd-project/values.yaml:

projects:
- name: new-project
enabled: true
description: New project
sourceRepos:
- https://github.com/<org>/k8s-playground-cluster.git
destinations:
- namespace: '*'
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: '*'
kind: '*'

Version Matrix

ComponentVersionNamespaceSync Wave
ArgoCD9.4.10argocd-1
AppProjectN/Aargocd-1
cert-manager1.17.2cert-manager1
MetalLB0.14.8metallb-system1
NGINX Ingress4.11.3ingress-nginx1
External-DNS1.15.0external-dns1
local-path-provisionerv0.0.34local-path-storage0
kube-prometheus-stack68.0.0monitoring3
Loki6.55.0monitoring3
Grafana Alloy0.10.0monitoring4
Istio1.24.0istio-system2-3
OPA Gatekeeper3.22.0gatekeeper-system5
Gatekeeper PoliciesN/Agatekeeper-system6
Sealed Secrets2.18.4kube-system7
cluster-configsN/Avarious3
Pi-holeLatestpihole8

URLs

ServiceURL
ArgoCDhttps://argo.ssdk8s.xyz
Prometheushttps://prometheus.ssdk8s.xyz
Grafanahttps://grafana.ssdk8s.xyz
Alertmanagerhttps://alertmanager.ssdk8s.xyz

Default Credentials

ServiceUsernamePassword Command
ArgoCDadminkubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
Grafanaadminkubectl get secret kube-prometheus-stack-grafana -n monitoring -o jsonpath='{.data.admin-password}' | base64 -d

Sync Wave Reference

Applications are deployed in order based on sync wave annotations:

WaveComponentsPurpose
-1ArgoCD, AppProjectGitOps controller must exist first
0local-path-provisioner, namespace-managerStorage and namespace foundation
1cert-manager, MetalLB, NGINX Ingress, External-DNSCore infrastructure and networking
2istio-baseIstio CRDs (prerequisite for istiod)
3istiod, loki, kube-prometheus-stack, cluster-configsService mesh, monitoring, configs
4grafana-alloy, promtailLog collection agents
5gatekeeperOPA Gatekeeper admission controller
6gatekeeper-policiesOPA policies (ConstraintTemplates, Constraints)
7sealed-secretsSecret encryption for GitOps
8User applications (Pi-hole, etc.)Application workloads