请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

helm install prometheus-operator

[root@192-168-31-249-master1 ~]# helm install --name imooc-prom --set rbacEnable=true --namespace=monitoring ./prometheus-operator
Error: validation failed: [unable to recognize “”: no matches for kind “Alertmanager” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “Prometheus” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “PrometheusRule” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”, unable to recognize “”: no matches for kind “ServiceMonitor” in version “monitoring.coreos.com/v1”]

正在回答 回答被采纳积分+3

3回答

提问者 pkarqi001 2020-03-17 00:37:00

null

0 回复 有任何疑惑可以回复我~
提问者 pkarqi001 2020-03-13 00:45:14

helm 版本升级到2.14.3 报错如下

[root@192-168-31-249-master1 ~]# kubectl get pods -n monitoring | grep -v Running

NAME                                                     READY   STATUS              RESTARTS   AGE

alertmanager-imooc-prom-prometheus-oper-alertmanager-0   1/2     CrashLoopBackOff    11         33m

prometheus-imooc-prom-prometheus-oper-prometheus-0       0/3     ContainerCreating   0          114s

报错

1、

Type     Reason       Age                  From                           Message

  ----     ------       ----                 ----                           -------

  Warning  FailedMount  33s                  kubelet, 192-168-31-216-node1  Unable to mount volumes for pod "prometheus-imooc-prom-prometheus-oper-prometheus-0_monitoring(451f3d91-647f-11ea-a8f0-000c29da459b)": timeout expired waiting for volumes to attach or mount for pod "monitoring"/"prometheus-imooc-prom-prometheus-oper-prometheus-0". list of unmounted volumes=[secret-etcd-certs]. list of unattached volumes=[config config-out prometheus-imooc-prom-prometheus-oper-prometheus-rulefiles-0 secret-etcd-certs prometheus-imooc-prom-prometheus-oper-prometheus-db imooc-prom-prometheus-oper-prometheus-token-g62sq]

  Warning  FailedMount  28s (x9 over 2m36s)  kubelet, 192-168-31-216-node1  MountVolume.SetUp failed for volume "secret-etcd-certs" : secret "etcd-certs" not found

  Normal   Scheduled    <invalid>            default-scheduler              Successfully assigned monitoring/prometheus-imooc-prom-prometheus-oper-prometheus-0 to 192-168-31-216-node1

[root@192-168-31-249-master1 ~]# kubectl describe pod prometheus-imooc-prom-prometheus-oper-prometheus-0  -n monitoring 

报错2:

Events:

  Type     Reason     Age                  From                          Message

  ----     ------     ----                 ----                          -------

  Normal   Pulled     35m                  kubelet, 192-168-31-37-node2  Container image "quay.io/coreos/configmap-reload:v0.0.1" already present on machine

  Normal   Created    35m                  kubelet, 192-168-31-37-node2  Created container config-reloader

  Normal   Started    35m                  kubelet, 192-168-31-37-node2  Started container config-reloader

  Normal   Created    34m (x4 over 35m)    kubelet, 192-168-31-37-node2  Created container alertmanager

  Normal   Started    34m (x4 over 35m)    kubelet, 192-168-31-37-node2  Started container alertmanager

  Normal   Pulled     33m (x5 over 35m)    kubelet, 192-168-31-37-node2  Container image "quay.io/prometheus/alertmanager:v0.16.2" already present on machine

  Warning  BackOff    27s (x168 over 35m)  kubelet, 192-168-31-37-node2  Back-off restarting failed container

  Normal   Scheduled  <invalid>            default-scheduler             Successfully assigned monitoring/alertmanager-imooc-prom-prometheus-oper-alertmanager-0 to 192-168-31-37-node2

不知道是不是这个原因

https://blog.csdn.net/u011933777/article/details/102722700

etc/kubernetes/pki/etcd/server.crt 找不到这个文件啥时候生成的?(server.crt )


0 回复 有任何疑惑可以回复我~
  • https://git.imooc.com/coding-335/deep-in-kubernetes/src/master/12-monitoring/prometheus-operator/values.yaml 注意这个文件有我环境相关的ip(10.155开头的)是否没有换成自己的?
    回复 有任何疑惑可以回复我~ 2020-03-13 09:19:39
  • 提问者 pkarqi001 回复 刘果国 #2
    - 10.155.20.50(从视频上看这个是master ip)
    疑惑1:我这边是 高可用集群环境 ,那么这个地方应该写 master ip 还是 vip(endpoints:- 10.155.20.50)
     疑惑2:这些文件就是在搭建集群的时候生成的配置文件吧不是另外生成的?
      caFile: "/etc/prometheus/secrets/etcd-certs/ca.pem"
        certFile: "/etc/prometheus/secrets/etcd-certs/etcd.pem"
        keyFile: "/etc/prometheus/secrets/etcd-certs/etcd-key.pem"
    回复 有任何疑惑可以回复我~ 2020-03-13 11:06:10
  • 刘果国 回复 提问者 pkarqi001 #3
    1. 用了vip就写vip,没用的话写任意一个master的ip
    2. 这些文件不要care,是自动生成的。(不是我们事先生成的)
    回复 有任何疑惑可以回复我~ 2020-03-14 11:45:11
刘果国 2020-03-10 09:26:28

你好,建议使用git.imooc.com上的文件重新来一次,地址如下:https://git.imooc.com/coding-335/deep-in-kubernetes/src/master/12-monitoring

0 回复 有任何疑惑可以回复我~
  • 提问者 pkarqi001 #1
    好的 。。晚上回去试下
    回复 有任何疑惑可以回复我~ 2020-03-10 11:29:13
  • 提问者 pkarqi001 #2
    [root@192-168-31-249-master1 ~]# helm install --name imooc-prom --set rbacEnable=true --namespace=monitoring ./prometheus-operator
    
    helm install --debug --name imooc-prom  --namespace=monitoring  -f ./prometheus-operator/values.yaml
    kind不对? 或者version不对?
    Error: validation failed: [unable to recognize "": no matches for kind "Alertmanager" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "PrometheusRule" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"]
    回复 有任何疑惑可以回复我~ 2020-03-10 23:44:09
  • 刘果国 回复 提问者 pkarqi001 #3
    crd没找到,这样,手动创建一下crd试试吧
    回复 有任何疑惑可以回复我~ 2020-03-11 09:03:38
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信