# kube-prometheus
[![Build Status](https://github.com/prometheus-operator/kube-prometheus/workflows/ci/badge.svg)](https://github.com/prometheus-operator/kube-prometheus/actions)
[![Slack](https://img.shields.io/badge/join%20slack-%23prometheus--operator-brightgreen.svg)](http://slack.k8s.io/)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/prometheus-operator/kube-prometheus)
> Note that everything is experimental and may change significantly at any time.
This repository collects Kubernetes manifests, [Grafana](http://grafana.com/) dashboards, and [Prometheus rules](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/) combined with documentation and scripts to provide easy to operate end-to-end Kubernetes cluster monitoring with [Prometheus](https://prometheus.io/) using the Prometheus Operator.
The content of this project is written in [jsonnet](http://jsonnet.org/). This project could both be described as a package as well as a library.
Components included in this package:
* The [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator)
* Highly available [Prometheus](https://prometheus.io/)
* Highly available [Alertmanager](https://github.com/prometheus/alertmanager)
* [Prometheus node-exporter](https://github.com/prometheus/node_exporter)
* [Prometheus Adapter for Kubernetes Metrics APIs](https://github.com/kubernetes-sigs/prometheus-adapter)
* [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics)
* [Grafana](https://grafana.com/)
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](https://github.com/kubernetes-monitoring/kubernetes-mixin), 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](https://github.com/kubernetes/metrics#resource-metrics-api) by deploying
the [Prometheus Adapter](https://github.com/kubernetes-sigs/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!
| kube-prometheus stack | Kubernetes 1.22 | Kubernetes 1.23 | Kubernetes 1.24 | Kubernetes 1.25 | Kubernetes 1.26 | Kubernetes 1.27 | Kubernetes 1.28 |
|--------------------------------------------------------------------------------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
| [`release-0.10`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.10) | ✔ | ✔ | ✗ | ✗ | x | x | x |
| [`release-0.11`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.11) | ✗ | ✔ | ✔ | ✗ | x | x | x |
| [`release-0.12`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.12) | ✗ | ✗ | ✔ | ✔ | x | x | x |
| [`release-0.13`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.13) | ✗ | ✗ | ✗ | x | ✔ | ✔ | ✔ |
| [`main`](https://github.com/prometheus-operator/kube-prometheus/tree/main) | ✗ | ✗ | ✗ | x | x | ✔ | ✔ |
## Quickstart
> Note: For versions before Kubernetes v1.21.z refer to the [Kubernetes compatibility matrix](#compatibility) in order to choose a compatible branch.
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](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:
```shell
# 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.
* And to teardown the stack:
```shell
kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup
```
### minikube
To try out this stack, start [minikube](https://github.com/kubernetes/minikube) with the following command:
```shell
$ minikube delete && minikube start --kubernetes-version=v1.23.0 --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:
```shell
$ minikube addons disable metrics-server
```
## Getting started
Before deploying kube-prometheus in a production environment, read:
1. [Customizing kube-prometheus](docs/customizing.md)
2. [Customization examples](docs/customizations)
3. [Accessing Graphical User Interfaces](docs/access-ui.md)
4. [Troubleshooting kube-prometheus](docs/troubleshooting.md)
## Documentation
1. [Continuous Delivery](examples/continuous
没有合适的资源?快使用搜索试试~ 我知道了~
kube-Prometheus0.13版本,已修改镜像
共313个文件
yaml:126个
libsonnet:55个
jsonnet:46个
需积分: 1 0 下载量 198 浏览量
2024-05-13
15:56:21
上传
评论
收藏 675KB ZIP 举报
温馨提示
镜像已修改,更容易被下载
资源推荐
资源详情
资源评论
收起资源包目录
kube-Prometheus0.13版本,已修改镜像 (313个子文件)
auth 105B
etcd-client.crt 0B
etcd-client-ca.crt 0B
.gitignore 141B
.gitignore 30B
main_test.go 8KB
prometheus_client.go 3KB
tools.go 521B
grafana-weave-net-cluster.json 74KB
grafana-weave-net.json 57KB
jsonnetfile.lock.json 5KB
example-grafana-dashboard.json 5KB
jsonnetfile.json 3KB
kubescape-exceptions.json 2KB
versions.json 315B
jsonnetfile.json 206B
existingrule.json 181B
my.release-0.3.jsonnet 10KB
my.release-0.8.jsonnet 10KB
prometheus-pvc.jsonnet 4KB
etcd.jsonnet 4KB
ingress.jsonnet 3KB
minikube.jsonnet 3KB
ingress-one-to-many.jsonnet 3KB
prometheus-thanos.jsonnet 2KB
example.jsonnet 2KB
prometheus-agent.jsonnet 2KB
rule-patcher.jsonnet 2KB
name-namespace-overrides.jsonnet 2KB
windows-hostprocess.jsonnet 2KB
grafana-additional-jsonnet-dashboard-example.jsonnet 2KB
weave-net-example.jsonnet 2KB
windows.jsonnet 2KB
drop-dashboards.jsonnet 2KB
prometheus-additional-alert-rule-example.jsonnet 2KB
pod-security-policies.jsonnet 2KB
prometheus-additional-recording-rule-example.jsonnet 2KB
mixin-inclusion.jsonnet 2KB
thanos-sidecar.jsonnet 2KB
additional-namespaces-servicemonitor.jsonnet 2KB
prometheus-additional-rendered-rule-example.jsonnet 1KB
eks-cni-example.jsonnet 1KB
etcd-skip-verify.jsonnet 1KB
kustomize.jsonnet 1KB
grafana-additional-rendered-dashboard-example.jsonnet 1KB
kubeProxy.jsonnet 1KB
internal-registry.jsonnet 985B
grafana-additional-rendered-dashboard-example-2.jsonnet 981B
alertmanager-config-template-external.jsonnet 975B
all-namespaces.jsonnet 968B
additional-namespaces.jsonnet 935B
anti-affinity.jsonnet 919B
strip-limits.jsonnet 918B
sync-to-internal-registry.jsonnet 867B
grafana-ldap.jsonnet 848B
build-snippet.jsonnet 831B
networkpolicies-disabled.jsonnet 814B
argocd-basic.jsonnet 593B
grafana-only-dashboards.jsonnet 555B
alertmanager-config.jsonnet 512B
alertmanager-config-external.jsonnet 175B
platform.jsonnet 125B
node-ports.jsonnet 99B
etcd-client.key 0B
pyrra.libsonnet 17KB
prometheus-adapter.libsonnet 13KB
prometheus.libsonnet 12KB
k8s-control-plane.libsonnet 11KB
node-exporter.libsonnet 10KB
dropping-deprecated-metrics-relabelings.libsonnet 9KB
blackbox-exporter.libsonnet 8KB
main.libsonnet 7KB
alertmanager.libsonnet 6KB
kube-state-metrics.libsonnet 6KB
podsecuritypolicies.libsonnet 6KB
windows-hostprocess.libsonnet 6KB
custom-metrics.libsonnet 5KB
prometheus-operator.libsonnet 5KB
rule-sanitizer.libsonnet 5KB
ksm-autoscaler.libsonnet 4KB
alerts.libsonnet 4KB
grafana.libsonnet 4KB
aws-vpc-cni.libsonnet 3KB
changing-default-rules.libsonnet 3KB
kube-rbac-proxy.libsonnet 3KB
static-etcd.libsonnet 3KB
external-metrics.libsonnet 3KB
anti-affinity.libsonnet 3KB
general.libsonnet 2KB
windows.libsonnet 2KB
weave-net.libsonnet 2KB
platforms.libsonnet 1KB
custom.libsonnet 1KB
kops.libsonnet 1KB
node-rules.libsonnet 1KB
insecure-kubelet.libsonnet 1KB
bootkube.libsonnet 1KB
mixin.libsonnet 1KB
strip-limits.libsonnet 1KB
ksm-lite.libsonnet 1KB
共 313 条
- 1
- 2
- 3
- 4
资源评论
你的龙宇
- 粉丝: 9
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 驱动代码驱动代码驱动代码驱动代码
- SVID_20240523_141155_1.mp4
- Code for the complete guide to tkinter tutorial
- 关于百货中心供应链管理系统.zip
- SimpleFolderIcon-master 修改Unity的Project下的文件夹图标
- A python Tkinter widget to display tile based maps
- A pure Python library for adding tables to a Tkinter application
- Vector资源文件.zip
- MobaXterm-Installer
- 88-520告白(520气球).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功