- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 azure 中运行 kubernetes 1.15。
当我的一个或多个应用程序/pod 在 kubernetes 中出现故障时,我需要一个基本警报(电子邮件/松弛通知)。
例如,我有 https://cert-manager.io/docs/在多个集群中运行(托管在 azure 中),如果它停止运行,我想收到警报(电子邮件/松弛通知)。
基于这篇文章:
How do I set up a hook to send an email on Kubernetes pod restart?
似乎收到电子邮件警报我需要安装 Prometheus + Grafana 访问 web-ui 并根据以下内容配置警报:
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack
我试过了:
helm version
version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring
但这给出了:
Error: failed to install CRD crds/crd-alertmanager.yaml: unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1"
这里有一些关于如何手动创建 crd 的指南:
$ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
error: unable to recognize "https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1"
$ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
error: unable to recognize "https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1"
$ kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
error: unable to recognize "https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1"
...
我也发现了这个
kube-prometheus 堆栈 兼容性矩阵:
$ helm search repo prometheus-community/kube-prometheus-stack --versions
NAME CHART VERSION APP VERSION DESCRIPTION
prometheus-community/kube-prometheus-stack 10.1.2 0.42.1 kube-prometheus-stack collects Kubernetes manif...
prometheus-community/kube-prometheus-stack 10.1.1 0.42.1 kube-prometheus-stack collects Kubernetes manif...
prometheus-community/kube-prometheus-stack 10.1.0 0.42.1 kube-prometheus-stack collects Kubernetes manif...
prometheus-community/kube-prometheus-stack 10.0.2 0.42.1 kube-prometheus-stack collects Kubernetes manif...
prometheus-community/kube-prometheus-stack 10.0.1 0.42.1 kube-prometheus-stack collects Kubernetes manif...
所以似乎这可能是安装 Prometheus 的第三种方式
$ helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring --version 9.4.10
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
NAME: kube-prometheus-stack
LAST DEPLOYED: Fri Oct 23 15:15:03 2020
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
NOTES:
kube-prometheus-stack has been installed. Check its status by running:
kubectl --namespace monitoring get pods -l "release=kube-prometheus-stack"
Visit https://github.com/prometheus-operator/kube-prometheus for instructions on how to create & configure Alertmanager and Prometheus instances using the Operator.
在较旧的 k8s 版本上安装东西时,猜测试错是要走的路,不过对于兼容性矩阵可能很好。
最佳答案
基于 kube-prometheus-stack repo,此 helm chart 受限于 K8s 1.16.0 及以上版本;
kubeVersion: ">=1.16.0-0"
Kubernetes 1.10+ with Beta APIs
, helm chart 在内部检查 kube 版本是否为 1.16.0 或更高版本。
关于kubernetes - 无法在 k8s 1.15 中安装 kube-prometheus-stack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64494540/
我是普罗米修斯的新手。根据我到目前为止所阅读和尝试的内容,Prometheus 客户端库通过 HTTP 公开收集的指标,Prometheus 定期读取(抓取)。 在 Prometheus 抓取指标之前
我们正在寻求实现监控和警报解决方案,我们希望为每个功能单元提供自己的 prometheus 实例。 目前我们通过 prometheus-operator 使用单个 prometheus 实例运行它,但
在 Prometheus 中,有标签柯里化(Currying)。一些示例方法类似于 CurryWith()。 这是什么意思?抱歉,我没有找到这方面的任何文档。 问题可能与英语不是我的母语有关,我从函数
如何编写一个查询来输出过去 24 小时内实例的平均内存使用情况? 以下查询显示当前内存使用情况 100 * (1 - ((node_memory_MemFree + node_memory_Cache
我正在向 prometheus 发送与两个磁盘相关的数据。我想提醒一个磁盘的指标是否停止发送指标。假设我有 diskA 和 diskB,我正在收集 disk_up 指标。现在diskB失败了。在普罗米
我正在考虑将一些指标导出到 Prometheus,但我对我计划做的事情感到紧张。 我的系统由一个工作流引擎组成,我想跟踪工作流中每个步骤的一些指标。这似乎是合理的,有一个名为 wfengine_ste
我想根据 prometheus 值文件中的环境 qa/prod 设置环境特定的值 ## Additional alertmanager container environment variable
我有一个包含路径和状态代码的请求直方图...如果过去一小时内的错误比前一小时增加了 20%,我如何发出警报? 一个指标示例: {instance="someIp",instance_hostname=
我有一个包含路径和状态代码的请求直方图...如果过去一小时内的错误比前一小时增加了 20%,我如何发出警报? 一个指标示例: {instance="someIp",instance_hostname=
像这样的 Prometheus 规则文件: groups: - name: ./example.rules rules: - alert: ExampleAlert expr: vec
我们有多个在数据中心运行的 Prometheus 实例(我将它们称为 DC Prometheus 实例),以及一个额外的 Prometheus 实例(在下面的文本中我们将其称为“主”),我们在其中从
最近 prometheus-operator图表已弃用,图表已重命名 kube-prometheus-stack更清楚地反射(reflect)它安装了 kube-prometheus 项目堆栈,其中
我在 Amazon linux 2 实例上安装了 prometheus,这是我在用户数据中使用的配置: cat /etc/systemd/system/prometheus.service [Uni
我们正在使用 prometheus 运算符,我们现在想将数据存储在磁盘上,有一个博客对此进行了解释,但不确定来自查询的数字/大小响应 https://www.robustperception.io/h
目标 通过 grafana 和 prometheus 跟踪 RPM 和正常运行时间 情况 我们正在使用 django-prometheus -> To emit metrics fluent-bit
我有 Prometheus 从几台机器上的节点导出器中抓取指标,配置如下: scrape_configs: - job_name: node_exporter static_configs
我的 Prometheus 设置中有一个警报,它会在 someMetric > 100 时发送警报已对 5m 有效然后每隔 24h 重新发送警报根据下面的配置: prometheus-alert.ym
我有两个计数器。一个是测量累加器,另一个是测量计数。如何生成范围向量平均值? 我尝试了以下但得到的结果为空。 rate(my_events{type="sum"}[60s]) / rate(my_ev
因为 Prometheus 仅支持文本指标和许多 json 中的工具返回指标(如 Finatra、Spring Boot),所以我创建了一个简单的代理,将 json 转换为文本。因为我想将它用于多个源
Prometheus 是否可以计算指标具有特定值的持续时间(例如以秒为单位)? 一个简单的例子是 up可以有两个值的度量:1或 0指示系统是否正在运行。想象一下,自上周以来,系统多次上下波动。 我希望
我是一名优秀的程序员,十分优秀!