1
0
Fork 0
salty-dog/rules/kubernetes.yml

65 lines
1.4 KiB
YAML

rules:
- name: kubernetes-resources
desc: containers must have complete resources specified
level: info
tags:
- cluster-health
- important
select: '$.spec.template.spec.containers[*]'
filter:
type: object
check:
type: object
additionalProperties: true
required: [resources]
properties:
resources:
type: object
required: [limits, requests]
properties:
limits:
type: object
required: [cpu, memory]
properties:
cpu:
type: string
memory:
type: string
requests:
type: object
required: [cpu, memory]
properties:
cpu:
type: string
memory:
type: string
- name: kubernetes-resources-minimum-cpu
desc: resource limits are too low
level: debug
tags:
- optional
select: '$.spec.template.spec.containers[*].resources'
filter:
type: object
properties:
limits:
type: object
properties:
cpu:
type: string
pattern: "[0-9]{1,3}m"
check:
type: object
properties:
limits:
type: object
properties:
cpu:
type: string
pattern: "[0-9]{3}m"