fix(rules): ensure low CPU limits are non-0
This commit is contained in:
parent
13159057d5
commit
97d5c7aac6
|
@ -7,7 +7,6 @@ rules:
|
||||||
- playbook
|
- playbook
|
||||||
|
|
||||||
select: '$'
|
select: '$'
|
||||||
|
|
||||||
check:
|
check:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
@ -39,7 +38,6 @@ rules:
|
||||||
- role
|
- role
|
||||||
|
|
||||||
select: '$'
|
select: '$'
|
||||||
|
|
||||||
check:
|
check:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
|
|
@ -48,8 +48,7 @@ rules:
|
||||||
- optional
|
- optional
|
||||||
|
|
||||||
select: '$.spec.template.spec.containers[*].resources'
|
select: '$.spec.template.spec.containers[*].resources'
|
||||||
|
# filter containers with cpu limits
|
||||||
# filter low-cpu resource limits
|
|
||||||
filter:
|
filter:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -58,7 +57,7 @@ rules:
|
||||||
properties:
|
properties:
|
||||||
cpu:
|
cpu:
|
||||||
type: string
|
type: string
|
||||||
pattern: "[0-9]{1,3}m"
|
pattern: "[0-9]+m"
|
||||||
|
|
||||||
# ensure the limits aren't *too* low
|
# ensure the limits aren't *too* low
|
||||||
check:
|
check:
|
||||||
|
@ -69,7 +68,7 @@ rules:
|
||||||
properties:
|
properties:
|
||||||
cpu:
|
cpu:
|
||||||
type: string
|
type: string
|
||||||
pattern: "[0-9]{3}m"
|
pattern: "[1-9][0-9]{2,}m"
|
||||||
|
|
||||||
- name: kubernetes-deployment-replicas
|
- name: kubernetes-deployment-replicas
|
||||||
desc: deployments must specify a positive replica count
|
desc: deployments must specify a positive replica count
|
||||||
|
|
Loading…
Reference in New Issue