Pods which have memory limits equal to requests could be given a QoS class of Guaranteed if they also set CPU limits equal to requests. Guaranteed is the highest schedulable class. This policy checks that all containers in a given Pod have memory requests equal to limits.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: memory-requests-equal-limitsannotations:policies.kyverno.io/title: Memory Requests Equal Limitspolicies.kyverno.io/category: Samplepolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Podpolicies.kyverno.io/minversion: 1.6.0policies.kyverno.io/description: Pods which have memory limits equal to requests could be given a QoS class of Guaranteed if they also set CPU limits equal to requests. Guaranteed is the highest schedulable class. This policy checks that all containers in a given Pod have memory requests equal to limits.spec:validationFailureAction: Auditbackground: falserules:- name: memory-requests-equal-limitsmatch:any:- resources:kinds:- Podvalidate:message: resources.requests.memory must be equal to resources.limits.memorydeny:conditions:any:- key: "{{ request.object.spec.containers[?resources.requests.memory!=resources.limits.memory] | length(@) }}"operator: NotEqualsvalue: 0
This policy performs some best practices validation on Application fields. Path or chart must be specified but never both. And destination.name or destination.server must be specified but never both.
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.