Working with Autopilot Rules for OpenShift with FlashArray
Summary and Key concepts
Summary:
This article explains how to create, update, monitor, and delete AutopilotRule
objects, which are used to define automation rules for Portworx's Autopilot feature in Kubernetes and OpenShift. The AutopilotRule
CRD allows users to specify objects to monitor, conditions to track, and actions to execute when conditions are met (e.g., resizing PVCs). The article provides step-by-step instructions on creating AutopilotRule
specs, applying them in the cluster, and viewing the associated events to monitor their status. It also covers how to modify or delete existing rules.
Kubernetes Concepts:
- Custom Resource Definition (CRD): Allows users to create custom resources, such as
AutopilotRule
, to extend Kubernetes functionality. - Labels and Selectors: Labels are key-value pairs attached to objects, and selectors are used to match labels in the
AutopilotRule
to choose which objects to monitor.
Portworx Concepts:
- Autopilot: A feature in Portworx that automates storage management tasks based on defined rules.
Understanding an AutopilotRule
Users use an AutopilotRule CRD to tell Autopilot which objects to monitor, the conditions to monitor, and the corresponding actions to perform when conditions occur.
An AutopilotRule has 4 main parts:
- Selector Matches labels on the objects that the rule should monitor.
- Namespace Selector Matches labels on the Kubernetes namespaces the rule should monitor. This is optional, and the default is all namespaces.
- Conditions The metrics for the objects to monitor.
- Actions to perform once the metric conditions are met.
The subsequent sections describe common operations for managing these rules.
Creating an AutopilotRule
-
Create an
AutopilotRule
spec file.- The Use cases page provides end-to-end examples on specific Autopilot use cases. Refer to these to help you create your spec.
- The AutopilotRule Reference page page defines the specification of the rule spec.
-
Apply the spec in your cluster.
oc apply -f volume-resize-autopilotrule.yaml
autopilotrule.autopilot.libopenstorage.org/volume-resize created