> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitoring

> Installing Kubetail and kube-prometheus-stack via Glasskube to enable real-time log streaming, Prometheus metrics, Grafana dashboards, and Alertmanager alerting for Kubernetes clusters

This article demonstrates how to use Glasskube to install two observability packages for Kubernetes: Kubetail (real-time log streaming) and the kube-prometheus-stack (Prometheus + Alertmanager + Grafana). We install Kubetail first to get immediate access to pod logs, then deploy the kube-prometheus-stack for metrics, dashboards, and alerting.

## What you'll get

* Real-time, web-based log streaming across pods and containers with Kubetail
* A full metrics & alerting stack with Prometheus, Alertmanager, Grafana, and exporters via kube-prometheus-stack
* Pre-configured dashboards and alerting rules that work out of the box

Learn more:

* [Kubernetes Basics](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/)
* [kube-prometheus (Prometheus Operator)](https://github.com/prometheus-operator/kube-prometheus)
* [Grafana documentation](https://grafana.com/docs/)

***

## Kubetail: real-time log viewer

Kubetail (as packaged by Glasskube) provides a web UI for streaming and filtering logs across your cluster in real time. It’s particularly helpful for troubleshooting multi-pod, multi-container applications.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubetail-dashboard-log-entries-interface.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=fa9bf8c33b7e0e6234b45f427c865a56" alt="The image shows a dashboard interface of &#x22;Kubetail&#x22; displaying log entries with timestamps, sources, regions, and HTTP request details. It features filtering options on the left and log data on the right." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubetail-dashboard-log-entries-interface.jpg" />
</Frame>

Package characteristics (Kubetail)

| Field        | Value             |
| ------------ | ----------------- |
| Scope        | cluster-scoped    |
| Values       | none              |
| Entrypoint   | yes (frontend UI) |
| Dependencies | none              |

Kubetail in the Glasskube UI:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubetail-installation-webpage-log-viewer.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=a621efd7825b109493d71fc66f58da50" alt="The image shows a webpage for installing &#x22;kubetail,&#x22; a web-based log viewer for Kubernetes clusters. It includes version details and an option to enable auto updates." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubetail-installation-webpage-log-viewer.jpg" />
</Frame>

Quickly list available packages and installation state with the Glasskube CLI:

```plaintext theme={null}
→ ~ glasskube list
PACKAGENAME   NAMESPACE   NAME                       VERSION   AUTO-UPDATE   REPOSITORY   STATUS
---------------------------------------------------------------------------------------------
quickwit      glasskube   -                          -         -             -             Not installed
...
kubetail                   glasskube   -         -                  Not installed
kube-prometheus-stack      glasskube   -         -                  Not installed
...
```

Install Kubetail via the Glasskube CLI:

```bash theme={null}
glasskube install kubetail
```

Example interactive prompts you may see:

```plaintext theme={null}
# Version not specified. The latest version of kubetail will be installed.
# Would you like to enable automatic updates? (y/N)
# Summary:
# * The following packages will be installed in your cluster (minikube):
#   1. kubetail (version vX.Y.Z)
# * Automatic updates will be enabled
# Continue? (Y/n)
```

Open the Kubetail UI from Glasskube:

```bash theme={null}
glasskube open kubetail
```

Once opened, Kubetail exposes Kubernetes objects (Deployments, DaemonSets, CronJobs, Pods, etc.) and allows you to stream and filter logs across containers and nodes in real time.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-resources-web-interface-diagram.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=7c5f2b8fcd7825d765354ca459a4a572" alt="The image shows a web interface displaying Kubernetes resources, including deployments, jobs, pods, and replica sets, with their namespaces and creation times." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-resources-web-interface-diagram.jpg" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-log-viewer-screenshot.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=4e42b16fd15d0424dfd986e7e3f9bbf8" alt="The image is a screenshot of a Kubernetes log viewer, displaying system logs with time stamps, info messages, and network data related to pods. The interface allows filtering based on sources like pods, containers, OS, architecture, and node." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-log-viewer-screenshot.jpg" />
</Frame>

***

## kube-prometheus-stack: metrics, dashboards, and alerting

The kube-prometheus-stack bundles Prometheus, Alertmanager, Grafana, and several exporters into a pre-configured monitoring solution. It provides:

* Prometheus for metric collection and alerting rules
* Alertmanager for routing/notification
* Grafana with pre-built dashboards
* Exporters such as node-exporter to collect node metrics

This stack is especially useful for Kubernetes cluster-level monitoring and quick setup of observability capabilities.

Package characteristics (kube-prometheus-stack)

| Field        | Value                                                                                       |
| ------------ | ------------------------------------------------------------------------------------------- |
| Scope        | cluster-scoped                                                                              |
| Values       | multiple (customize Prometheus, Alertmanager, Grafana, exporters, storage, retention, etc.) |
| Entrypoint   | yes (Grafana)                                                                               |
| Dependencies | none                                                                                        |

You’ll get many dashboards out of the box:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-dashboard-interface-folders-items.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=3137ef6880af9a08a80fb49e3f9f6755" alt="The image displays a dashboard interface featuring a list of various folders and items related to Kubernetes and other technologies on the left sidebar, and a central panel listing dashboard names with their associated tags." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-dashboard-interface-folders-items.jpg" />
</Frame>

Alerting rules are pre-configured and can be managed from the Rules UI:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/alert-rules-dashboard-prometheus-monitoring.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=11099a975ce99cc579871f5e6b36b78e" alt="The image displays an Alert Rules dashboard from a monitoring system, showing various Prometheus rule files with their states such as firing, normal, and recording. The interface includes a navigation sidebar, a search option, and a summary of alert statuses." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/alert-rules-dashboard-prometheus-monitoring.jpg" />
</Frame>

When installing kube-prometheus-stack from Glasskube you can toggle components and fine-tune values. Common toggles include:

* Enable/disable Alertmanager
* Enable/disable Grafana
* Enable node-exporter host network for richer node metrics
* Configure Prometheus retention and storage size

Glasskube exposes these options in the package configuration UI:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kube-prometheus-stack-glasskube-ui-config.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=ecac53725757c1b0d239e9871415b97e" alt="The image shows a user interface for configuring the &#x22;kube-prometheus-stack&#x22; package on Glasskube, detailing options for enabling features like Alertmanager and Grafana for Kubernetes monitoring." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kube-prometheus-stack-glasskube-ui-config.jpg" />
</Frame>

After installation Glasskube will create the `kube-prometheus-stack` namespace and the stack’s pods will begin to initialize. Verify namespace and pod status:

```bash theme={null}
kubectl get namespace
```

Check pods in the monitoring namespace while resources start up:

```bash theme={null}
kubectl get pods -n kube-prometheus-stack
# Example output while pods initialize:
# NAME                                                       READY   STATUS    RESTARTS   AGE
# alertmanager-kube-prometheus-stack-kube-alertmanager-0    0/2     Init:0/1  0          13s
# kube-prometheus-stack-kube-operator-<id>                  1/1     Running   0          20s
# kube-prometheus-stack-grafana-<id>                        0/3     Init:0/1  0          20s
# prometheus-kube-prometheus-stack-kube-prometheus-0        0/2     Init:0/1  0          12s
```

Give pods a minute or two to reach Running. A fully started example:

```bash theme={null}
kubectl get pods -n kube-prometheus-stack
# NAME                                                       READY   STATUS    RESTARTS   AGE
# alertmanager-kube-prometheus-stack-kube-alertmanager-0    2/2     Running   0          89s
# kube-prometheus-stack-kube-operator-<id>                  1/1     Running   0          96s
# kube-prometheus-stack-grafana-<id>                        2/3     Running   0          96s
# prometheus-kube-prometheus-stack-n<id>                    1/1     Running   0          96s
# kube-prometheus-stack-kube-prometheus-0                   2/2     Running   0          88s
```

Glasskube will display the Grafana entrypoint once the service or ingress is ready. When you open Grafana you will be prompted for credentials. The kube-prometheus-stack Helm chart typically stores the Grafana admin username and password in a Kubernetes secret inside the `kube-prometheus-stack` namespace.

To find and decode the Grafana admin credentials:

```bash theme={null}
# list secrets in the namespace and find the Grafana secret name
kubectl get secrets -n kube-prometheus-stack

# once you identify the Grafana secret name (eg. kube-prometheus-stack-grafana or <release>-grafana),
# decode the admin username and password (key names may vary by chart/version):
kubectl get secret <grafana-secret-name> -n kube-prometheus-stack -o jsonpath="{.data.admin-user}" | base64 --decode; echo
kubectl get secret <grafana-secret-name> -n kube-prometheus-stack -o jsonpath="{.data.admin-password}" | base64 --decode; echo
```

<Callout icon="lightbulb" color="#1CB2FE">
  Default Grafana credentials for many kube-prometheus-stack installs are:

  * Username: `admin`
  * Password: `prom-operator`
    Always confirm by decoding the actual Kubernetes secret in your cluster (see command above) — some releases or charts may override defaults.
</Callout>

After logging into Grafana, dashboards will populate as Prometheus begins scraping metrics. It may take a few minutes for metrics to appear and for panels to show data.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-api-server-dashboard-no-data.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=2d958206c95e7a589dd43ecea076d320" alt="The image displays a dashboard interface with multiple panels showing metrics for a Kubernetes API server, though many sections indicate &#x22;No data.&#x22;" width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kubernetes-api-server-dashboard-no-data.jpg" />
</Frame>

The Rules UI shows alerting rules and their current state (firing, pending, or normal):

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/alert-rules-dashboard-monitoring-app.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=7c7298e001b1edab9897db97e4708928" alt="The image shows the alert rules dashboard in a monitoring application, displaying a list of alert rules and their statuses, such as &#x22;firing&#x22; and &#x22;normal.&#x22; The interface includes options to create new alert or recording rules." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/alert-rules-dashboard-monitoring-app.jpg" />
</Frame>

Glasskube provides a central packages view for installing and managing both Kubetail and kube-prometheus-stack, plus many other packages:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/glasskube-kubernetes-packages-interface.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=7eb47f91ae7f840f7cc7036fde8ef21b" alt="The image shows a web interface for Glasskube, listing various Kubernetes-related packages available for installation, such as &#x22;akri,&#x22; &#x22;argo-cd,&#x22; and &#x22;gpu-operator.&#x22; The interface provides options to install these packages and has a user-friendly design with a dark theme." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/glasskube-kubernetes-packages-interface.jpg" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kube-prometheus-stack-glasskube-interface.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=4c6020eeede19bd8278ce82cfb0a27ad" alt="The image displays a software interface for configuring the &#x22;kube-prometheus-stack&#x22; in Glasskube. Options like enabling Alertmanager, Grafana, and setting Prometheus retention and storage size are visible." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/kube-prometheus-stack-glasskube-interface.jpg" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/glasskube-web-interface-software-packages.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=32e7a8a8eaff27f6a534470e0e0efe7a" alt="The image shows a web interface for &#x22;Glasskube&#x22; with a list of software packages related to Kubernetes, each accompanied by an &#x22;Install&#x22; button. There's also a notification about Glasskube Cloud launching, encouraging users to join the waitlist for early access." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Monitoring/glasskube-web-interface-software-packages.jpg" />
</Frame>

***

## Summary

With Kubetail and kube-prometheus-stack deployed via Glasskube you gain both:

* Real-time log streaming and filtering across pods and containers (Kubetail)
* A full metrics collection, visualization, and alerting platform (Prometheus + Alertmanager + Grafana)

These tools together provide comprehensive observability for Kubernetes clusters, enabling faster troubleshooting and proactive alerting.

Further reading and references:

* [Kubernetes Documentation](https://kubernetes.io/docs/)
* [Prometheus Operator / kube-prometheus](https://github.com/prometheus-operator/kube-prometheus)
* [Grafana Docs](https://grafana.com/docs/)
* [kubectl reference](https://kubernetes.io/docs/reference/kubectl/)

This concludes the monitoring section.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/k8s-administration-package-management-with-glasskube/module/c3806869-7f9e-4cc2-8dc5-aa10304e3d1c/lesson/1a7fb216-b12c-4abf-a4af-a61c2c935d36" />
</CardGroup>
