2019-10-10 10:46:11 -07:00
|
|
|
apiVersion: kyverno.io/v1alpha1
|
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
2019-11-10 20:58:57 -08:00
|
|
|
name: add-ns-quota
|
2019-10-11 18:57:16 -07:00
|
|
|
annotations:
|
2019-11-11 18:21:16 -08:00
|
|
|
policies.kyverno.io/category: Workload Isolation
|
2019-10-14 16:33:19 -07:00
|
|
|
policies.kyverno.io/description: To limit the number of objects, as well as the
|
2019-11-10 20:58:57 -08:00
|
|
|
total amount of compute that may be consumed by a single namespace, create
|
|
|
|
a default resource quota for each namespace.
|
2019-10-10 10:46:11 -07:00
|
|
|
spec:
|
|
|
|
rules:
|
2019-11-10 20:58:57 -08:00
|
|
|
- name: generate-resourcequota
|
2019-10-10 10:46:11 -07:00
|
|
|
match:
|
|
|
|
resources:
|
|
|
|
kinds:
|
|
|
|
- Namespace
|
|
|
|
generate:
|
|
|
|
kind: ResourceQuota
|
2019-11-10 20:58:57 -08:00
|
|
|
name: "default-resourcequota"
|
2019-10-24 12:37:52 -05:00
|
|
|
data:
|
|
|
|
spec:
|
|
|
|
hard:
|
2019-11-12 16:37:40 -08:00
|
|
|
requests.cpu: '4'
|
|
|
|
requests.memory: '16Gi'
|
|
|
|
limits.cpu: '4'
|
|
|
|
limits.memory: '16Gi'
|