Configure Portworx Backup Prometheus
You can configure Portworx Backup's Prometheus and Alertmanager's default storage limit and the number of replicas either during fresh installation or upgrade. You can either use set command or update values.yaml to modify the default limits with the desired values that suits your cluster environment.
-
By default, Portworx Backup Prometheus comes with 5 Gi storage and you can modify this storage limit as shown in the below example based on the storage requirements of your environment.
Here is an example to set Prometheus storage to 8 Gi:
persistentStorage.prometheus.storage=8Gi,
persistentStorage.prometheus.retentionSize=<92% of prometheus.storage in MB>7360MB -
By default, Alertmanager comes with 2 Gi storage, if you need to modify this limit, you can use the below example:
Here is an example to set the storage of Prometheus to 1 Gi:
persistentStorage.alertManager.storage=1Gi -
By default, Prometheus and Alertmanager comes with 2 replicas, if you have to modify as per your requirement, use the below example to set Prometheus and Alertmanager to 3 replicas:
pxbackup.prometheus.replicas=3
pxbackup.alertmanager.replicas=3
Expose Portworx Backup Prometheus
If you want to access Portworx Backup Prometheus metrics externally, you must expose the Prometheus metrics endpoint and retrieve the authentication credentials. This enables integration with external tools such as Grafana for visualization, or other monitoring solutions.
Exposing metrics endpoint
-
Create a NodePort service to expose Prometheus:
apiVersion: v1
kind: Service
metadata:
name: prometheus-nodeport
namespace: central
spec:
type: NodePort
selector:
prometheus: px-backup-dashboard-prometheus
ports:
- name: http
port: 9090
targetPort: 9090
nodePort: 30090 -
Retrieve the NodePort of the exposed service:
kubectl get svc prometheus-nodeport -n central \
-o jsonpath='{.spec.ports[0].nodePort}' -
Construct the Prometheus URL using the master node IP and the NodePort:
http://<master-ip>:<nodeport>
Retrieve Prometheus credentials
Portworx Backup Prometheus is configured with basic authentication. Retrieve the credentials to add Prometheus as a data source in external Grafana.
-
Run the following command to retrieve the password:
echo "$(kubectl get secret pxc-backup-metrics -n central -o jsonpath='{.data.password}' | base64 -d)" -
Use the following credentials when adding the Prometheus as data source:
- Username:
admin - Password: The password retrieved from the previous step
noteThe password is randomly generated and unique for each installation. You must retrieve it using the command above.
- Username:
Next steps
After exposing the Portworx Backup Prometheus metrics endpoint, you can configure Grafana to visualize your backup and restore metrics. For more information, see Configure Grafana for Portworx Backup.