2019-10-10 10:46:11 -07:00
|
|
|
apiVersion: kyverno.io/v1alpha1
|
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
2019-10-24 18:48:48 -05:00
|
|
|
name: generate-namespace-quota
|
2019-10-11 18:57:16 -07:00
|
|
|
annotations:
|
|
|
|
policies.kyverno.io/category: Resource Quota
|
2019-10-14 16:33:19 -07:00
|
|
|
policies.kyverno.io/description: To limit the number of objects, as well as the
|
|
|
|
total amount of compute that may be consumed by an application, it is important
|
|
|
|
to create resource limits and quotas for each namespace.
|
2019-10-10 10:46:11 -07:00
|
|
|
spec:
|
|
|
|
rules:
|
2019-10-24 18:48:48 -05:00
|
|
|
- name: generate-namespace-quota
|
2019-10-10 10:46:11 -07:00
|
|
|
match:
|
|
|
|
resources:
|
|
|
|
kinds:
|
|
|
|
- Namespace
|
|
|
|
generate:
|
|
|
|
kind: ResourceQuota
|
|
|
|
name: "defaultresourcequota"
|
2019-10-24 12:37:52 -05:00
|
|
|
data:
|
|
|
|
spec:
|
|
|
|
hard:
|
2019-10-31 13:29:16 -07:00
|
|
|
requests.cpu: 4
|
|
|
|
requests.memory: 16Gi
|
|
|
|
limits.cpu: 4
|
|
|
|
limits.memory: 16Gi
|