Why are ResourceQuotas and LimitRanges a security control, not just a cost control?
BeginnerProductionKubernetes Security Posture
Answer
A compromised or buggy workload without limits can starve the node (denial of service for neighbours) or scale to mine crypto at our expense. Quotas cap how much a namespace can consume, and LimitRanges give every container default requests and limits.
apiVersion: v1
kind: ResourceQuota
metadata: {name: team-quota, namespace: payments}
spec:
hard:
requests.cpu: "40"
limits.memory: 160Gi
pods: "200"
services.loadbalancers: "2"
Capping services.loadbalancers and services.nodeports also stops teams from accidentally exposing services publicly.
More on Kubernetes Security Posture
What is your security baseline for a new production EKS cluster?IntermediateDraw the layered security controls for workloads on Kubernetes.BeginnerHow do you assign Pod Security Admission levels across namespaces in production?BeginnerKyverno, OPA Gatekeeper or ValidatingAdmissionPolicy: how do you choose?IntermediateShow a ValidatingAdmissionPolicy that blocks containers without resource limits.AdvancedHow do you roll out default-deny NetworkPolicies in a running production cluster?Intermediate