diff --git a/docs/enterprise/monitoring-access-dashboards.mdx b/docs/enterprise/monitoring-access-dashboards.mdx new file mode 100644 index 0000000000..8538e74185 --- /dev/null +++ b/docs/enterprise/monitoring-access-dashboards.mdx @@ -0,0 +1,70 @@ +# 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](monitoring-applications). + +## Overview + +The Prometheus [expression browser](https://prometheus.io/docs/visualization/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`. + +:::note +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](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizations/node-ports.md) in the kube-prometheus GitHub repository. For information about exposing the pods behind an ingress controller, see [Expose via Ingress](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizations/exposing-prometheus-alertmanager-grafana-ingress.md) 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](monitoring-applications) + +## Access Prometheus + +To access the Prometheus dashboard: + +1. Run the following command to port forward the Prometheus service: + + ```bash + kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090 + ``` + +1. 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](https://grafana.com/docs/). For information about constructing Prometheus queries, see [Querying Prometheus](https://prometheus.io/docs/prometheus/latest/querying/basics/) in the Prometheus documentation. + +To access the Grafana dashboard: + +1. Run the following command to port forward the Grafana service: + + ```bash + kubectl --namespace monitoring port-forward deployment/grafana 3000 + ``` +1. Access the dashboard at http://localhost:3000. +1. 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](https://prometheus.io/docs/alerting/configuration/) in the Prometheus documentation. + +To access the Alertmanager dashboard: + +1. Run the following command to port forward the Alertmanager service: + + ``` + kubectl --namespace monitoring port-forward svc/prometheus-alertmanager 9093 + ``` + +1. Access the dashboard at http://localhost:9093. \ No newline at end of file diff --git a/docs/enterprise/monitoring-applications.mdx b/docs/enterprise/monitoring-applications.mdx index df5b8fa314..37dc4e1242 100644 --- a/docs/enterprise/monitoring-applications.mdx +++ b/docs/enterprise/monitoring-applications.mdx @@ -1,26 +1,22 @@ import OverviewProm from "../partials/monitoring/_overview-prom.mdx" -import LimitationEc from "../partials/monitoring/_limitation-ec.mdx" -# Monitoring Applications with Prometheus +# Configuring Prometheus Monitoring in Existing Cluster KOTS Installations -This topic describes monitoring applications and clusters with Prometheus. It includes information about how to configure Prometheus monitoring for existing clusters and how to access the dashboard using a port forward. +This topic describes how to monitor applications and clusters with Prometheus in existing cluster installations with Replicated KOTS. -## Overview - - +For information about how to access Prometheus, Grafana, and Alertmanager, see [Accessing Dashboards Using Port Forwarding](/enterprise/monitoring-access-dashboards). -## Limitation +For information about consuming Prometheus metrics externally in kURL installations, see [Consuming Prometheus Metrics Externally](monitoring-external-prometheus). - +## Overview -## Configure Monitoring in Existing Clusters {#configure-existing} + -To configure Prometheus monitoring for applications installed in an existing cluster, connect the Admin Console to the endpoint of an installed instance of Prometheus on the cluster. See the following sections: +## Configure Prometheus Monitoring -* [Install Prometheus](#install-prometheus) -* [Connect to a Prometheus Endpoint](#connect-to-a-prometheus-endpoint) +For existing cluster installations with KOTS, users can install Prometheus in the cluster and then connect the Admin Console to the Prometheus endpoint to enable monitoring. -### Install Prometheus +### Step 1: Install Prometheus in the Cluster {#configure-existing} Replicated recommends that you use CoreOS's Kube-Prometheus distribution for installing and configuring highly available Prometheus on an existing cluster. For more information, see the [kube-prometheus](https://github.com/coreos/kube-prometheus) GitHub repository. @@ -43,9 +39,9 @@ To install Prometheus using the recommended Kube-Prometheus distribution: For more information about advanced Kube-Prometheus configuration options, see [Customizing Kube-Prometheus](https://github.com/coreos/kube-prometheus#customizing-kube-prometheus) in the kube-prometheus GitHub repository. -### Connect to a Prometheus Endpoint +### Step 2: Connect to a Prometheus Endpoint -To view graphs on the Admin Console dashboard, you must provide the address of the Prometheus instance that you installed on the cluster. +To view graphs on the Admin Console dashboard, provide the address of a Prometheus instance installed in the cluster. To connect the Admin Console to a Prometheus endpoint: @@ -54,76 +50,4 @@ To connect the Admin Console to a Prometheus endpoint: ![Configuring Prometheus](/images/kotsadm-dashboard-configureprometheus.png) - Graphs appear on the dashboard shortly after saving the address. - -## Access the Dashboards with kubectl Port Forward - -You can use the commands below to access Prometheus, Grafana, and Alertmanager dashboards using `kubectl port-forward` after you install the manifests. - -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](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizations/node-ports.md) in the kube-prometheus GitHub repository. For information about exposing the pods behind an ingress controller, see [Expose via Ingress](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizations/exposing-prometheus-alertmanager-grafana-ingress.md) in the kube-prometheus GitHub repository. - -For Replicated kURL clusters, you can consume Prometheus metrics from an external monitoring solution by connecting to the Prometheus NodePort service running in the cluster. For more information, see [Consuming Prometheus Metrics Externally](monitoring-external-prometheus). - -### Access Prometheus - -To access the Prometheus dashboard with a port forward: - -1. Run the following command to create the port forward: - - ```bash - kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090 - ``` - -1. Access the dashboard at http://localhost:9090. - -### Access Grafana - -To access the Grafana dashboard with a port forward: - -1. Run the following command to create the port forward: - - ```bash - kubectl --namespace monitoring port-forward deployment/grafana 3000 - ``` -1. Access the dashboard at http://localhost:3000. -1. 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 - -To access the Alertmanager dashboard with a port forward: - -1. Run the following command to create the port forward: - - ``` - kubectl --namespace monitoring port-forward svc/prometheus-alertmanager 9093 - ``` - -1. Access the dashboard at http://localhost:9093. - -## About Visualizing Metrics with Grafana - -In addition to the Prometheus Expression Browser, Grafana and some preconfigured dashboards are included with Kube-Prometheus for advanced visualization. - -For information about configuring Grafana, see the [Grafana documentation](https://grafana.com/docs/). - -For information about constructing Prometheus queries, see the [Querying Prometheus](https://prometheus.io/docs/prometheus/latest/querying/basics/) in the Prometheus documentation. - -For information about the Prometheus Expression Browser, see [Expression Browser](https://prometheus.io/docs/visualization/browser/) in the Prometheus documentation. - - -## About Alerting with Prometheus - -Alerting with Prometheus has two phases: - -1. Alerting rules in Prometheus servers send alerts to an Alertmanager. -1. 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](https://prometheus.io/docs/alerting/configuration/) in the Prometheus documentation. + Graphs appear on the dashboard shortly after saving the address. \ No newline at end of file diff --git a/docs/enterprise/monitoring-external-prometheus.md b/docs/enterprise/monitoring-external-prometheus.md index aee56ef423..34aa53093b 100644 --- a/docs/enterprise/monitoring-external-prometheus.md +++ b/docs/enterprise/monitoring-external-prometheus.md @@ -1,3 +1,4 @@ +import OverviewProm from "../partials/monitoring/_overview-prom.mdx" import KurlAvailability from "../partials/kurl/_kurl-availability.mdx" # Consuming Prometheus Metrics Externally @@ -6,11 +7,15 @@ import KurlAvailability from "../partials/kurl/_kurl-availability.mdx" This topic describes how to consume Prometheus metrics in Replicated kURL clusters from a monitoring service that is outside the cluster. -## About the Prometheus NodePort Service +For information about how to access Prometheus, Grafana, and Alertmanager, see [Accessing Dashboards Using Port Forwarding](/enterprise/monitoring-access-dashboards). -By default, Prometheus is included in kURL clusters as a NodePort service named `prometheus-k8s` in the `monitoring` namespace. The `prometheus-k8s` service is exposed on the IP address for each node in the cluster at port 30900. +## Overview -For more information about NodePort services, see [Type NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) in _Services_ in the Kubernetes documentation. + + +For kURL installations, if the [kURL Prometheus add-on](https://kurl.sh/docs/add-ons/prometheus) is included in the kURL installer spec, then the Prometheus monitoring system is installed alongside the application. No additional configuration is required to collect metrics and view any default and custom graphs on the Admin Console dashboard. + +Prometheus is deployed in kURL clusters as a NodePort service named `prometheus-k8s` in the `monitoring` namespace. The `prometheus-k8s` service is exposed on the IP address for each node in the cluster at port 30900. You can run the following command to view the `prometheus-k8s` service in your cluster: @@ -25,6 +30,8 @@ prometheus-k8s NodePort 10.96.2.229 9090:30900/TCP 5hr ``` As shown in the example above, port 9090 on the `prometheus-k8s` service maps to port 30900 on each of the nodes. +For more information about NodePort services, see [Type NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) in _Services_ in the Kubernetes documentation. + ## Prerequisite Before you can consume Prometheus metrics in kURL clusters externally, ensure that firewall rules on all nodes in the cluster allow inbound TCP traffic on port 30900. diff --git a/docs/partials/monitoring/_overview-prom.mdx b/docs/partials/monitoring/_overview-prom.mdx index 4393378ead..ea75499d08 100644 --- a/docs/partials/monitoring/_overview-prom.mdx +++ b/docs/partials/monitoring/_overview-prom.mdx @@ -1,6 +1,6 @@ -For installations in existing clusters and in Replicated kURL clusters, the Replicated KOTS Admin Console uses the open source systems monitoring tool Prometheus to collect metrics on an application and the cluster where the application is installed. Prometheus components include the main Prometheus server, which scrapes and stores time series data, an Alertmanager for alerting on metrics, and Grafana for visualizing metrics. For more information about Prometheus, see [What is Prometheus?](https://prometheus.io/docs/introduction/overview/) in the Prometheus documentation. +The KOTS Admin Console can use the open source systems monitoring tool Prometheus to collect metrics on an application and the cluster where the application is installed. Prometheus components include the main Prometheus server, which scrapes and stores time series data, an Alertmanager for alerting on metrics, and Grafana for visualizing metrics. For more information about Prometheus, see [What is Prometheus?](https://prometheus.io/docs/introduction/overview/) in the Prometheus documentation. -The Admin Console exposes graphs with key metrics collected by Prometheus in the **Monitoring** section of the dashboard. By default, the Admin Console includes the following graphs: +The Admin Console exposes graphs with key metrics collected by Prometheus in the **Monitoring** section of the dashboard. By default, the Admin Console displays the following graphs: * Cluster disk usage * Pod CPU usage @@ -8,12 +8,8 @@ The Admin Console exposes graphs with key metrics collected by Prometheus in the In addition to these default graphs, application developers can also expose business and application level metrics and alerts on the dashboard. -The following screenshot shows an example of the **Monitoring** section on the Admin Console dashboard with the Disk Usage, CPU Usage, and Memory Usage default graphs. +The following screenshot shows an example of the **Monitoring** section on the Admin Console dashboard with the Disk Usage, CPU Usage, and Memory Usage default graphs: -Graphs on the Admin Console dashboard +Graphs on the Admin Console dashboard -[View a larger version of this image](/images/kotsadm-dashboard-graph.png) - -For kURL installations, if the kURL Prometheus add-on is included in the kURL installer spec, then the Prometheus monitoring system is installed alongside the application. No additional configuration is required to collect metrics and view any default and custom graphs on the Admin Console dashboard. For more information about configuring kURL installers, see [Creating a kURL Installer](/vendor/packaging-embedded-kubernetes). - -For existing cluster installations with KOTS, users can install Prometheus and connect the Admin Console to the Prometheus endpoint to enable monitoring. For information about how to set up Prometheus monitoring in existing clusters, see [Configure Monitoring in Existing Clusters](/enterprise/monitoring-applications#configure-existing). \ No newline at end of file +[View a larger version of this image](/images/kotsadm-dashboard-graph.png) \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index 1b31b3a095..ca59bdb76e 100644 --- a/sidebars.js +++ b/sidebars.js @@ -439,7 +439,14 @@ const sidebars = { 'enterprise/auth-configuring-rbac', ], }, - 'enterprise/monitoring-applications', + { + type: 'category', + label: 'Monitoring Applications with Prometheus', + items: [ + 'enterprise/monitoring-applications', + 'enterprise/monitoring-access-dashboards', + ], + }, 'enterprise/status-viewing-details', 'enterprise/delete-admin-console', {