1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

NK-14: Updated example for ResourceQuota

This commit is contained in:
Denis Belyshev 2019-03-20 16:23:20 +02:00
parent 1ee3987ee2
commit cb4d126216
2 changed files with 34 additions and 24 deletions

View file

@ -1,17 +1,28 @@
apiVersion : policy.nirmata.io/v1alpha1
kind : Policy
metadata :
name : policy-quota
name : policy-quota-low-test
spec :
failurePolicy: stopOnError
rules:
- resource:
kind : ResourceQuota
name: "pods-high"
selector:
matchLabels:
quota: low
patch:
- path: "/metadata/labels/isMutated"
op: add
value: "true"
- path : "/spec/hard/cpu"
- path : "/spec/scopeSelector/matchExpressions/1"
op : add
value :
operator : In
scopeName: PriorityClass
values: ["low-medium"]
- path : "/spec/hard"
op : replace
value : "7"
value: {
"cpu": "10",
"memory": "10Gi",
"pods": "10",
"limits.memory": "12Gi",
"requests.nvidia.com/gpu": "8"
}

View file

@ -1,18 +1,17 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-high
spec:
kind: ResourceQuota
metadata:
name: pods-low
labels:
quota: "low"
spec:
hard:
cpu: 100
memory: 200Gi
pods: "10"
cpu: 2
memory: 8Gi
pods: 4
limits.memory: 12Gi
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["high"]
values: ["low"]