Kubernetes 在库伯尼特斯上安装普罗米修斯的正确方法是什么?

Kubernetes 在库伯尼特斯上安装普罗米修斯的正确方法是什么?,kubernetes,grafana,prometheus,prometheus-operator,Kubernetes,Grafana,Prometheus,Prometheus Operator,我尝试在我的3节点kubernetes安装上安装Prometheus operator # kubectl cluster-info Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.3+coreos.0", GitCommit:"42de91f04e456f7625941a6c4aaedaa69708be1b", GitTreeState:"clean", BuildDate:"2017-08-07T19:4

我尝试在我的3节点kubernetes安装上安装Prometheus operator

# kubectl cluster-info
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.3+coreos.0", GitCommit:"42de91f04e456f7625941a6c4aaedaa69708be1b", GitTreeState:"clean", BuildDate:"2017-08-07T19:44:31Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.3+coreos.0", GitCommit:"42de91f04e456f7625941a6c4aaedaa69708be1b", GitTreeState:"clean", BuildDate:"2017-08-07T19:44:31Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

# kubectl get nodes

NAME          STATUS    AGE       VERSION
master-k8s    Ready     64d       v1.7.3+coreos.0
worker1-k8s   Ready     64d       v1.7.3+coreos.0
worker2-k8s   Ready     64d       v1.7.3+coreos.0

What i did is 

# git clone https://github.com/coreos/prometheus-operator
# cd cd prometheus-operator/

changed default namespace to monitoring at bundle.yaml

# kubectl apply -f bundle.yaml -n monitoring 
然后我做到了

# cd contrib/kube-prometheus
# hack/cluster-monitoring/deploy
当我查看Grafana接口时,我没有看到数据源,所以我应用了yaml文件

# kubectl apply -f manifests/grafana/ -n monitoring


# kubectl get all -n monitoring

AME                                      READY     STATUS    RESTARTS   AGE
po/alertmanager-main-0                    2/2       Running   0          8h
po/alertmanager-main-1                    2/2       Running   0          8h
po/alertmanager-main-2                    2/2       Running   0          8h
po/grafana-3524315691-86bv9               2/2       Running   49         8h
po/kube-state-metrics-1058475279-p9r7b    2/2       Running   0          8h
po/node-exporter-cpz70                    1/1       Running   0          8h
po/node-exporter-kt8nx                    1/1       Running   0          8h
po/node-exporter-zbj86                    1/1       Running   0          8h
po/prometheus-k8s-0                       2/2       Running   0          8h
po/prometheus-k8s-1                       2/2       Running   0          8h
po/prometheus-operator-2365681585-zpkpb   1/1       Running   0          8h

NAME                        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
svc/alertmanager-main       172.16.102.56    <nodes>       9093:30903/TCP      8h
svc/alertmanager-operated   None             <none>        9093/TCP,6783/TCP   8h
svc/grafana                 172.16.102.37    <nodes>       3000:30902/TCP      8h
svc/kube-state-metrics      172.16.102.174   <none>        8080/TCP            8h
svc/node-exporter           None             <none>        9100/TCP            8h
svc/prometheus-k8s          172.16.102.52    <nodes>       9090:30900/TCP      8h
svc/prometheus-operated     None             <none>        9090/TCP            8h
svc/prometheus-operator     172.16.102.207   <none>        8080/TCP            8h

NAME                             DESIRED   CURRENT   AGE
statefulsets/alertmanager-main   3         3         8h
statefulsets/prometheus-k8s      2         2         8h

NAME                         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/grafana               1         1         1            1           8h
deploy/kube-state-metrics    1         1         1            1           8h
deploy/prometheus-operator   1         1         1            1           8h

NAME                                DESIRED   CURRENT   READY     AGE
rs/grafana-3524315691               1         1         1         8h
rs/kube-state-metrics-1058475279    1         1         1         8h
rs/kube-state-metrics-3281504101    0         0         0         8h
rs/prometheus-operator-2365681585   1         1         1         8h
#kubectl应用-f清单/grafana/-n监控
#kubectl获得全n监控
AME就绪状态重新启动
po/alertmanager-main-0 2/2运行0 8小时
po/alertmanager-main-1 2/2运行0 8小时
po/alertmanager-main-2 2/2运行0 8小时
po/grafana-3524315691-86bv9 2/2运行49小时
po/kube-state-metrics-1058475279-p9r7b 2/2运行0 8小时
po/node-exporter-cpz70 1/1运行0 8小时
po/node-exporter-kt8nx 1/1运行0 8小时
po/node-exporter-zbj86 1/1运行0 8小时
po/prometheus-k8s-0 2/2运行0 8小时
po/prometheus-k8s-1 2/2运行0 8小时
po/prometheus-operator-2365681585-zpkpb 1/1运行0 8小时
名称CLUSTER-IP EXTERNAL-IP端口年龄
svc/alertmanager main 172.16.102.56 9093:30903/TCP 8h
svc/alertmanager无操作9093/TCP,6783/TCP 8小时
svc/grafana 172.16.102.37 3000:30902/TCP 8h
svc/kube州指标172.16.102.174 8080/TCP 8h
svc/node exporter None 9100/TCP 8h
svc/prometheus-k8s 172.16.102.52 9090:30900/TCP 8h
svc/prometheus无操作9090/TCP 8小时
svc/prometheus操作员172.16.102.207 8080/TCP 8h
姓名当前年龄
statefulsets/alertmanager main 3 8小时
statefulsets/prometheus-k8s 2 8h
名称所需的当前最新可用年龄
部署/grafana 1 8小时
部署/库贝州指标1 8小时
部署/普罗米修斯操作员1 8小时
名称所需的当前就绪年龄
rs/grafana-3524315691 8h
rs/kube-state-metrics-1058475279 18小时
rs/kube-state-metrics-3281504010 8h
rs/prometheus-operator-2365681585 18小时
这次可以看到prometheus数据源,但没有可用的仪表板


好像少了点什么。有什么想法吗?

Hi,你能应用下面的命令
kubectl get all-n monitoring
?问题。根据您的请求更新问题。Grafana继续重新启动。您是否也可以发布kubectl日志-p grafana-3524315691-86bv9的输出?这显示了上一次运行的日志。