plugins/enforce/skills/opa-resource-governance-templates/SKILL.md
OPA resource governance policies enforcing CPU/memory limits, ResourceQuota compliance, LimitRange validation, and storage constraints.
npx skillsauth add adaptive-enforcement-lab/claude-skills opa-resource-governance-templatesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
This skill has been flagged as suspicious. Review the scan results before using.
2 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Resource governance policies prevent overconsumption, enforce quotas, and validate LimitRange compliance across your cluster.
ResourceQuota vs LimitRange vs OPA
ResourceQuota caps total namespace consumption. LimitRange sets defaults and bounds for individual pods. OPA validates configuration before admission. Use all three for comprehensive governance.
Require resource limits on all containers:
# Enforced by: governance.yaml
# Result: All containers must define resources.limits.cpu and resources.limits.memory
# Impact: Prevents single pod from consuming entire node capacity
Block pods exceeding namespace LimitRange maximums:
# Enforced by: limitrange.yaml
# Result: Pods cannot request more CPU/memory than LimitRange allows
# Impact: Ensures fair resource distribution across namespace
Restrict PVC sizes based on environment:
# Enforced by: storage.yaml
# Result: PVCs in dev-* namespaces cannot exceed 50Gi
# Impact: Prevents accidental provisioning of expensive storage volumes
See the full implementation guide in the source documentation.
Implement overlapping controls for comprehensive governance:
Balance cost and reliability with appropriate resource values:
| Resource | Too Low | Too High | Sweet Spot | |----------|---------|----------|------------| | Requests | OOMKilled pods | Wasted capacity | Actual usage (P95) | | Limits | Throttling | Noisy neighbors | 2x requests | | Storage | Out of space | High costs | Actual data + 30% |
Use Vertical Pod Autoscaler (VPA) to identify optimal values.
Define quotas based on team size and workload type:
# Development namespace quota
apiVersion: v1
kind: ResourceQuota
metadata:
name: dev-quota
namespace: dev-team
spec:
hard:
requests.cpu: "10"
requests.memory: "20Gi"
limits.cpu: "20"
limits.memory: "40Gi"
persistentvolumeclaims: "10"
requests.storage: "100Gi"
OPA policies validate workloads against these quotas before admission.
See reference.md for additional techniques and detailed examples.
See examples.md for code examples.
See reference.md for complete documentation.
documentation
Workload Identity Federation implementation guide. GKE setup, IAM bindings, ServiceAccount configuration, migration from service account keys, and troubleshooting patterns.
development
Secure GitHub Actions trigger patterns for pull requests, forks, and reusable workflows. Preventing privilege escalation and code injection through trigger misconfiguration.
development
Structured framework for evaluating GitHub Actions security before adoption. Trust tiers, risk assessment checklist, and decision tree for action evaluation.
testing
Securely store GitHub App credentials across different environments. GitHub Actions secrets, external CI, Kubernetes, and automated rotation patterns.