当前位置: 首页 > 知识库问答 >
问题:

无法在k8s 1.15中安装kube-prometheus-stack

尹雅健
2023-03-14

如何在Kubernetes吊舱重启上设置钩子发送电子邮件?

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

https://github.com/prometheus-community/helm-charts/tree/main/charts/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"

https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#helm-fails-to-create-crds

但只有在运行Helm2.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"
...
$ 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...
$ 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版本上安装东西时要走的路,尽管兼容性矩阵可能很好。

共有1个答案

刘辰钊
2023-03-14

基于库贝-普罗米修斯-堆栈回购,此掌舵人图仅限于K8s 1.16.0或以上版本;

Kubeversion:“>=1.16.0-0”

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

 类似资料:
  • kube-prometheus Note that everything is experimental and may change significantly at any time. This repository collects Kubernetes manifests, Grafana dashboards, and Prometheus rules combined with doc

  • 如果还没有初始货持久化存储,先初始化持久化存储的,请在这里install/storage.html配置好存储类再安装相关服务服务。 Prometheus 需要将数据存在本地,所以需要挂载持久化存储。 $ kubectl apply -f install/kubernetes/prometheus/deployment.yaml $ kubectl apply -f install/kubernet

  • 在我们安装Kubernetes集群的时候就已经安装了kube-dns插件,这个插件也是官方推荐安装的。通过将 Service 注册到 DNS 中,Kuberentes 可以为我们提供一种简单的服务注册发现与负载均衡方式。 CoreDNS作为CNCF中的托管的一个项目,在Kuberentes1.9版本中,使用kubeadm方式安装的集群可以通过以下命令直接安装CoreDNS。 kubeadm ini

  • 前面的课程中我们学习了用自定义的方式来对 Kubernetes 集群进行监控,但是还是有一些缺陷,比如 Prometheus、AlertManager 这些组件服务本身的高可用,当然我们也完全可以用自定义的方式来实现这些需求,我们也知道 Promethues 在代码上就已经对 Kubernetes 有了原生的支持,可以通过服务发现的形式来自动监控集群,因此我们可以使用另外一种更加高级的方式来部署

  • 从今天开始我们就和大家一起来学习 Kubernetes 中监控系统的搭建,我们知道监控是保证系统运行必不可少的功能,特别是对于 Kubernetes 这种比较庞大的系统来说,监控报警更是不可或缺,我们需要时刻了解系统的各种运行指标,也需要时刻了解我们的 Pod 的各种指标,更需要在出现问题的时候有报警信息通知到我们。 在早期的版本中 Kubernetes 提供了 heapster、influxDB

  • 参考堆栈溢出链接中已经发布的问题,我只是跟进了离子的基本安装过程,但突然之间出现了这个奇怪的错误。 安装过程中捕获的错误屏幕截图 在安装过程中,我尝试了以下步骤 已安装的节点。js最新版本7.2。1伏-已成功安装 npm安装-g cordova-已成功安装 npm安装-gionic@1.7-失败 附加捕获以供参考的日志。npm调试。日志