使用Helm安装Prometheus时出现永久性卷错误

时间:2018-06-20 15:09:47

标签: kubernetes prometheus kubernetes-helm amazon-eks

我正在尝试使用位于https://github.com/kubernetes/charts/tree/master/stable/prometheus的默认prometheus掌舵图将Prometheus安装到我的EKS集群中。它已成功部署,但是在Kubernetes仪表板中,AlertManager和Server部署显示:

  

pod具有未绑定的PersistentVolumeClaims(重复了3次)

我尝试修补values.yaml文件无济于事。

我知道这没什么大不了的,但是我真的不确定在日志记录方面还能找到什么。

这是运行helm install stable/prometheus --name prometheus --namespace prometheus

的输出
root@fd9c3cc3f356:~/charts# helm install stable/prometheus --name prometheus --namespace prometheus
NAME:   prometheus
LAST DEPLOYED: Wed Jun 20 14:55:41 2018
NAMESPACE: prometheus
STATUS: DEPLOYED

RESOURCES:
==> v1beta1/ClusterRole
NAME                           AGE
prometheus-kube-state-metrics  1s
prometheus-server              1s

==> v1/ServiceAccount
NAME                           SECRETS  AGE
prometheus-alertmanager        1        1s
prometheus-kube-state-metrics  1        1s
prometheus-node-exporter       1        1s
prometheus-pushgateway         1        1s
prometheus-server              1        1s

==> v1/PersistentVolumeClaim
NAME                     STATUS   VOLUME  CAPACITY  ACCESS MODES  STORAGECLASS  AGE
prometheus-alertmanager  Pending  1s
prometheus-server        Pending  1s

==> v1beta1/ClusterRoleBinding
NAME                           AGE
prometheus-kube-state-metrics  1s
prometheus-server              1s

==> v1/Service
NAME                           TYPE       CLUSTER-IP      EXTERNAL-IP  PORT(S)   AGE
prometheus-alertmanager        ClusterIP  10.100.3.32     <none>       80/TCP    1s
prometheus-kube-state-metrics  ClusterIP  None            <none>       80/TCP    1s
prometheus-node-exporter       ClusterIP  None            <none>       9100/TCP  1s
prometheus-pushgateway         ClusterIP  10.100.243.103  <none>       9091/TCP  1s
prometheus-server              ClusterIP  10.100.144.15   <none>       80/TCP    1s

==> v1beta1/DaemonSet
NAME                      DESIRED  CURRENT  READY  UP-TO-DATE  AVAILABLE  NODE SELECTOR  AGE
prometheus-node-exporter  3        3        2      3           2          <none>         1s

==> v1beta1/Deployment
NAME                           DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
prometheus-alertmanager        1        1        1           0          1s
prometheus-kube-state-metrics  1        1        1           0          1s
prometheus-pushgateway         1        1        1           0          1s
prometheus-server              1        1        1           0          1s

==> v1/Pod(related)
NAME                                            READY  STATUS             RESTARTS  AGE
prometheus-node-exporter-dklx8                  0/1    ContainerCreating  0         1s
prometheus-node-exporter-hphmn                  1/1    Running            0         1s
prometheus-node-exporter-zxcnn                  1/1    Running            0         1s
prometheus-alertmanager-6df98765f4-l9vq2        0/2    Pending            0         1s
prometheus-kube-state-metrics-6584885ccf-8md7c  0/1    ContainerCreating  0         1s
prometheus-pushgateway-5495f55cdf-brxvr         0/1    ContainerCreating  0         1s
prometheus-server-5959898967-fdztb              0/2    Pending            0         1s

==> v1/ConfigMap
NAME                     DATA  AGE
prometheus-alertmanager  1     1s
prometheus-server        3     1s


NOTES:
The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster:
prometheus-server.prometheus.svc.cluster.local


Get the Prometheus server URL by running these commands in the same shell:
  export POD_NAME=$(kubectl get pods --namespace prometheus -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace prometheus port-forward $POD_NAME 9090


The Prometheus alertmanager can be accessed via port 80 on the following DNS name from within your cluster:
prometheus-alertmanager.prometheus.svc.cluster.local


Get the Alertmanager URL by running these commands in the same shell:
  export POD_NAME=$(kubectl get pods --namespace prometheus -l "app=prometheus,component=alertmanager" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace prometheus port-forward $POD_NAME 9093


The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster:
prometheus-pushgateway.prometheus.svc.cluster.local


Get the PushGateway URL by running these commands in the same shell:
  export POD_NAME=$(kubectl get pods --namespace prometheus -l "app=prometheus,component=pushgateway" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace prometheus port-forward $POD_NAME 9091

For more information on running Prometheus, visit:
https://prometheus.io/

1 个答案:

答案 0 :(得分:3)

结果是,未在启用任何持久性存储的情况下创建EKS集群:

  

Amazon EKS集群未使用任何存储类创建。你必须   定义要用于群集的存储类,并且应该定义一个   持久卷声明的默认存储类。

This guide解释了如何为EKS添加kubernetes StorageClass

按照说明添加StorageClass,使用helm delete prometheus --purge删除我的Prometheus部署并重新创建部署之后,我的所有Pod现在都可以正常使用。