溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

grafana的安裝部署

發布時間:2020-06-17 16:49:46 來源:億速云 閱讀:530 作者:元一 欄目:系統運維

Grafana 是一款漂亮的數據展示工具,是純 Javascript 開發的前端工具,它可以將后端多種數據庫中的數據展示為折線圖、柱狀圖、餅圖、表盤等多種圖形。

1.helm部署grafana
[root@k8s-node1 prometheus-grafana]# helm install stable/grafana --generate-name
NAME: grafana-1577432108
LAST DEPLOYED: Fri Dec 27 15:35:11 2019
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get your 'admin' user password by running:

   kubectl get secret --namespace default grafana-1577432108 -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster:

   grafana-1577432108.default.svc.cluster.local

   Get the Grafana URL to visit by running these commands in the same shell:

     export POD_NAME=$(kubectl get pods --namespace default -l "app=grafana,release=grafana-1577432108" -o jsonpath="{.items[0].metadata.name}")
     kubectl --namespace default port-forward $POD_NAME 3000

3. Login with the password from step 1 and the username: admin
#################################################################################
######   WARNING: Persistence is disabled!!! You will lose your data when   #####
######            the Grafana pod is terminated.                            #####
#################################################################################

注意這條:

1. Get your 'admin' user password by running:

   kubectl get secret --namespace default grafana-1577432108 -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

服務起來了

[root@k8s-node1 ~]# kubectl get svc,pod |grep grafana

service/grafana-1577432108                         ClusterIP   10.254.172.86    <none>        80/TCP          132m
pod/grafana-1577432108-65b987fdc6-dlhpb                         1/1     Running   1          132m

2.配置web訪問

配置Ingress文件,讀取執行,然后做host解析即可通過grafana-server訪問web.

[root@k8s-node1 prometheus-grafana]# cat grafana-server-ingress.yaml 
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: grafana-server
  namespace: default
spec:
  rules:
  - host: grafana-server
    http:
      paths:
      - path: /
        backend:
          serviceName: grafana-1577432108
          servicePort: 80

grafana的安裝部署

3.登錄

看前面第1部的注意,登錄密碼通過那個提示來獲取.

[root@k8s-node1 prometheus-grafana]# kubectl get secret --namespace default grafana-1577432108 -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
sLJq2G4tBSiJcEHSobRoRiDRbCNXxT5qASQJkzF6

用戶名是:admin
密碼是:sLJq2G4tBSiJcEHSobRoRiDRbCNXxT5qASQJkzF6

登錄成功,圖示見下:

grafana的安裝部署

4.添加數據源

添加prometheus源

grafana的安裝部署

http url是prometheus service的地址

[root@k8s-node1 prometheus-grafana]# kubectl get svc |grep server
prometheus-1577263826-server               ClusterIP   10.254.132.104   <none>        80/TCP          47h

保存配置.再點擊dashboard.

grafana的安裝部署

再import,就可以看到圖形界面了

grafana的安裝部署

5.選一個自己喜歡的想用的個性參數更多的界面

去grafana網站下載模板json文件導入即可.

監控節點模板

grafana的安裝部署

監控pod容器模板1

grafana的安裝部署

grafana的安裝部署

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女