1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

NK-31: Updated documentation from master:

Merge branch 'master' into NK-31_Bugfix
This commit is contained in:
belyshevdenis 2019-03-21 15:14:16 +02:00
commit 18e8efbd37
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:
hard:
cpu: 100
memory: 200Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["high"]
kind: ResourceQuota
metadata:
name: pods-low
labels:
quota: "low"
spec:
hard:
cpu: 2
memory: 8Gi
pods: 4
limits.memory: 12Gi
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["low"]