Master Prometheus: Step-by-Step Deployment and Verification on Kubernetes
This guide walks you through the fundamentals of Prometheus, its architecture, and detailed Helm‑based deployment and validation steps on a Kubernetes cluster, enabling reliable monitoring for cloud‑native environments.
With the rise of micro‑service architectures and cloud‑native technologies, monitoring systems have become increasingly critical. Prometheus, an open‑source monitoring system and time‑series database, is prized for its powerful query language, multi‑dimensional data model, and easy integration, making it essential for both beginners and seasoned operations engineers.
Prometheus Overview
Prometheus is an open‑source monitoring and alerting toolkit originally built at SoundCloud. Since its 2012 launch, many companies and organizations have adopted Prometheus; it now enjoys a very active developer and user community. It is maintained as an independent open‑source project and joined the Cloud Native Computing Foundation in 2016 as the second hosted project after Kubernetes.
Prometheus stores metrics as time‑series data, pairing each metric value with a timestamp and optional key‑value pairs called labels .
Deploying Prometheus
Follow these steps to deploy Prometheus on a Kubernetes cluster using Helm charts:
Download the Prometheus chart package.
$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
"prometheus-community" has been added to your repositories
$ helm pull prometheus-community/prometheus --version 25.25.0Upload the chart to an internal Harbor registry.
$ sudo helm registry login core.jiaxzeng.com --username admin
Password:
Login Succeeded
$ helm push prometheus-25.25.0.tgz oci://core.jiaxzeng.com/plugins
Pushed: core.jiaxzeng.com/plugins/prometheus:25.25.0
Digest: sha256:12441f0fb9fa902f7442a3d21aefc19a92c974738b8a05209df4025840b7e143Pull the chart on the internal host.
$ sudo helm registry login core.jiaxzeng.com --username admin
Password:
Login Succeeded
$ sudo helm pull oci://core.jiaxzeng.com/plugins/prometheus --version 25.25.0 --untar --untardir /etc/kubernetes/addons/
Pulled: core.jiaxzeng.com/plugins/prometheus:25.25.0
Digest: sha256:12441f0fb9fa902f7442a3d21aefc19a92c974738b8a05209df4025840b7e143Create a values file and install the chart.
$ cat <<'EOF' | sudo tee /etc/kubernetes/addons/prometheus-values.yaml > /dev/null
server:
fullnameOverride: prometheus
image:
repository: core.jiaxzeng.com/library/monitor/prometheus
prefixURL: "/prometheus"
baseURL: "/prometheus"
retention: "7d"
ingress:
enabled: true
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: ca-cluster-issuer
hosts:
- ops.jiaxzeng.com
path: /prometheus
pathType: Prefix
tls:
- secretName: prometheus-tls
hosts:
- ops.jiaxzeng.com
configmapReload:
prometheus:
image:
repository: core.jiaxzeng.com/library/monitor/prometheus-config-reloader
alertmanager:
enabled: false
kube-state-metrics:
enabled: false
prometheus-node-exporter:
enabled: false
prometheus-pushgateway:
enabled: false
EOF
$ helm install -n kube-system prometheus -f /etc/kubernetes/addons/prometheus-values.yaml /etc/kubernetes/addons/prometheusValidating Prometheus
Check that the Prometheus pods are running correctly:
$ kubectl -n kube-system get pod -l app.kubernetes.io/instance=prometheus
NAME READY STATUS RESTARTS AGE
prometheus-7c8db6dd99-j4wjg 2/2 Running 0 4m19sThen verify the UI in a browser (e.g.,
http://ops.jiaxzeng.comor the internal cluster DNS).
Conclusion
By following this article you should now have a complete Prometheus monitoring system deployed, enabling you to maintain system health, detect issues promptly, and safeguard business continuity.
Linux Ops Smart Journey
The operations journey never stops—pursuing excellence endlessly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.