1
0
Fork 0

fix(rules): ensure low CPU limits are non-0

This commit is contained in:
ssube 2019-06-17 06:55:46 -05:00
parent 13159057d5
commit 97d5c7aac6
2 changed files with 3 additions and 6 deletions

View File

@ -7,7 +7,6 @@ rules:
- playbook
select: '$'
check:
type: array
items:
@ -39,7 +38,6 @@ rules:
- role
select: '$'
check:
type: array
items:

View File

@ -48,8 +48,7 @@ rules:
- optional
select: '$.spec.template.spec.containers[*].resources'
# filter low-cpu resource limits
# filter containers with cpu limits
filter:
type: object
properties:
@ -58,7 +57,7 @@ rules:
properties:
cpu:
type: string
pattern: "[0-9]{1,3}m"
pattern: "[0-9]+m"
# ensure the limits aren't *too* low
check:
@ -69,7 +68,7 @@ rules:
properties:
cpu:
type: string
pattern: "[0-9]{3}m"
pattern: "[1-9][0-9]{2,}m"
- name: kubernetes-deployment-replicas
desc: deployments must specify a positive replica count