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閮ㄧ讲閰嶇疆娴嬭瘯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
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鐧诲綍鎴愬姛,鍥剧ず瑙佷笅:
4.娣诲姞鏁版嵁婧?/em>
娣诲姞prometheus婧?/p>
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.
鍐峣mport,灏卞彲浠ョ湅鍒板浘褰㈢晫闈簡
5.閫変竴涓嚜宸卞枩娆㈢殑鎯崇敤鐨勪釜鎬у弬鏁版洿澶氱殑鐣岄潰
鍘籫rafana缃戠珯涓嬭浇妯℃澘json鏂囦欢瀵煎叆鍗冲彲.
以上是关于k8s瀹炶返18:helm閮ㄧ讲瀹夎grafana閰嶇疆娴嬭瘯的主要内容,如果未能解决你的问题,请参考以下文章