Installing Autopilot for Portworx

Autopilot lets you define monitoring conditions in your cluster and automatically apply changes when those conditions occur. For more information about Autopilot, see the Portworx documentation.

Prerequisites

  1. Install Portworx.

  2. Access your Red Hat OpenShift cluster.

  3. Autopilot requires a running Prometheus instance in your cluster. To set up Prometheus, see Monitor your Portworx cluster.

  4. Make sure that Prometheus is enabled. If it is not enabled, edit your storageCluster resource and set enabled: true in the Prometheus configuration.

    Verify that the Prometheus service exists:

    oc get service -n kube-system prometheus
    

    Example Prometheus configuration:

    monitoring:
      prometheus:
        alertManager:
          enabled: true
        enabled: true
        exportMetrics: true
        resources: {}
      telemetry: {}
    
  5. Verify that the Prometheus instance has been created.

    oc get service -n kube-system prometheus
    
    NAME            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
    px-prometheus   ClusterIP   172.21.157.200   <none>        9090/TCP   19h
    

    Note that http://prometheus:9090 is the default Prometheus endpoint when Autopilot is enabled.

Installing Autopilot

  1. Download and save the Autopilot resources to a file called autopilot.yaml.

  2. Optional: If you are installing Autopilot with PX-Security, you must modify the storageCluster to add the PX_SHARED_SECRET environment variable to the autopilot section.

    env:
    - name: PX_SHARED_SECRET
    valueFrom:
    secretKeyRef:
    key: apps-secret
    name: px-system-secrets
    
  3. Deploy Autopilot to your cluster.

    oc apply -f autopilot.yaml
    

Creating Rules

Now that you have installed Autopilot in your cluster, see the Portworx documentation to create custom rules and actions for your Autopilot configuration.