A well-structured Kubernetes project repo usually looks like this:
k8s-project/
βββ README.md
βββ docs/
βββ manifests/
β βββ namespaces/
β βββ deployments/
β βββ services/
β βββ ingresses/
β βββ configmaps/
β βββ secrets/
β βββ storage/
β βββ crds/
βββ overlays/
β βββ dev/
β βββ test/
β βββ prod/
βββ charts/
βββ scripts/
βββ ci-cd/
βββ templates/
Now let's break down every folder, its purpose, what goes inside, and why it exists.
π 1. README.md
Your project documentation.
- Overview of the application
- How to deploy
- Pre-requisites (kubectl, kustomize, helm, cluster roles)
- CI/CD instructions
π 2. docs/ β Architecture Documentation
Used for:
- Architecture diagrams
- Flowcharts
- Troubleshooting guides
- Onboarding docs
Example:
docs/
βββ architecture.png
βββ sequence-flows.md
βββ troubleshooting.md
π¦ 3. manifests/ β Core Kubernetes YAML Files
This is your main folder containing all the raw Kubernetes manifests.
Typical structure:
manifests/
βββ namespaces/
β βββ dev-namespace.yaml
β βββ prod-namespace.yaml
βββ deployments/
β βββ app-deployment.yaml
β βββ worker-deployment.yaml
βββ services/
β βββ app-service.yaml
β βββ internal-service.yaml
βββ ingresses/
β βββ app-ingress.yaml
βββ configmaps/
β βββ app-configmap.yaml
βββ secrets/
β βββ db-secret.yaml
βββ storage/
β βββ pv.yaml
β βββ pvc.yaml
βββ crds/
βββ custom-metrics.yaml
Why this folder exists?
To organise all "base" Kubernetes resources cleanly so you donβt mix environments.
π§© 4. overlays/ β Environment-Specific Patches (Kustomize)
This folder is used if you use Kustomize for environment-specific overrides.
overlays/
βββ dev/
β βββ kustomization.yaml
β βββ patch-replicas.yaml
βββ test/
β βββ kustomization.yaml
β βββ patch-image-tag.yaml
βββ prod/
βββ kustomization.yaml
βββ patch-resources.yaml
Purpose:
- Change CPU/memory only in prod
- Use
latesttag in dev - Increase replicas per environment
- Change configmaps per environment
β΅ 5. charts/ β Helm Chart Folder
If the project is using Helm, you place custom charts here.
charts/
βββ myapp/
βββ templates/
βββ values.yaml
βββ values-prod.yaml
βββ Chart.yaml
Use-cases:
- Template large apps
- Parameterize configurations
- Reuse configs across multiple apps
π§ 6. scripts/ β Helper Scripts
Contains Bash/Python scripts for:
- Deployment automation
- kubectl wrappers
- Cleanup scripts
- Log collectors
Example:
scripts/
βββ deploy.sh
βββ validate-yamls.sh
βββ cleanup.sh
π€ 7. ci-cd/ β Pipeline Definitions
Stores pipeline configuration for:
- GitHub Actions
- GitLab CI/CD
- Azure DevOps
- Jenkins
- ArgoCD / FluxCD manifests
Example:
ci-cd/
βββ github-actions.yaml
βββ gitlab-ci.yaml
βββ argo-app.yaml
Purpose:
Automate deployments, validations, and image pushes.
π§± 8. templates/ β YAML Snippets / Boilerplate
Reusable YAML parts, such as:
- Pod templates
- Labels/annotations
- Resource-block templates
- Common affinity rules
Example:
templates/
βββ pod-template.yaml
βββ sidecar-template.yaml
βββ affinity.yaml
π Example Real-World Workflow
A developer wants to deploy a new version to dev:
- Updates image version in
overlays/dev/kustomization.yaml - Runs
kubectl apply -k overlays/dev
- Kustomize merges:
Base manifests (in
manifests/) + Dev patches (inoverlays/dev/) - Resources get deployed to the cluster.
For Helm:
helm upgrade --install myapp charts/myapp -f charts/myapp/values-dev.yaml
π― Summary Table
| Folder | Purpose |
|---|---|
manifests/ |
Base Kubernetes YAMLs |
overlays/ |
Environment overrides using Kustomize |
charts/ |
Helm charts |
scripts/ |
Deployment helper scripts |
ci-cd/ |
Automation & pipelines |
templates/ |
Reusable YAML snippets |
docs/ |
Documentation & diagrams |
Top comments (0)