instruction: How do you set up a complete Prometheus monitoring stack?
output: GitHub - prometheus-operator/kube-prometheus: Use Prometheus to monitor Kubernetes and applications running on Kubernetes Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Product GitHub Copilot Write better code with AI GitHub Spark New Build and deploy intelligent apps GitHub Models New Manage and compare prompts GitHub Advanced Security Find and fix vulnerabilities Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes Discussions Collaborate outside of code Code Search Find more, search less Explore Why GitHub All features Documentation GitHub Skills Blog Solutions By company size Enterprises Small and medium teams Startups Nonprofits By use case DevSecOps DevOps CI/CD View all use cases By industry Healthcare Financial services Manufacturing Government View all industries View all solutions Resources Topics AI DevOps Security Software Development View all Explore Learning Pathways Events &amp; Webinars Ebooks &amp; Whitepapers Customer Stories Partners Executive Insights Open Source GitHub Sponsors Fund open source developers The ReadME Project GitHub community articles Repositories Topics Trending Collections Enterprise Enterprise platform AI-powered developer platform Available add-ons GitHub Advanced Security Enterprise-grade security features Copilot for business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} prometheus-operator / kube-prometheus Public Notifications You must be signed in to change notification settings Fork 2k Star 7.3k Use Prometheus to monitor Kubernetes and applications running on Kubernetes prometheus-operator.dev/ License Apache-2.0 license 7.3k stars 2k forks Branches Tags Activity Star Notifications You must be signed in to change notification settings Code Issues 168 Pull requests 30 Discussions Actions Wiki Security Uh oh! There was an error while loading. Please reload this page . Insights Additional navigation options Code Issues Pull requests Discussions Actions Wiki Security Insights prometheus-operator/kube-prometheus main Branches Tags Go to file Code Open more actions menu Folders and files Name Name Last commit message Last commit date Latest commit History 3,160 Commits .github .github developer-workspace developer-workspace docs docs examples examples experimental/ metrics-server experimental/ metrics-server jsonnet/ kube-prometheus jsonnet/ kube-prometheus manifests manifests scripts scripts tests/ e2e tests/ e2e .gitignore .gitignore .gitpod.yml .gitpod.yml .mdox.validate.yaml .mdox.validate.yaml CHANGELOG.md CHANGELOG.md CONTRIBUTING.md CONTRIBUTING.md LICENSE LICENSE Makefile Makefile README.md README.md RELEASE.md RELEASE.md build.sh build.sh code-of-conduct.md code-of-conduct.md example.jsonnet example.jsonnet go.mod go.mod go.sum go.sum jsonnetfile.json jsonnetfile.json jsonnetfile.lock.json jsonnetfile.lock.json kubescape-exceptions.json kubescape-exceptions.json kustomization.yaml kustomization.yaml View all files Repository files navigation README Code of conduct Contributing Apache-2.0 license Security kube-prometheus 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: The Prometheus Operator Highly available Prometheus Highly available Alertmanager Prometheus node-exporter Prometheus blackbox-exporter Prometheus Adapter for Kubernetes Metrics APIs kube-state-metrics Grafana 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.27 Kubernetes 1.28 Kubernetes 1.29 Kubernetes 1.30 Kubernetes 1.31 Kubernetes 1.32 Kubernetes 1.33 release-0.13 ✔ ✔ x x x x x release-0.14 x x ✔ ✔ ✔ x x release-0.15 x x x x ✔ ✔ ✔ main x x 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 &amp;&amp; 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, so the metrics-server addon is not necessary. Ensure the metrics-server addon is disabled on minikube: minikube addons disable metrics-server Getting started Before deploying kube-prometheus in a production environment, read: Customizing kube-prometheus Customization examples Accessing Graphical User Interfaces Troubleshooting kube-prometheus Documentation Continuous Delivery Update to new version 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 . About Use Prometheus to monitor Kubernetes and applications running on Kubernetes prometheus-operator.dev/ Topics kubernetes alerts prometheus dashboards operator hacktoberfest cluster-monitoring prometheus-operator Resources Readme License Apache-2.0 license Code of conduct Code of conduct Contributing Contributing Security policy Security policy Uh oh! There was an error while loading. Please reload this page . Activity Custom properties Stars 7.3k stars Watchers 65 watching Forks 2k forks Report repository Releases 15 v0.15.0 Latest Jun 4, 2025 + 14 releases Uh oh! There was an error while loading. Please reload this page . Contributors 305 + 291 contributors Languages Jsonnet 87.1% Shell 5.9% Go 5.4% Makefile 1.6% Footer &copy; 2025 GitHub,&nbsp;Inc. Footer navigation Terms Privacy Security Status Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time.