Skip to content

Instantly share code, notes, and snippets.

@grdnrio
Created March 26, 2020 12:09
Show Gist options
  • Save grdnrio/d91d62485d7abcd8bbef716af627861c to your computer and use it in GitHub Desktop.
Save grdnrio/d91d62485d7abcd8bbef716af627861c to your computer and use it in GitHub Desktop.
Postgres Autopilot Rule
apiVersion: autopilot.libopenstorage.org/v1alpha1
kind: AutopilotRule
metadata:
name: postgres-resize
spec:
##### selector filters the objects affected by this rule given labels
selector:
matchLabels:
app: postgres
pollInterval: 3
##### conditions are the symptoms to evaluate. All conditions are AND'ed
conditions:
# volume usage should be less than 50%
expressions:
- key: "100 * (px_volume_usage_bytes / px_volume_capacity_bytes)"
operator: Gt
values:
- "30"
##### action to perform when condition is true
actions:
- name: openstorage.io.action.volume/resize
params:
# resize volume by scalepercentage of current size
scalepercentage: "100"
maxsize: "30Gi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment