请稍等 ...
×

采纳答案成功!

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

pod/prometheus-k7-prom-prometheus-operato-prometheus-0 一直在创建状态

老师好, 请教下我使用的慕课仓库提供的文件, 执行 helm install 命令, pod/prometheus-k7-prom-prometheus-operato-prometheus-0 这个pod一直处于 ContainerCreating 状态, 请老师帮忙看下,谢谢

[root@kaiqi-server-1085 ~]# kubectl get all -n monitoring 
NAME                                                         READY   STATUS              RESTARTS   AGE
pod/alertmanager-k7-prom-prometheus-operato-alertmanager-0   1/2     CrashLoopBackOff    263        22h
pod/k7-prom-grafana-75f84bf599-tqzxr                         2/2     Running             0          22h
pod/k7-prom-kube-state-metrics-779db49ddf-f2ccn              1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-27m9x                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-5bfmg                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-bnlsr                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-cvpk6                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-ddmvd                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-sqpgm                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-tt9xb                   1/1     Running             0          22h
pod/k7-prom-prometheus-node-exporter-z82kh                   1/1     Running             0          22h
pod/k7-prom-prometheus-operato-operator-d598bc59-65qdl       1/1     Running             0          69m
pod/prometheus-k7-prom-prometheus-operato-prometheus-0       0/3     ContainerCreating   0          68m

NAME                                              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
service/alertmanager-operated                     ClusterIP   None             <none>        9093/TCP,6783/TCP   22h
service/k7-prom-grafana                           ClusterIP   10.254.37.104    <none>        80/TCP              22h
service/k7-prom-kube-state-metrics                ClusterIP   10.254.11.155    <none>        8080/TCP            22h
service/k7-prom-prometheus-node-exporter          ClusterIP   10.254.0.61      <none>        9100/TCP            22h
service/k7-prom-prometheus-operato-alertmanager   ClusterIP   10.254.112.208   <none>        9093/TCP            22h
service/k7-prom-prometheus-operato-operator       ClusterIP   10.254.139.250   <none>        8080/TCP            22h
service/k7-prom-prometheus-operato-prometheus     ClusterIP   10.254.211.138   <none>        9090/TCP            22h
service/prometheus-operated                       ClusterIP   None             <none>        9090/TCP            22h

NAME                                              DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/k7-prom-prometheus-node-exporter   8         8         8       8            8           <none>          22h

NAME                                                  READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/k7-prom-grafana                       1/1     1            1           22h
deployment.apps/k7-prom-kube-state-metrics            1/1     1            1           22h
deployment.apps/k7-prom-prometheus-operato-operator   1/1     1            1           22h

NAME                                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/k7-prom-grafana-75f84bf599                       1         1         1       22h
replicaset.apps/k7-prom-kube-state-metrics-779db49ddf            1         1         1       22h
replicaset.apps/k7-prom-prometheus-operato-operator-589dc749cf   0         0         0       6h7m
replicaset.apps/k7-prom-prometheus-operato-operator-cbc66ffbf    0         0         0       22h
replicaset.apps/k7-prom-prometheus-operato-operator-d598bc59     1         1         1       69m

NAME                                                                    READY   AGE
statefulset.apps/alertmanager-k7-prom-prometheus-operato-alertmanager   0/1     22h
statefulset.apps/prometheus-k7-prom-prometheus-operato-prometheus       0/1     22h

[root@kaiqi-server-1085 ~]# kubectl describe pod/prometheus-k7-prom-prometheus-operato-prometheus-0 -n monitoring 
Name:               prometheus-k7-prom-prometheus-operato-prometheus-0
Namespace:          monitoring
Priority:           0
PriorityClassName:  <none>
Node:               kaiqi-server-1094/172.16.1.171
Start Time:         Fri, 18 Sep 2020 16:40:10 +0800
Labels:             app=prometheus
                    controller-revision-hash=prometheus-k7-prom-prometheus-operato-prometheus-6658f9fc9d
                    prometheus=k7-prom-prometheus-operato-prometheus
                    statefulset.kubernetes.io/pod-name=prometheus-k7-prom-prometheus-operato-prometheus-0
