This document provides guidance for AI agents working with this Kubernetes platform repository. It outlines repository structure, conventions, common tasks, and important considerations.
This repository contains Helm charts implementing a “Platform in a Box” - a GitOps-driven Kubernetes platform foundation using Argo CD’s App-of-Apps pattern. The platform includes:
k8s/
├── argocd-bootstrap-apps/ # Bootstrap Application manifests for each cluster
│ ├── dev-01.yaml
│ ├── ops-01.yaml
│ ├── prod-01.yaml
│ └── stag-01.yaml
├── charts/ # Helm charts for platform components
│ ├── app-of-apps/ # Root orchestrator chart
│ ├── cert-manager/
│ ├── envoy-gateway/
│ ├── external-dns/
│ ├── kyverno/
│ ├── logging/ # Elastic Stack (ECK operator)
│ ├── monitoring/ # Prometheus/Thanos
│ ├── nginx-ingress-controller/
│ ├── redis/
│ ├── sealed-secrets/
│ └── jaeger/
├── docs/ # Detailed architecture and operational guides
│ ├── getting-started.md
│ ├── observability.md
│ ├── traffic-management.md
│ ├── compliance.md
│ ├── argocd-best-practices.md
│ ├── elastic-best-practices.md
│ ├── troubleshooting.md
│ ├── faq.md
│ └── alert-catalog.md
├── scripts/ # CI/CD and utility scripts
│ ├── scan.sh # Chart scanning (lint, trivy, checkov)
│ ├── scan-config.yaml # Scan configuration
│ ├── junit.tpl # JUnit template for test results
│ └── what-runs-where.sh
└── README.md # Main documentation
NEVER modify production values directly. Follow the promotion flow:
dev branch → dev-01 cluster (fast iteration)staging branch → stag-01 cluster (soak testing)stable tag → prod-01 and ops-01 clusters (immutable production)Key Rules:
stable tag (immutable)values.<env>.yaml (e.g., values.prod-01.yaml)dev branch and promote through the pipelinestable, fix, retag, then forward-merge to staging and devEach chart has environment-specific values files:
values.yaml - Base/default valuesvalues.dev-01.yaml - Development overridesvalues.stag-01.yaml - Staging overridesvalues.ops-01.yaml - Operations cluster overridesvalues.prod-01.yaml - Production overridesWhen modifying values:
values.yaml minimal (common defaults only)Components are controlled via feature flags in app-of-apps/values.yaml:
sealedSecrets:
enable: false # Toggle component on/off
# ... other config
Important: When adding new components or modifying existing ones:
app-of-apps chart to include the new componentvalues.yamlREADME.mdArgo CD sync waves control deployment order. Lower numbers deploy first:
annotations:
argocd.argoproj.io/sync-wave: "-5" # Deploys early (negative = before 0)
argocd.argoproj.io/sync-wave: "5" # Deploys later
Dependencies:
-5 (foundational)-2 (needed by other components)-3 (needed for DNS automation)0 (default)5+ (deploy after platform)charts/new-component/
├── Chart.yaml
├── values.yaml
├── values.dev-01.yaml
├── values.ops-01.yaml
├── values.prod-01.yaml
├── values.stag-01.yaml
├── templates/
│ └── [templates]
└── README.md
app-of-apps chart:
charts/app-of-apps/values.yamlcharts/app-of-apps/templates/ (if needed)README.mdhelm template charts/new-component -f charts/new-component/values.dev-01.yaml
helm lint charts/new-component
scripts/scan.sh lint
# Template rendering
helm template charts/<component> -f charts/<component>/values.dev-01.yaml
# Linting
helm lint charts/<component>
# Full scan
scripts/scan.sh lint
scripts/scan.sh trivy
scripts/scan.sh checkov
values.dev-01.yamlvalues.prod-01.yaml (but promote through pipeline!)values.yaml (affects all environments)README.md if it existsREADME.mddocs/ folderREADME.md if high-level changesdocs/troubleshooting.md if common issues changedocs/faq.md if new questions arisedocs/getting-started.md if bootstrap flow changeskubeseal to seal before committing.destination.cluster and destination.namespace in Application specsKey dependencies to remember:
Before committing:
helm lint on modified chartshelm template to verify renderingscripts/scan.sh lint to check for double document separatorsscripts/scan.sh trivy to scan container imagesscripts/scan.sh checkov for security policy checksScan Configuration:
scripts/scan-config.yaml.trivyignore, .checkov.yaml in chart directory.globalcheckov.yaml (if exists)version in Chart.yaml when making template/value changesappVersion in Chart.yaml when upgrading component versionsstable tags (e.g., stable-v1.2.3)argocd-bootstrap-apps/*.yamlapp-of-apps chartcharts/app-of-apps/values.yamlcharts/*/templates/_helpers.tpl for common functions)include for reusable template snippetshelm template before committingscripts/scan.shscan-config.yaml for skip listskubeseal firsthelm lint and helm template before committingdocs/ folder for detailed guidesdocs/troubleshooting.md and docs/faq.mdREADME.md filesREADME.md Bootstrap Flow sectiondocs/argocd-best-practices.md, docs/elastic-best-practices.mdKey Commands:
# Template rendering
helm template charts/<component> -f charts/<component>/values.<env>.yaml
# Linting
helm lint charts/<component>
# Full scan
scripts/scan.sh lint
scripts/scan.sh trivy
scripts/scan.sh checkov
# Bootstrap (in ops cluster)
kubectl apply -f argocd-bootstrap-apps/ops-01.yaml
# Check Argo CD status
kubectl get applications -n argocd
argocd app list
Key Files:
README.md - Main documentation and inventorycharts/app-of-apps/values.yaml - Component enablementscripts/scan-config.yaml - Scan skip configurationdocs/getting-started.md - Step-by-step bootstrap guideKey Concepts: