Skip to content

Commit cd75bf2

Browse files
authored
Merge pull request #557 from chenkaiyue/mem-percent-watermark
Mem usage/percent watermark
2 parents 8420917 + 042d169 commit cd75bf2

File tree

25 files changed

+457
-39
lines changed

25 files changed

+457
-39
lines changed

examples/ensurance/evict-on-cpu-usage-percent/elastic-pod-qos.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ metadata:
55
spec:
66
allowedActions:
77
- eviction
8-
resourceQOS:
9-
cpuQOS:
10-
cpuPriority: 7
118
labelSelector:
129
matchLabels:
1310
preemptible_job: "true"

examples/ensurance/evict-on-cpu-usage-percent/pod.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ metadata:
88
spec:
99
containers:
1010
- command:
11-
- stress-nga
11+
- stress-ng
1212
- -c
1313
- "2"
1414
- --cpu-method
1515
- cpuid
16-
image: ccr.ccs.tencentyun.com/tkeimages/stress-ng:v0.12.09.ln
16+
image: docker.io/gocrane/stress-ng:v0.12.09
1717
imagePullPolicy: IfNotPresent
1818
name: low
1919
resources:

examples/ensurance/evict-on-cpu-usage-total/be-rules.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ metadata:
55
spec:
66
allowedActions:
77
- eviction
8-
resourceQOS:
9-
cpuQOS:
10-
cpuPriority: 7
11-
htIsolation:
12-
enable: false
138
scopeSelector:
149
matchExpressions:
1510
- operator: In
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: ensurance.crane.io/v1alpha1
2+
kind: PodQOS
3+
metadata:
4+
name: all-elastic-pods
5+
spec:
6+
allowedActions:
7+
- eviction
8+
labelSelector:
9+
matchLabels:
10+
preemptible_job: "true"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: ensurance.crane.io/v1alpha1
2+
kind: AvoidanceAction
3+
metadata:
4+
name: eviction
5+
spec:
6+
coolDownSeconds: 300
7+
description: evict low priority pods
8+
eviction:
9+
terminationGracePeriodSeconds: 30
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: low-pi1
5+
labels:
6+
k8s-app: low
7+
preemptible_job: "true"
8+
spec:
9+
containers:
10+
- image: docker.io/gocrane/stress-ng:v0.12.09
11+
command:
12+
- stress-ng
13+
- --vm-hang
14+
- "3600"
15+
- --vm
16+
- "2"
17+
- --vm-bytes
18+
- "2G"
19+
name: stress
20+
---
21+
apiVersion: v1
22+
kind: Pod
23+
metadata:
24+
name: low-pi2
25+
labels:
26+
k8s-app: low
27+
preemptible_job: "true"
28+
spec:
29+
containers:
30+
- image: docker.io/gocrane/stress-ng:v0.12.09
31+
command:
32+
- stress-ng
33+
- --vm-hang
34+
- "3600"
35+
- --vm
36+
- "2"
37+
- --vm-bytes
38+
- "3.5G"
39+
name: stress
40+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: ensurance.crane.io/v1alpha1
2+
kind: NodeQOS
3+
metadata:
4+
name: eviction-on-high-mem-usage-percent
5+
spec:
6+
nodeQualityProbe:
7+
nodeLocalGet:
8+
localCacheTTLSeconds: 60
9+
timeoutSeconds: 10
10+
rules:
11+
- actionName: eviction
12+
avoidanceThreshold: 2
13+
metricRule:
14+
name: memory_total_utilization
15+
value: 50
16+
name: mem-usage-percent
17+
restoreThreshold: 2
18+
strategy: None
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: ensurance.crane.io/v1alpha1
2+
kind: PodQOS
3+
metadata:
4+
name: all-elastic-pods
5+
spec:
6+
allowedActions:
7+
- eviction
8+
labelSelector:
9+
matchLabels:
10+
preemptible_job: "true"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: ensurance.crane.io/v1alpha1
2+
kind: AvoidanceAction
3+
metadata:
4+
name: eviction
5+
spec:
6+
coolDownSeconds: 300
7+
description: evict low priority pods
8+
eviction:
9+
terminationGracePeriodSeconds: 30

0 commit comments

Comments
 (0)