Installing Autopilot for Portworx
Autopilot allows you to specify monitoring conditions in your cluster to react and apply changes when certain conditions occur without direct intervention. For more information about Autopilot, see the Portworx documentation
Prerequisites
-
Autopilot requires a running Prometheus instance in your cluster. To set up Prometheus, see Monitor your Portworx cluster.
-
Make sure Prometheus is enabled, or edit your
storageCluster
resource and enable it by settingenabled: true
.kubectl get service -n kube-system prometheus
monitoring: prometheus: alertManager: enabled: true enabled: true exportMetrics: true resources: {} telemetry: {}
-
Verify that the Prometheus instance has been created.
kubectl 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
-
Download and save the Autopilot resources to a file called
autopilot.yaml
. -
Optional: If you are installing Autopilot with
PX-Security
, you must modify thestorageCluster
to add thePX_SHARED_SECRET
environment variable to the autopilot section.env: - name: PX_SHARED_SECRET valueFrom: secretKeyRef: key: apps-secret name: px-system-secrets
-
Deploy Autopilot to your cluster.
kubectl apply -f autopilot.yaml
Creating Rules
Now that you have installed autopilot in your cluster, refer to the Portworx documentation on how to create custom rules and actions for your autopilot configuration.