环境:

[root@master01 prometheus]# docker -v
Docker version 19.03.14, build 5eb3275d40
[root@master01 prometheus]# kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.9", GitCommit:"a17149e1a189050796ced469dbd78d380f2ed5ef", GitTreeState:"clean", BuildDate:"2020-04-16T11:44:51Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

docker是19.03.14
k8s是v1.16.9不同版本yaml文件可能有微调

下面上文件
config-map.yaml
grafana.yaml
prometheus.yaml
node-exporter.yaml
rbac-setup.yaml
直接应用上述文件,查看svc:

 [root@rke-master01 prometheus]# kubectl -n kube-system get svc
NAME             TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                  AGE
grafana          NodePort    172.21.15.98   <none>        3000:31000/TCP           6m8s
kube-dns         ClusterIP   172.21.0.10    <none>        53/UDP,53/TCP,9153/TCP   18d
metrics-server   ClusterIP   172.21.0.11    <none>        443/TCP                  18d
node-exporter    NodePort    172.21.9.202   <none>        9100:31672/TCP           6m8s
prometheus       NodePort    172.21.9.246   <none>        9090:30003/TCP           6m7s

查看pod

 [root@rke-master01 prometheus]# kubectl -n kube-system get pod
NAME                                      READY   STATUS      RESTARTS   AGE
coredns-89bcfc8d5-mxdd4                   1/1     Running     0          18d
coredns-89bcfc8d5-x4dv8                   1/1     Running     0          18d
coredns-autoscaler-976fbb6bf-2q456        1/1     Running     0          18d
grafana-core-5b8dbf444-v2xkq              1/1     Running     0          31m
kube-flannel-4nvgs                        2/2     Running     0          18d
kube-flannel-nbzjv                        2/2     Running     0          18d
kube-flannel-t5m5l                        2/2     Running     0          18d
metrics-server-8cdbf5cd7-bmp2q            1/1     Running     0          18d
node-exporter-26b7h                       1/1     Running     0          30m
node-exporter-99p6b                       1/1     Running     0          30m
node-exporter-p4flt                       1/1     Running     0          30m
prometheus-759d85775b-2589h               1/1     Running     0          34m

都是running就可以通过192.168.100.241:31000访问grafana了,默认账号密码都是admin
进去后如图添加数据库,再import-315就可以看到一些基础数据了。
添加数据库

标签: none

评论已关闭