Retour au classement

prometheus-operator/kube-prometheus

Jsonnetprometheus-operator.dev

Use Prometheus to monitor Kubernetes and applications running on Kubernetes

prometheusprometheus-operatorkubernetesoperatorcluster-monitoringalertsdashboardshacktoberfest
Croissance des étoiles
Étoiles
7.7k
Forks
2k
Croissance hebdomadaire
Issues
162
2k4k6k
oct. 2016janv. 2020avr. 2023juil. 2026
README

kube-prometheus

Build Status Slack

[!WARNING] Everything is experimental and may change significantly at any time.

This repository collects Kubernetes manifests, Grafana dashboards, and Prometheus rules combined with documentation and scripts to provide easy to operate end-to-end Kubernetes cluster monitoring with Prometheus using the Prometheus Operator.

The content of this project is written in jsonnet. This project could both be described as a package as well as a library.

Components included in this package:

This stack is meant for cluster monitoring, so it is pre-configured to collect metrics from all Kubernetes components. In addition to that it delivers a default set of dashboards and alerting rules. Many of the useful dashboards and alerts come from the kubernetes-mixin project, similar to this project it provides composable jsonnet as a library for users to customize to their needs.

Prerequisites

You will need a Kubernetes cluster, that's it! By default it is assumed, that the kubelet uses token authentication and authorization, as otherwise Prometheus needs a client certificate, which gives it full access to the kubelet, rather than just the metrics. Token authentication and authorization allows more fine grained and easier access control.

This means the kubelet configuration must contain these flags:

  • --authentication-token-webhook=true This flag enables, that a ServiceAccount token can be used to authenticate against the kubelet(s). This can also be enabled by setting the kubelet configuration value authentication.webhook.enabled to true.
  • --authorization-mode=Webhook This flag enables, that the kubelet will perform an RBAC request with the API to determine, whether the requesting entity (Prometheus in this case) is allowed to access a resource, in specific for this project the /metrics endpoint. This can also be enabled by setting the kubelet configuration value authorization.mode to Webhook.

This stack provides resource metrics by deploying the Prometheus Adapter. This adapter is an Extension API Server and Kubernetes needs to be have this feature enabled, otherwise the adapter has no effect, but is still deployed.

Compatibility

The following Kubernetes versions are supported and work as we test against these versions in their respective branches. But note that other versions might work!

[!NOTE] In CI we will be testing only last two releases and main branch on a regular basis.

kube-prometheus stack Kubernetes 1.32 Kubernetes 1.33 Kubernetes 1.34 Kubernetes 1.35 Kubernetes 1.36
release-0.16 x x
release-0.17 x x
release-0.18 x
main x x

Quickstart

This project is intended to be used as a library (i.e. the intent is not for you to create your own modified copy of this repository).

Though for a quickstart a compiled version of the Kubernetes manifests generated with this library (specifically with example.jsonnet) is checked into this repository in order to try the content out quickly. To try out the stack un-customized run:

  • Create the monitoring stack using the config in the manifests directory:

    # Create the namespace and CRDs, and then wait for them to be available before creating the remaining resources
    # Note that due to some CRD size we are using kubectl server-side apply feature which is generally available since kubernetes 1.22.
    # If you are using previous kubernetes versions this feature may not be available and you would need to use kubectl create instead.
    kubectl apply --server-side -f manifests/setup
    kubectl wait \
        --for condition=Established \
        --all CustomResourceDefinition \
        --namespace=monitoring
    kubectl apply -f manifests/
    

We create the namespace and CustomResourceDefinitions first to avoid race conditions when deploying the monitoring components. Alternatively, the resources in both folders can be applied with a single command kubectl apply --server-side -f manifests/setup -f manifests, but it may be necessary to run the command multiple times for all components to be created successfully.

  • To teardown the stack:

    kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup
    

The official documentation contains the full version of this quick-start guide, and includes instructions on how to access Prometheus, AlertManager, and Grafana.

minikube

To try out this stack, start minikube with the following command:

minikube delete && minikube start --container-runtime=containerd --kubernetes-version=v1.33.1 --memory=6g --bootstrapper=kubeadm --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook --extra-config=scheduler.bind-address=0.0.0.0 --extra-config=controller-manager.bind-address=0.0.0.0

The kube-prometheus stack includes a resource metrics API server (prometheus-adapter by default), so the metrics-server addon is not necessary. Ensure the metrics-server addon is disabled on minikube:

minikube addons disable metrics-server

[!NOTE] If you prefer to use the lightweight upstream metrics-server instead of prometheus-adapter, see Using metrics-server instead of prometheus-adapter.

Getting started

Before deploying kube-prometheus in a production environment, read:

  1. Customizing kube-prometheus
  2. Customization examples
  3. Accessing Graphical User Interfaces
  4. Troubleshooting kube-prometheus

Documentation

  1. Continuous Delivery
  2. Update to new version
  3. For more documentation on the project refer to docs/ directory.

Contributing

To contribute to kube-prometheus, refer to Contributing.

Join the discussion

If you have any questions or feedback regarding kube-prometheus, join the kube-prometheus discussion. Alternatively, consider joining #prometheus-operator slack channel or project's bi-weekly Contributor Office Hours.

License

Apache License 2.0, see LICENSE.

Dépôts similaires
bregman-arie/devops-exercises

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

PythonPyPIOtherdevopsaws
83.3k19.8k
netdata/netdata

The fastest path to AI-powered full stack observability, even for lean teams.

GoGo ModulesGNU General Public License v3.0monitoringdocker
netdata.cloud
79.8k6.5k
grafana/grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

TypeScriptnpmGNU Affero General Public License v3.0grafanamonitoring
grafana.com
75.7k14.3k
prometheus/prometheus

The Prometheus monitoring system and time series database.

GoGo ModulesApache License 2.0monitoringmetrics
prometheus.io
65.3k10.7k
SigNoz/signoz

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

TypeScriptnpmOtherobservabilityapplication-monitoring
signoz.io
31.5k2.4k
grafana/loki

Like Prometheus, but for logs.

GoGo ModulesGNU Affero General Public License v3.0lokigrafana
grafana.com/oss/loki
28.6k4.1k
openfaas/faas

OpenFaaS - Serverless Functions Made Simple

GoGo ModulesOtherfunctions-as-a-servicefunctions
openfaas.com
26.2k2k
apache/skywalking

APM, Application Performance Monitoring System

JavaMavenApache License 2.0skywalkingobservability
skywalking.apache.org
24.9k6.6k
jina-ai/serve

☁️ Build multimodal AI applications with cloud-native stack

PythonPyPIApache License 2.0neural-searchcloud-native
jina.ai/serve
21.9k2.2k
openobserve/openobserve

Open source observability platform for logs, metrics, traces, frontend monitoring, pipelines and LLM observability. A sophisticated, simple and highly performant alternative to Datadog, Splunk, and Elasticsearch with 140x lower storage costs and single binary deployment.

TypeScriptnpmGNU Affero General Public License v3.0logsmetrics
openobserve.ai
20.3k952
milanm/DevOps-Roadmap

DevOps Roadmap for 2026. with learning resources

Apache License 2.0awsazure
newsletter.techworld-with-milan.com
19.9k3.4k
VictoriaMetrics/VictoriaMetrics

VictoriaMetrics: fast, cost-effective monitoring solution and time series database

GoGo ModulesApache License 2.0tsdbprometheus
victoriametrics.com
17.4k1.7k