From 53018cfc01e5113b37fca4eae2035ecd29830c18 Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 15 Jun 2019 20:53:39 -0500 Subject: [PATCH] rules(kubernetes): ensure deployments have replica counts --- rules/kubernetes.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/rules/kubernetes.yml b/rules/kubernetes.yml index f7cd042..7068167 100644 --- a/rules/kubernetes.yml +++ b/rules/kubernetes.yml @@ -65,4 +65,28 @@ rules: properties: cpu: type: string - pattern: "[0-9]{3}m" \ No newline at end of file + pattern: "[0-9]{3}m" + + - name: kubernetes-deployment-replicas + desc: deployments must specify a replica count + level: info + tags: + - important + + select: '$' + filter: + type: object + properties: + kind: + type: string + const: Deployment + + check: + type: object + properties: + spec: + type: object + properties: + replica: + type: number + minimum: 1 \ No newline at end of file