This guide explains the organization of Kubernetes resources after installing the Prometheus Helm chart, detailing components like StatefulSets, Deployments, DaemonSets, and Services.
In this lesson, you will review the Kubernetes resources created by the installed Helm chart. The following sections provide a detailed explanation of each component, accompanied by commands and configuration excerpts.
This guide explains how different Kubernetes resources are organized after installing the Prometheus Helm chart, including StatefulSets, Deployments, DaemonSets, and Services.
Prometheus StatefulSet: This StatefulSet creates the Prometheus server instance. Although the name may be long, it represents the actual Prometheus instance. Connecting to Prometheus means connecting to the container running in this StatefulSet.
Alertmanager StatefulSet: This StatefulSet is responsible for running Alertmanager, which handles alert notifications.
Above the StatefulSets, you will notice several Deployments. Key deployments include:
Prometheus Grafana Deployment: Grafana serves as the graphical UI tool to help visualize data from Prometheus. It is automatically deployed and configured via the Helm chart.
Kube Prometheus Operator Deployment: The Prometheus Operator manages the lifecycle of the Prometheus instance, including configuration updates and restarts as needed.
Kube-state-metrics Deployment: This deployment runs a container that gathers metrics about Kubernetes objects (for example, deployments, services, and pods).
ReplicaSets corresponding to these deployments are also present and ensure that the correct number of pod replicas is maintained.
Above the Deployments section, there is a DaemonSet called Node Exporter. This resource deploys a Node Exporter Pod on every cluster node, including any nodes added later. The Node Exporter collects host-level metrics such as CPU utilization, memory usage, and file system details. For example, if your cluster has two nodes (confirmed using kubectl get nodes), you will see two ready Node Exporter Pods.
The Pods section lists all deployed pods, including:
Prometheus server pod
Alertmanager pod
Grafana pod
Prometheus Operator pod
kube-state-metrics pod
Two Node Exporter pods (one per node)
The Services section exposes these pods as ClusterIP services, meaning they are accessible only within the cluster. To expose the Prometheus server or Grafana externally, you would need to configure an ingress, load balancer, or proxy.Below is an excerpt from the output of kubectl get all:
Within the prometheus.yaml file, locate the configuration for the init container named init-config-reloader. This container uses the Prometheus config reloader image and is responsible for generating the initial Prometheus configuration before the main container starts. A snippet of its configuration is as follows:
These arguments define paths for console templates, configuration files, and the data storage directory.Additional mounted volumes in the Prometheus container include:
A volume named config, containing the Prometheus configuration from a Secret.
A volume for rules retrieved from a ConfigMap.
Volumes such as tls-assets (for TLS certificates) and config-out.
You can also inspect the ConfigMap that stores Prometheus rule files. After retrieving the ConfigMap details, you might find a rule file snippet defining recording rules and alert expressions. For example:
This deployment is mainly responsible for managing Prometheus configurations and ensuring that all related resources (Secrets, ConfigMaps, StatefulSets) are correctly set up. Only essential resources, like the TLS certificate secret, are mounted.
This high-level overview outlines the structure and important components installed with the Helm chart. In later sections, you will learn how to modify these configurations using standard Kubernetes manifests without altering the generated YAML files directly.