Annotations:        <none>
Status:             Pending
IP:                 
Controlled By:      StatefulSet/prometheus-k7-prom-prometheus-operato-prometheus
Containers:
  prometheus:
    Container ID:  
    Image:         hub.k7.cn/base-image/prometheus:v2.9.1
    Image ID:      
    Port:          9090/TCP
    Host Port:     0/TCP
    Args:
      --web.console.templates=/etc/prometheus/consoles
      --web.console.libraries=/etc/prometheus/console_libraries
      --config.file=/etc/prometheus/config_out/prometheus.env.yaml
      --storage.tsdb.path=/prometheus
      --storage.tsdb.retention=10d
      --web.enable-lifecycle
      --storage.tsdb.no-lockfile
      --web.external-url=http://k7-prom-prometheus-operato-prometheus.monitoring:9090
      --web.route-prefix=/
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Liveness:       http-get http://:web/-/healthy delay=0s timeout=3s period=5s #success=1 #failure=6
    Readiness:      http-get http://:web/-/ready delay=0s timeout=3s period=5s #success=1 #failure=120
    Environment:    <none>
    Mounts:
      /etc/prometheus/config_out from config-out (ro)
      /etc/prometheus/rules/prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0 from prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0 (rw)
      /etc/prometheus/secrets/etcd-certs from secret-etcd-certs (ro)
      /prometheus from prometheus-k7-prom-prometheus-operato-prometheus-db (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from k7-prom-prometheus-operato-prometheus-token-nc5sk (ro)
  prometheus-config-reloader:
    Container ID:  
    Image:         hub.k7.cn/base-image/prometheus-config-reloader:v0.29.0
    Image ID:      
    Port:          <none>
    Host Port:     <none>
    Command:
      /bin/prometheus-config-reloader
    Args:
      --log-format=logfmt
      --reload-url=http://127.0.0.1:9090/-/reload
      --config-file=/etc/prometheus/config/prometheus.yaml.gz
      --config-envsubst-file=/etc/prometheus/config_out/prometheus.env.yaml
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Limits:
      cpu:     50m
      memory:  50Mi
    Requests:
      cpu:     50m
      memory:  50Mi
    Environment:
      POD_NAME:  prometheus-k7-prom-prometheus-operato-prometheus-0 (v1:metadata.name)
    Mounts:
      /etc/prometheus/config from config (rw)
      /etc/prometheus/config_out from config-out (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from k7-prom-prometheus-operato-prometheus-token-nc5sk (ro)
  rules-configmap-reloader:
    Container ID:  
    Image:         hub.k7.cn/base-image/configmap-reload:v0.0.1
    Image ID:      
    Port:          <none>
    Host Port:     <none>
    Args:
      --webhook-url=http://127.0.0.1:9090/-/reload
      --volume-dir=/etc/prometheus/rules/prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Limits:
      cpu:     100m
      memory:  25Mi
    Requests:
      cpu:        100m
      memory:     25Mi
    Environment:  <none>
    Mounts:
      /etc/prometheus/rules/prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0 from prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0 (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from k7-prom-prometheus-operato-prometheus-token-nc5sk (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  config:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  prometheus-k7-prom-prometheus-operato-prometheus
    Optional:    false
  config-out:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0
    Optional:  false
  secret-etcd-certs:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  etcd-certs
    Optional:    false
  prometheus-k7-prom-prometheus-operato-prometheus-db:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  k7-prom-prometheus-operato-prometheus-token-nc5sk:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  k7-prom-prometheus-operato-prometheus-token-nc5sk
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason       Age                   From                        Message
  ----     ------       ----                  ----                        -------
  Warning  FailedMount  6m57s (x40 over 72m)  kubelet, kaiqi-server-1094  MountVolume.SetUp failed for volume "secret-etcd-certs" : secret "etcd-certs" not found
  Warning  FailedMount  116s (x31 over 70m)   kubelet, kaiqi-server-1094  Unable to mount volumes for pod "prometheus-k7-prom-prometheus-operato-prometheus-0_monitoring(903beda5-f98a-11ea-90f6-005056b4969e)": timeout expired waiting for volumes to attach or mount for pod "monitoring"/"prometheus-k7-prom-prometheus-operato-prometheus-0". list of unmounted volumes=[secret-etcd-certs]. list of unattached volumes=[config config-out prometheus-k7-prom-prometheus-operato-prometheus-rulefiles-0 secret-etcd-certs prometheus-k7-prom-prometheus-operato-prometheus-db k7-prom-prometheus-operato-prometheus-token-nc5sk]
[root@kaiqi-server-1085 ~]#

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

1回答

刘果国 2020-09-19 09:28:10

这个错误关注一下: Warning  FailedMount  6m57s (x40 over 72m)  kubelet, kaiqi-server-1094  MountVolume.SetUp failed for volume "secret-etcd-certs" : secret "etcd-certs" not found

手动查看一下是否存在这个secret,没有话得查查原因了,在values配置文件中有这么一段:

    ## Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods.

    ## The Secrets are mounted into /etc/prometheus/secrets/. Secrets changes after initial creation of a Prometheus object are not

    ## reflected in the running Pods. To change the secrets mounted into the Prometheus Pods, the object must be deleted and recreated

    ## with the new list of secrets.

    ##

    secrets:

    - etcd-certs

0 回复 有任何疑惑可以回复我~
  • 提问者 冷眼旁观的VIP #1
    老师, 不好意思又来打扰了, 我检查了配置文件, 确实有
    ```
        ## Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods.
        ## The Secrets are mounted into /etc/prometheus/secrets/. Secrets changes after initial creation of a Prometheus object are not
        ## reflected in the running Pods. To change the secrets mounted into the Prometheus Pods, the object must be deleted and recreated
        ## with the new list of secrets.
        ##
        secrets:
    
        - etcd-certs
    ```
    这一段, 但是 kubectl get secret -n monitoring 没有发现 etcd-certs   , 请问这个 etcd-certs 是在执行 helm install 命令的时候自动创建的吗? 现在该怎么手动创建这个 etcd-certs 呢?
    回复 有任何疑惑可以回复我~ 2020-10-21 16:34:39
  • 提问者 冷眼旁观的VIP #2
    我根据老师在问答区提供的资料解决了, 感谢果果老师
    回复 有任何疑惑可以回复我~ 2020-10-21 18:38:39
  • 祁云逸 回复 提问者 冷眼旁观的VIP #3
    给我解决一下呀 贴出来呀
    回复 有任何疑惑可以回复我~ 2020-10-22 22:46:34
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信