Skip to main content
Version: 3.3

Autopilot Install and Setup

Summary and Key concepts

Summary This article outlines the steps for installing and configuring Portworx Autopilot, a rule-based engine for automated storage management. It details the prerequisites, such as a running Prometheus instance, and how to find the Prometheus service endpoint. The article provides instructions for configuring the Autopilot ConfigMap and explains how to enable Autopilot in the Portworx StorageCluster specification. Customization options for the installation, including setting up custom images and upgrading Autopilot either with or without a configmap, are also covered. The Operator method is recommended for Autopilot installation and upgrades.

Kubernetes Concepts

  • ConfigMap: Used to store non-confidential data in key-value pairs, such as configuration settings for Autopilot.
  • Service: A way to expose an application running on a set of Pods, in this case, Prometheus.

Portworx Concepts

  • Autopilot: Automates storage operations based on monitoring conditions, such as resizing volumes or expanding storage pools.
  • Prometheus Integration: Autopilot relies on Prometheus for monitoring metrics, and the Prometheus service endpoint must be configured for Autopilot to work.
  • PX-Security: Portworx's security framework that includes token-based authorization and encryption. Autopilot with PX-Security requires adding a shared secret to the StorageCluster.
  • StorageCluster: A custom Kubernetes resource used by Portworx to manage the storage cluster, which includes enabling and configuring Autopilot.

Follow the steps in the following sections to install and configure Autopilots.

Prerequisites

Autopilot requires a running OpenShift Prometheus instance in your cluster. If you don't have Prometheus configured in your cluster, refer to the Monitoring section to set it up.

Once you have enabled OpenShift Prometheus, fetch the Thanos host, which is part of the OpenShift monitoring stack.

oc get route thanos-querier -n openshift-monitoring -o json | jq -r '.spec.host'
thanos-querier-openshift-monitoring.tp-nextpx-iks-catalog-pl-80e1e1cd66534115bf44691bf8f01a6b-0000.us-south.containers.appdomain.cloud

Configure Autopilot using the above route host to enable its access to Prometheus's statistics.

Configuring the ConfigMap

Replace http://prometheus:9090 in the following ConfigMap with your Prometheus service endpoint, if it is different. Once replaced, apply this ConfigMap in your cluster:

apiVersion: v1
kind: ConfigMap
metadata:
name: autopilot-config
namespace: portworx
data:
config.yaml: |-
providers:
- name: default
type: prometheus
params: url=https://<THANOS-QUERIER-HOST>
min_poll_interval: 2

Install Autopilot

As Portworx transitions from the "old DaemonSet way" of installing Portworx and its components to using the Operator, Autopilot should now be installed via the StorageCluster. If you still need to install Autopilot, ensure that it is enabled in the StorageCluster specification:

kind: StorageCluster
spec:
autopilot:
enabled: true

Include enabled: true in the specification to activate Autopilot.

Customize Autopilot install

You can customize the Autopilot installation by adding configuration parameters to the Autopilot spec within your Portworx StorageCluster manifest. Here is an example on how to modify your Portworx StorageCluster spec to add these configurations for customizing your Autopilot install:

apiVersion: core.libopenstorage.org/v1
kind: StorageCluster
...
spec:
autopilot:
enabled: true
image: portworx/autopilot:1.3.14
providers:
- name: default
params:
url: https://<THANOS-QUERIER-HOST>
type: prometheus
args:
log-level: debug

Autopilot with PX-Security

If you're installing Autopilot with PX-Security using the Operator, you must modify the StorageCluster yaml. Add the following PX_SHARED_SECRET env var to the autopilot section:

  autopilot:
...
env:
- name: PX_SHARED_SECRET
valueFrom:
secretKeyRef:
key: apps-secret
name: px-system-secrets

Upgrade Autopilot

To upgrade Autopilot and ensure your Portworx deployment is using the latest recommended components, follow the appropriate procedure based on your setup:

To a custom image

To upgrade Autopilot to a custom image:

  1. Update the configmap/px-versions with the desired custom Autopilot image.
  2. Add the autoUpdateComponents field to the storage cluster specification:
kind: StorageCluster
spec:
autoUpdateComponents: Once

This will prompt the Portworx Operator to reconcile the Autopilot component and pull the latest image from the updated configmap.

With Portworx Upgrade (without configmap)

  1. Delete the configmap/px-versions file.

    When Portworx is upgraded, the Operator will automatically upgrade the installed components to the recommended versions.

  2. Upgrade the Portworx image in the storage cluster specification to proceed with the upgrade.

With Portworx Upgrade (with configmap)

  1. Download the latest Portworx version manifest:

    curl -o versions.yaml "https://install.portworx.com/$PXVER/version?kbver=$KBVER"
  2. Update the px-versions configmap with the downloaded version manifest:

    kubectl -n <px-namespace> delete configmap px-versions
    kubectl -n <px-namespace> create configmap px-versions --from-file=versions.yaml
  3. Add the autoUpdateComponents field to the storage cluster specification:

    kind: StorageCluster
    spec:
    autoUpdateComponents: Once

    This will prompt the Portworx Operator to reconcile all components and retrieve the latest images from the configmap if available, or download them from the manifest if not.