k8s-guard
by shaul1991
README.md
# k8s-guard
**English** · [한국어](README.ko.md)
Zero-dependency **Kubernetes YAML, Dockerfile, and Terraform** safety checker, CLI, local stdio MCP server, and web checklist. Built to catch outage, security, and AWS cost traps before you deploy AI-generated infrastructure configs.
> **Do you actually need Kubernetes yet?** Read the [Objective Kubernetes Readiness Framework](docs/K8S_READINESS_FRAMEWORK.md) (6 measurable metrics & scoring matrix) before migrating.
## What It Catches
- **Kubernetes Reliability & High Availability**: Missing `resources.requests/limits` (OOM & broken HPA), missing `readinessProbe`/`livenessProbe`, single `replicas: 1`, `Recreate` strategy downtime, missing node spread (`topologySpreadConstraints`/`podAntiAffinity`), missing `PodDisruptionBudget`, missing Graceful Shutdown (`terminationGracePeriodSeconds`/`preStop`), unpinned `:latest` tags, `Service` selector vs `Deployment` label mismatch, and HPA `maxReplicas` DB connection pool warnings.
- **Security**: `privileged: true`, missing `runAsNonRoot: true`, missing `allowPrivilegeEscalation: false`, plaintext secrets in `ConfigMap` / container `env` / `Dockerfile` `ENV|ARG`, and `0.0.0.0/0` exposure on SSH/DB/Redis ports.
- **AWS Cost Traps (Terraform)**: `aws_eks_cluster` ($0.10/hr control plane, no free tier) and `aws_nat_gateway` (~$32–33/mo + data fees, no free tier) warnings.
## Quickstart (Zero Dependencies, Node.js 18+)
```sh
# Audit a file or directory
npx --yes --package=github:shaul1991/k8s-guard k8s-guard ./k8s/ --lang en
# JSON output for CI gates (exits 1 on FAIL)
npx --yes --package=github:shaul1991/k8s-guard k8s-guard ./deploy.yaml --json --lang en
# Start local stdio MCP server (Claude Desktop, Cursor, Codex)
npx --yes --package=github:shaul1991/k8s-guard k8s-guard mcp
```
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues