add repo

helm repo add stable http://mirror.azure.cn/kubernetes/chartshelm repo updatehelm repo list[root@vm2 ~]# helm repo listNAME                    URL                                                   stable                  http://mirror.azure.cn/kubernetes/charts              aliyun                  https://kubernetes.oss-cn-hangzhou.aliyuncs.com/chartsprometheus-community    https://prometheus-community.github.io/helm-charts    ingress-nginx           https://kubernetes.github.io/ingress-nginx            bitnami                 https://charts.bitnami.com/bitnami 

install grafana

helm install stable/grafana --generate-name -n monitorization.k8s.io/v1 RoleBindingNAME: grafana-xxxxxx8LAST DEPLOYED: Mon Jun 19 11:05:01 2023NAMESPACE: monitorSTATUS: deployedREVISION: 1NOTES:***********************DEPRECATED************************* The chart is deprecated. Future development has been moved to https://github.com/grafana/helm2-grafana1. Get your 'admin' user password by running:   kubectl get secret --namespace monitor grafana-16xxx8 -o jsonpath="{.data.admin-password}" | base64 --decode ; echo2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster:   grafana-1687143898.monitor.svc.cluster.local   Get the Grafana URL to visit by running these commands in the same shell:     export POD_NAME=$(kubectl get pods --namespace monitor -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana-xxxxxxxx8" -o jsonpath="{.items[0].metadata.name}")     kubectl --namespace monitor port-forward $POD_NAME 30003. 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.                            ######################################################################################

ingress yaml

cat grafana-server-ingress.yaml apiVersion: extensions/v1beta1kind: Ingressmetadata:  name: grafana-server  namespace: monitorspec:  rules:  - host: grafana.test.com    http:      paths:      - path: /        backend:          serviceName: grafana-1xxxxxx8          servicePort: 80

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

获取web页面 admin 明码

add Prometheus datasource

查看Prometheus的svc 名字