• 【解决】 使用Grafana查看k8s集群监控情况,提示插件未发现和没有数据


    问题一:使用Grafana查看k8s集群监控情况,提示插件未发现

    解决:明显缺少插件,使用grafana-cli命令进行安装即可

    root@ymt-130 k8s_installer]# kubectl -n monitoring get pod
    NAME                                   READY   STATUS    RESTARTS   AGE
    alertmanager-main-0                    2/2     Running   0          7d1h
    alertmanager-main-1                    2/2     Running   0          7d1h
    alertmanager-main-2                    2/2     Running   0          7d1h
    appalertservice-58db89d477-tskd4       1/1     Running   0          7d
    grafana-7f94944d5f-g2kdx               1/1     Running   0          2d
    kube-state-metrics-6f56c8b966-h5gnd    3/3     Running   0          7d1h
    node-exporter-5xwhv                    2/2     Running   0          7d1h
    node-exporter-8qmd9                    2/2     Running   0          7d1h
    node-exporter-9cj9x                    2/2     Running   0          7d1h
    node-exporter-dlkt7                    2/2     Running   0          7d1h
    node-exporter-jbdb9                    2/2     Running   0          7d1h
    node-exporter-kn69k                    2/2     Running   0          7d1h
    prometheus-adapter-7bc75f6dc7-2r9rj    1/1     Running   0          7d1h
    prometheus-adapter-7bc75f6dc7-nnntv    1/1     Running   0          7d1h
    prometheus-adapter-7bc75f6dc7-rkgtn    1/1     Running   0          7d1h
    prometheus-k8s-0                       3/3     Running   1          7d1h
    prometheus-k8s-1                       3/3     Running   1          7d1h
    prometheus-operator-5bd99d6457-dlx4k   1/1     Running   0          7d1h
    [root@ymt-130 k8s_installer]#
    [root@ymt-130 k8s_installer]# kubectl -n monitoring exec -it grafana-7f94944d5f-g2kdx /usr/share/grafana/bin/grafana-cli plugins install grafana-piechart-panel
    installing grafana-piechart-panel @ 1.6.0
    from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.0/download
    into: /var/lib/grafana/plugins
    
    ✔ Installed grafana-piechart-panel successfully
    
    Restart grafana after installing plugins . <service grafana-server restart>
    
    [root@ymt-130 k8s_installer]# kubectl -n monitoring delete pod grafana-7f94944d5f-g2kdx
    pod "grafana-7f94944d5f-g2kdx" deleted

    注意: 这里是容器化部署方式,grafana必须做持久化存储才可以,否则无法保存安装数据。

     


    问题二:使用Grafana查看k8s集群监控情况,提示没有数据,或者数据显示错误

    解决:这是监控指标配置错误导致,选择对应监控->edit,修改相关监控项即可。

    指标变化:

    io_kubernetes_container_name  ->  pod

    node_memory_MemTotal  ->  node_memory_MemTotal_bytes

    node_memory_MemFree  ->  node_memory_MemFree_bytes

    node_memory_Buffers  ->  node_memory_Buffers_bytes

    node_memory_Cached  ->  node_memory_Cached_bytes

    node_filesystem_size  ->  node_filesystem_free_bytes

    node_filesystem_free  ->  node_filesystem_free_bytes

    node_cpu      ->   machine_cpu_cores

    基础指标变化:

    pod_name      ->   pod

    container_name    ->  container

  • 相关阅读:
    Spring Boot 返回 XML 数据,一分钟搞定!
    Spring Cloud Alibaba Sentinel 整合 Feign 的设计实现
    周末去面试,进去 5 分钟就出来了…
    Spring Boot 返回 JSON 数据,一分钟搞定!
    Java 11 已发布,String 还能这样玩!
    Hashtable 为什么不叫 HashTable?
    Java 中初始化 List 集合的 6 种方式!
    HashMap 和 Hashtable 的 6 个区别,最后一个没几个人知道!
    毕业不到一年,绩效打了个D!
    poj 3111 K Best (二分搜索之最大化平均值之01分数规划)
  • 原文地址:https://www.cnblogs.com/leozhanggg/p/13608458.html
Copyright © 2020-2023  润新知