-
-
Save developer-guy/85d173dbf590b44cc7deb05c1674f559 to your computer and use it in GitHub Desktop.
Kyverno Check Pod Resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "?*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Helpful links down below: