Reference for OpenShift with FlashArray
AutopilotRule CRD specification
| Field | Description | Optional? | Default |
|---|---|---|---|
| selector | Selects the objects affected by this rule using either matchLabels, matchExpressions, or both selectors. Syntax. | Yes | empty |
| namespaceSelector | Selects the namespaces affected by this rule using either matchLabels, matchExpressions, or both namespace selectors. Syntax. | Yes | all |
| conditions | Defines the metrics that need to be for the rule's actions to trigger. All conditions are AND'ed. Syntax. | No | |
| actions | Defines what action to take when the conditions are met. Syntax. See Supported Autopilot actions for all actions that you can specify here. | No | |
| pollInterval | Defines the interval in seconds at which the conditions for the rule are queried from the metrics provider. Note: You can reduce the poll interval to speed up Autopilot operations, but this will increase the load on Prometheus and lead to an increase in CPU consumption. | Yes |
|
| actionsCoolDownPeriod | Defines the duration in seconds for which autopilot will not re-trigger any actions once they have been executed. | Yes | 5 minutes |
selector
Selects the objects affected by this rule using either matchLabels, matchExpressions, or both selectors.
You can refer to Labels and Selectors for more information on how to use matchLabels and matchExpressions.
matchLabels
selector:
matchLabels:
<selector-key>: <selector-value>
matchExpressions
selector:
matchExpressions:
- key: <selector-key>
operator: <logical-operator>
values:
- <selector-value>
Example
Below is an example spec snippet for using matchLabels:
selector:
matchLabels:
app: postgres
Below is an example spec snippet for using matchExpressions:
selector:
matchExpressions:
- key: app
operator: In
values:
- data-writer
- writer
namespaceSelector
Selects the namespaces affected by this rule using a either matchLabels, matchExpressions, or both selectors.
You can refer to Labels and Selectors for more information on how to use matchLabels and matchExpressions.
matchLabels
namespaceSelector:
matchLabels:
<selector-key>: <selector-value>
matchExpressions
namespaceSelector:
matchExpressions:
- key: <selector-key>
operator: <logical-operator>
values:
- <selector-value>
Example
Below is an example spec snippet for using matchLabels:
namespaceSelector:
matchLabels:
app: postgres
Below is an example spec snippet for using matchExpressions:
namespaceSelector:
matchExpressions:
- key: app
operator: In
values:
- data-writer
- writer
conditions
Defines the metrics that need to be for the rule's actions to trigger.
Conditions compare the key field with the values field using the operator field. Condition keys can contain logic and use monitoring values.
conditions:
- key: "<condition-formula>"
operator: <logical-operator>
values:
- "<comparator>"
for: <5>
It follows the below schema.
| Field | Description | Optional? | Default |
|---|---|---|---|
| key | This is the metrics query that would be sent to the monitoring provider (e.g prometheus). | no | empty |
| operator | This is the logical operator to use to compare the results of the query in key above to the values. Supported operators are:
| no | empty |
| values | This is the value or list of values against which the key and operator are compared.
| no | empty |
| for | Specifies the duration (in seconds) for which the condition must be true before triggering the defined action. | yes | 30 |
Multiple conditions are combined using a logical AND.
actions
Defines what action to take when the conditions are met. See the Supported Actions section for the list of actions that you can specify.
action:
name: <operation>
params:
<operation-specific-paramater>: <value>
maxsize: "<value>Gi"
Supported Autopilot actions
openstorage.io.action.volume/resize
This action is to perform resize on Kubernetes PersistentVolumeClaims (PVCs).
Parameters
- scalepercentage: Specifies the percentage of current PVC size by which Autopilot should resize the PVC. If not specified, the default is 50%.
- maxsize: Specifies the maximum PVC size in bytes after which Autopilot should stop resizing the PVCs. Note that you can specify the unit of measurement as part of the value. For example, if you want to use GiB, you can specify the unit of measurement like this:
maxsize: "400Gi". If not specified, the default value is unlimited.
Examples
Resize the PVC by 100% of current size
actions:
- name: openstorage.io.action.volume/resize
params:
scalepercentage: "100"
maxsize: "12Gi"
openstorage.io.action.storagepool/expand
This action is to perform expansion on Portworx Storage Pools.
Parameters
You cannot use add-drive operation if you are using PX-StoreV2 as your backend for expanding your pools.
- scalepercentage: Specifies the percentage of current Pool size by which Autopilot should resize it. If not specified, the default is 50%.
- scaletype: Specifies the type of operation to be performed to expand the pool. Supported values are:
- auto: Portworx scales the pool automatically by either adding new disks or resizing the existing disks. Autopilot chooses the best method to expand the pool based on the current configuration and available resources.
- add-drive: Portworx adds new disks to the existing storage pool.
- resize-drive: Portworx resizes the existing disks in the storage pool.
- scalesize: Specifies the amount, in Gi or Ti, by which Autopilot should expand a storage pool.
You cannot combine the scalepercentage and scalesize parameters; use only one of them in an Autopilot rule.
Examples
Expand the pool by 50% of current size automatically
actions:
- name: openstorage.io.action.storagepool/expand
params:
scalepercentage: "50"
scaletype: "auto"
Expand the pool by 50% of current size by adding disks
actions:
- name: openstorage.io.action.storagepool/expand
params:
scalepercentage: "50"
scaletype: "add-drive"
Expand the pool by 100Gi by resizing disks
actions:
- name: openstorage.io.action.storagepool/expand
params:
scalesize: "100Gi"
scaletype: "resize-drive"
openstorage.io.action.storagepool/rebalance
This action performs a rebalance operation on Portworx Storage Pools.