kubectl create namespace postgres-ai-monexistingSecret:
name: postgres-ai-monitoring-secrets
global:
clusterName: my-cluster
nodeName: my-node
customTags:
env: production
monitoredDatabases:
- name: my-db
host: db-host.example.com
port: 5432
database: postgres
user: postgres_ai_mon
passwordSecretKey: my-db-password
presetMetrics: full
isEnabled: true
group: production
grafana:
enabled: true
admin:
existingSecret: postgres-ai-monitoring-secrets
userKey: grafana-admin-user
passwordKey: grafana-admin-password
service:
type: ClusterIP
ingress:
enabled: true
className: nginx
hosts:
grafana: monitoring.example.com
storage:
postgresSize: 100Gi
victoriaMetricsSize: 200Gi
storageClassName: standardCustomize: clusterName, monitoredDatabases, ingress.hosts, and storageClassName.
kubectl create secret generic postgres-ai-monitoring-secrets \
--namespace postgres-ai-mon \
--from-literal=postgres-password='SINK_POSTGRES_PASSWORD' \
--from-literal=grafana-admin-user='monitor' \
--from-literal=grafana-admin-password='GRAFANA_PASSWORD' \
--from-literal=pgai-api-key='POSTGRES_AI_API_KEY' \
--from-literal=db-password-my-db-password='DB_PASSWORD'Notes:
SINK_POSTGRES_PASSWORDshould be generated by you and will be used to connect to the internal database for storing metricsGRAFANA_PASSWORDshould be generated by you and will be used to access grafanaPOSTGRES_AI_API_KEYshould be attained from PostgresAI platform and will be used to connect to the PostgresAI platform- Add
--from-literalfor each database that you want to monitor- Key must match
passwordSecretKeyin custom-values.yaml - Key name must be
db-password-<passwordSecretKey>and value must be the password for monitoring user in the database
- Key must match
helm install postgres-ai-monitoring ./postgres-ai-monitoring-0.12.tgz \
--namespace postgres-ai-mon \
--values custom-values.yamlkubectl get pods -n postgres-ai-monPort Forward (quick access):
kubectl port-forward -n postgres-ai-mon svc/postgres-ai-monitoring-grafana 3000:80Open: http://localhost:3000
Ingress: Access via configured domain (e.g., http://monitoring.example.com)
Login: Username and password from the secret (grafana-admin-user / grafana-admin-password)
helm upgrade postgres-ai-monitoring ./postgres-ai-monitoring-0.12.tgz \
--namespace postgres-ai-mon \
--values custom-values.yaml-
Add entry to
monitoredDatabasesin custom-values.yaml -
Add password to secret:
kubectl create secret generic postgres-ai-monitoring-secrets \
--namespace postgres-ai-mon \
--from-literal=new-db-password='password' \
--dry-run=client -o yaml | kubectl apply -f -- Run
helm upgrade
kubectl logs -n postgres-ai-mon <pod-name>helm uninstall postgres-ai-monitoring --namespace postgres-ai-monThis removes all resources created by the Helm chart, but preserves PersistentVolumeClaims and secrets.
Warning: This will permanently delete all stored metrics and Grafana data.
kubectl delete pvc -n postgres-ai-mon --allOr delete specific PVCs:
kubectl delete pvc -n postgres-ai-mon data-postgres-ai-monitoring-sink-postgres-0
kubectl delete pvc -n postgres-ai-mon data-postgres-ai-monitoring-victoriametrics-0kubectl delete secret -n postgres-ai-mon postgres-ai-monitoring-secretsWarning: This will delete all resources in the namespace, including any data stored in PersistentVolumes.
kubectl delete namespace postgres-ai-monNote: Before deleting the namespace, ensure no other applications are using it.