使用Grafana实现监控指标可视化、AlertManager介绍和安装、配置Prometheus告警规则、AlertManager配置邮件告警和AlertManager配置企业微信告警

一、使用Grafana实现监控指标可视化

1.用helm安装grafana

helm pull bitnami/grafana --untar

修改values.yaml

vi grafana/values.yaml ##定义storageClass
storageClass: "nfs-client" #两个

[root@aminglinux01 grafana]# cat values.yaml | grep storageClass:
  storageClass: "nfs-client"
  storageClass: "nfs-client"
[root@aminglinux01 grafana]# 

安装

cd grafana
helm install grafana .

[root@aminglinux01 grafana]# helm install grafana .
NAME: grafana
LAST DEPLOYED: Tue Aug  6 03:33:06 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: grafana
CHART VERSION: 11.3.13
APP VERSION: 11.1.3

** Please be patient while the chart is being deployed **

1. Get the application URL by running these commands:
    echo "Browse to http://127.0.0.1:8080"
    kubectl port-forward svc/grafana 8080:3000 &

2. Get the admin credentials:

    echo "User: admin"
    echo "Password: $(kubectl get secret grafana-admin --namespace default -o jsonpath="{.data.GF_SECURITY_ADMIN_PASSWORD}" | base64 -d)"
# Note: Do not include grafana.validateValues.database here. See https://github.com/bitnami/charts/issues/20629


WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
  - grafana.resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

⚠ SECURITY WARNING: Original containers have been substituted. This Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Tanzu Application Catalog containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables.

Substituted images detected:
  - registry.cn-hangzhou.aliyuncs.com/*/grafana:11.1.3-debian-12-r0
  - registry.cn-hangzhou.aliyuncs.com/*/os-shell:12-debian-12-r27

显示:

1. Get the application URL by running these commands:
    echo "Browse to http://127.0.0.1:8080"
    kubectl port-forward svc/grafana 8080:3000 &

2. Get the admin credentials:

    echo "User: admin"
    echo "Password: $(kubectl get secret grafana-admin --namespace default -o jsonpath="{.data.GF_SECURITY_ADMIN_PASSWORD}" | base64 -d)"

做端口映射

[root@aminglinux01 grafana]# kubectl get pod -owide| grep grafana
grafana-57bb68b4b5-4rwhj                    1/1     Running            0              11m     10.18.206.201     aminglinux02   <none>           <none>
[root@aminglinux01 grafana]# kubectl get svc | grep grafana
grafana                      ClusterIP      10.15.242.254   <none&g

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值