Kubernetes 无法在k8s 1.15中安装kube prometheus堆栈

Kubernetes 无法在k8s 1.15中安装kube prometheus堆栈,kubernetes,alert,monitoring,Kubernetes,Alert,Monitoring,在azure中运行kubernetes 1.15 当我的一个或多个应用程序/吊舱在kubernetes停机时,我需要一个基本警报(电子邮件/松弛通知) 例如,我在多个集群中运行(托管在azure中),如果它停止运行,我希望收到警报(电子邮件/松弛通知) 根据这篇文章: 它似乎收到了一封电子邮件警报,我需要安装Prometheus+Grafana访问web ui并根据以下内容配置警报: 我试过: helm version version.BuildInfo{Version:"v3.

在azure中运行kubernetes 1.15

当我的一个或多个应用程序/吊舱在kubernetes停机时,我需要一个基本警报(电子邮件/松弛通知)

例如,我在多个集群中运行(托管在azure中),如果它停止运行,我希望收到警报(电子邮件/松弛通知)

根据这篇文章:

它似乎收到了一封电子邮件警报,我需要安装Prometheus+Grafana访问web ui并根据以下内容配置警报:

我试过:

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的指南:

但只有在运行helm 2.x(我不是在运行3.1.2)时才有必要这样做

此外,如果我尝试手动安装它们,我会得到:

$ 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"
...
我还发现了这个库贝普罗米修斯堆栈兼容性矩阵:

但是matris中的版本与我得到的版本不匹配:

$ 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...
看来这可能是安装普罗米修斯的第三种方法

欢迎您的任何意见

更新:

随机选择以前的主要版本(9.4.10)似乎有效:

$ 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堆栈回购,此头盔图表仅适用于k8s 1.16.0或更高版本

kubeVersion:“>=1.16.0-0”

尽管github自述文件称先决条件为带有Beta API的Kubernetes 1.10+,但helm图表在内部检查kube版本是否为1.16.0或更高版本

所以我相信,您需要在升级的K8s集群上尝试这一点

如果升级集群不是一个选项,那么您可以尝试使用不推荐使用的旧版本


不推荐的旧版本可能匹配-我添加了上面的链接来回答。啊,考虑到最新版本预期为1.16或更高版本,这也很好。有人否决了答案,也许他们可以在这样做的时候给出一个理由作为评论。不推荐的版本对我有用。只是提醒一下,不要使用头盔安装稳定/普罗米修斯使用头盔安装普罗米修斯社区/普罗米修斯,因为图表已经移动。非常感谢。你的回答帮助我学习EKS 1.14和helm3。