diff --git a/rules/kubernetes-fix.yml b/rules/kubernetes-fix.yml new file mode 100644 index 0000000..665f729 --- /dev/null +++ b/rules/kubernetes-fix.yml @@ -0,0 +1,23 @@ +name: kubernetes-fix +rules: + - name: kubernetes-container-pull-policy + desc: all containers should have a pull policy + level: info + tags: + - kubernetes + - image + - optional + + select: '$..containers.*' + check: + type: object + required: [image, imagePullPolicy] + properties: + imagePullPolicy: + type: string + default: IfNotPresent + enum: + - Always + - IfNotPresent + - Never + diff --git a/test/examples/kubernetes-resources-pull.yml b/test/examples/kubernetes-resources-pull.yml new file mode 100644 index 0000000..25914e5 --- /dev/null +++ b/test/examples/kubernetes-resources-pull.yml @@ -0,0 +1,20 @@ +# test rules kubernetes +# test tags kubernetes +# test exit-status 1 + +metadata: + name: example + labels: {} +spec: + template: + spec: + containers: + - name: test + image: foo + resources: + limits: + cpu: 4000m + memory: 5Gi + requests: + cpu: 4000m + memory: 5Gi