Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save developer-guy/85d173dbf590b44cc7deb05c1674f559 to your computer and use it in GitHub Desktop.
Save developer-guy/85d173dbf590b44cc7deb05c1674f559 to your computer and use it in GitHub Desktop.
Kyverno Check Pod Resources
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: check-resources
spec:
validationFailureAction: enforce
rules:
- name: check-pod-resources
match:
resources:
kinds:
- Pod
validate:
message: "CPU and memory resource requests and limits are required"
pattern:
spec:
containers:
- name: "*"
resources:
limits:
memory: "?*"
cpu: "?*"
requests:
memory: "?*"
cpu: "?*"
@developer-guy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment