Accessing Dashboards Using Port Forwarding
This topic includes information about how to access Prometheus, Grafana, and Alertmanager in Replicated KOTS existing cluster and Replicated kURL installations.
For information about how to configure Prometheus monitoring in existing cluster installations, see Configuring Prometheus Monitoring in Existing Cluster KOTS Installations.
Overview
The Prometheus expression browser, Grafana, and some preconfigured dashboards are included with Kube-Prometheus for advanced visualization. Prometheus Altertmanager is also included for alerting. You can access Prometheus, Grafana, and Alertmanager dashboards using kubectl port-forward
.
You can also expose these pods on NodePorts or behind an ingress controller. This is an advanced use case. For information about exposing the pods on NodePorts, see NodePorts in the kube-prometheus GitHub repository. For information about exposing the pods behind an ingress controller, see Expose via Ingress in the kube-prometheus GitHub repository.
Prerequisite
For existing cluster KOTS installations, first install Prometheus in the cluster and configure monitoring. See Configuring Prometheus Monitoring in Existing Cluster KOTS Installations
Access Prometheus
To access the Prometheus dashboard:
-
Run the following command to port forward the Prometheus service:
kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090
-
Access the dashboard at http://localhost:9090.
Access Grafana
Users can access the Grafana dashboard by logging in using a default username and password. For information about configuring Grafana, see the Grafana documentation. For information about constructing Prometheus queries, see Querying Prometheus in the Prometheus documentation.
To access the Grafana dashboard:
-
Run the following command to port forward the Grafana service:
kubectl --namespace monitoring port-forward deployment/grafana 3000
-
Access the dashboard at http://localhost:3000.
-
Log in to Grafana:
-
Existing cluster: Use the default Grafana username and password:
admin:admin
. -
kURL cluster: The Grafana password is randomly generated by kURL and is displayed on the command line after kURL provisions the cluster. To log in, use this password generated by kURL and the username
admin
.To retrieve the password, run the following kubectl command:
kubectl get secret -n monitoring grafana-admin -o jsonpath="{.data.admin-password}" | base64 -d
-
Access Alertmanager
Alerting with Prometheus has two phases:
- Phase 1: Alerting rules in Prometheus servers send alerts to an Alertmanager.
- Phase 2: The Alertmanager then manages those alerts, including silencing, inhibition, aggregation, and sending out notifications through methods such as email, on-call notification systems, and chat platforms.
For more information about configuring Alertmanager, see Configuration in the Prometheus documentation.
To access the Alertmanager dashboard:
-
Run the following command to port forward the Alertmanager service:
kubectl --namespace monitoring port-forward svc/prometheus-alertmanager 9093
-
Access the dashboard at http://localhost:9093.