Infrastructure Patterns
When to Use What
| Tool |
Use For |
| Raw K8s YAML |
Simple deployments, one-off resources |
| Kustomize |
Environment variations, overlays without templating |
| Helm |
Complex apps, third-party charts, heavy templating |
| Terraform |
Cloud resources, infrastructure lifecycle |
| GitHub Actions |
CI/CD, automated testing, releases |
| Makefile |
Build automation, self-documenting targets |
| Dockerfile |
Container builds, multi-stage, multi-arch |
Quick Decisions
Kustomize when: Simple env differences, readable manifests, patching YAML
Helm when: Complex templating, third-party charts, release management
K8s Security Defaults
Every workload: non-root user, read-only filesystem, no privilege escalation, dropped capabilities, network policies.
GitHub Actions Patterns
- CI workflow: Lint, test, compile on PRs (run on both x86 + ARM)
- Release workflow: Multi-arch Docker build on tags (native ARM runners)
- Pin actions by SHA, least-privilege permissions
References
- KUBERNETES.md - K8s resource patterns
- TERRAFORM.md - Terraform module patterns
- GITHUB-ACTIONS.md - CI/CD workflow patterns
- MAKEFILE.md - Build automation patterns
- DOCKERFILE.md - Container build patterns
- templates/ - Ready-to-use templates
Commands
kubectl apply -k ./ # Apply kustomize
helm upgrade --install NAME . # Install/upgrade chart
terraform plan && terraform apply
1---2name: managing-infra3description: Infrastructure patterns for Kubernetes, Terraform, Helm, Kustomize, and GitHub Actions. Use when making K8s architectural decisions, choosing between Helm vs Kustomize, structuring Terraform modules, writing CI/CD workflows, or applying security best practices.4allowed-tools: Read, Bash, Grep, Glob5metadata:6 source: https://skillmd.com/skills/levalencia/managing-infra7---89# Infrastructure Patterns1011## When to Use What1213| Tool | Use For |14| ------------------ | --------------------------------------------------- |15| **Raw K8s YAML** | Simple deployments, one-off resources |16| **Kustomize** | Environment variations, overlays without templating |17| **Helm** | Complex apps, third-party charts, heavy templating |18| **Terraform** | Cloud resources, infrastructure lifecycle |19| **GitHub Actions** | CI/CD, automated testing, releases |20| **Makefile** | Build automation, self-documenting targets |21| **Dockerfile** | Container builds, multi-stage, multi-arch |2223## Quick Decisions2425**Kustomize** when: Simple env differences, readable manifests, patching YAML26**Helm** when: Complex templating, third-party charts, release management2728## K8s Security Defaults2930Every workload: non-root user, read-only filesystem, no privilege escalation, dropped capabilities, network policies.3132## GitHub Actions Patterns3334- **CI workflow**: Lint, test, compile on PRs (run on both x86 + ARM)35- **Release workflow**: Multi-arch Docker build on tags (native ARM runners)36- Pin actions by SHA, least-privilege permissions3738## References3940- [KUBERNETES.md](KUBERNETES.md) - K8s resource patterns41- [TERRAFORM.md](TERRAFORM.md) - Terraform module patterns42- [GITHUB-ACTIONS.md](GITHUB-ACTIONS.md) - CI/CD workflow patterns43- [MAKEFILE.md](MAKEFILE.md) - Build automation patterns44- [DOCKERFILE.md](DOCKERFILE.md) - Container build patterns45- [templates/](templates/) - Ready-to-use templates4647## Commands4849```bash50kubectl apply -k ./ # Apply kustomize51helm upgrade --install NAME . # Install/upgrade chart52terraform plan && terraform apply53```