Skip to content

Commit

Permalink
updated require-pod-requests-limits.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Maheshwari nikhil.m2498@gmail.com
Signed-off-by: Nikhil Maheshwari <36232275+nikhilmaheshwari24@users.noreply.github.com>
  • Loading branch information
nikhilmaheshwari24 committed Aug 1, 2024
1 parent f152e2d commit cb060c6
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,34 @@ metadata:
This policy validates that all containers have something specified for memory and CPU
requests and memory limits.
spec:
validationFailureAction: audit
validationFailureAction: Audit
background: true
rules:
- name: validate-resources
- name: validate-container-resources
match:
any:
- resources:
kinds:
- Pod
validate:
message: "CPU and memory resource requests and limits are required."
message: "CPU and memory resource requests and memory limits are required for containers."
pattern:
spec:
containers:
- resources:
requests:
memory: "?*"
cpu: "?*"
limits:
memory: "?*"
=(initContainers):
- resources:
requests:
memory: "?*"
cpu: "?*"
limits:
memory: "?*"
=(ephemeralContainers):
- resources:
requests:
memory: "?*"
Expand Down

0 comments on commit cb060c6

Please sign in to comment.