k8s瀹炶返18:helm閮ㄧ讲瀹夎grafana閰嶇疆娴嬭瘯

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s瀹炶返18:helm閮ㄧ讲瀹夎grafana閰嶇疆娴嬭瘯相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/sam' title='sam'>sam   鏂囦欢   visit   one   docke   nod   boa   鐧诲綍瀵嗙爜   rev   

grafana閮ㄧ讲閰嶇疆娴嬭瘯

grafana瀹樼綉鍦板潃

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 鈥榓dmin鈥?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 鈥榓dmin鈥?user password by running:

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

鏈嶅姟璧锋潵浜?/p>

[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鏂囦欢,璇诲彇鎵ц,鐒跺悗鍋歨ost瑙f瀽鍗冲彲閫氳繃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

鎶€鏈浘鐗? src=

3.鐧诲綍

鐪嬪墠闈㈢1閮ㄧ殑娉ㄦ剰,鐧诲綍瀵嗙爜閫氳繃閭d釜鎻愮ず鏉ヨ幏鍙?

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

鐢ㄦ埛鍚嶆槸:admin
瀵嗙爜鏄?sLJq2G4tBSiJcEHSobRoRiDRbCNXxT5qASQJkzF6

鐧诲綍鎴愬姛,鍥剧ず瑙佷笅:

鎶€鏈浘鐗? src=

4.娣诲姞鏁版嵁婧?/em>

娣诲姞prometheus婧?/p>

鎶€鏈浘鐗? src=

http url鏄痯rometheus service鐨勫湴鍧€

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

淇濆瓨閰嶇疆.鍐嶇偣鍑籨ashboard.

鎶€鏈浘鐗? src=

鍐峣mport,灏卞彲浠ョ湅鍒板浘褰㈢晫闈簡

鎶€鏈浘鐗? src=

5.閫変竴涓嚜宸卞枩娆㈢殑鎯崇敤鐨勪釜鎬у弬鏁版洿澶氱殑鐣岄潰

鍘籫rafana缃戠珯涓嬭浇妯℃澘json鏂囦欢瀵煎叆鍗冲彲.

鐩戞帶鑺傜偣妯℃澘

鎶€鏈浘鐗? src=

鐩戞帶pod瀹瑰櫒妯℃澘1

鎶€鏈浘鐗? src=

鎶€鏈浘鐗? src=

以上是关于k8s瀹炶返18:helm閮ㄧ讲瀹夎grafana閰嶇疆娴嬭瘯的主要内容,如果未能解决你的问题,请参考以下文章

锛?锛塸rometheus瀹夎閮ㄧ讲

Linux涔媋nt瀹夎閮ㄧ讲

Mybatis 浠g爜瀹炶返

sentry浣跨敤瀹炶返

娲炲療婕忔礊绠$悊骞冲彴瀹炶返

Springboot 鎵撳寘閮ㄧ讲