Skip to content

Commit b77bce9

Browse files
authored
Merge pull request #757 from PureStorage-OpenConnect/autopilot
rework autopilot and throttling
2 parents 96de2e6 + d29a38f commit b77bce9

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

assets/autopilot/disk-filler.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# pxctl volume update --max_bandwidth 10,10 <vol_id>
2+
# best to leverage the grafana dashboard to show IO Limits
3+
# https://docs.portworx.com/portworx-enterprise/operations/tune-performance/io-throttling
4+
apiVersion: apps/v1
5+
kind: StatefulSet
6+
metadata:
7+
name: diskfiller
8+
spec:
9+
serviceName: diskfiller
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
app: diskfiller
14+
template:
15+
metadata:
16+
labels:
17+
app: diskfiller
18+
spec:
19+
containers:
20+
- name: diskfiller
21+
image: alpine:3.23
22+
command:
23+
- sh
24+
- -c
25+
- "while :; do tr '\\0' 'X' < /dev/zero | dd of=/scratch/foo bs=8192; sleep 1; done"
26+
volumeMounts:
27+
- name: scratch
28+
mountPath: /scratch
29+
restartPolicy: Always
30+
volumeClaimTemplates:
31+
- metadata:
32+
name: scratch
33+
spec:
34+
storageClassName: px-csi-db
35+
accessModes:
36+
- ReadWriteOnce
37+
resources:
38+
requests:
39+
storage: 10G

assets/autopilot/expand-pvc.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#kubectl get events --field-selector involvedObject.kind=AutopilotRule,involvedObject.name=volume-resize --all-namespaces --sort-by .lastTimestamp
2+
apiVersion: autopilot.libopenstorage.org/v1alpha1
3+
kind: AutopilotRule
4+
metadata:
5+
name: volume-resize
6+
spec:
7+
##### selector filters the objects affected by this rule given labels
8+
selector:
9+
matchLabels:
10+
app: diskfiller
11+
##### conditions are the symptoms to evaluate. All conditions are AND'ed
12+
conditions:
13+
for: 5
14+
# volume usage should be less than 50%
15+
expressions:
16+
- key: "100 * (px_volume_usage_bytes / px_volume_capacity_bytes)"
17+
operator: Gt
18+
values:
19+
- "50"
20+
##### action to perform when condition is true
21+
actions:
22+
- name: openstorage.io.action.volume/resize
23+
params:
24+
# resize volume by scalepercentage of current size
25+
scalepercentage: "100"
26+
# volume capacity should not exceed 400GiB
27+
maxsize: "40Gi"
28+

0 commit comments

Comments
 (0)