|NO.Z.00361|——————————|CloudNative|——|KuberNetes&运维.V77|——|IngressNginx.v13|监控|

一、IngressNginx监控
### --- IngressNginx监控

~~~     # IngressNginx监控官网地址:
~~~     https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/
二、ingress nginx 监控配置:https://github.com/kubernetes/ingress-nginx/tree/master/deploy
三、实验环境配置
### --- 查看pod自动发现配置
~~~     查看daemonset自动发现配置

[root@k8s-master01 ~]# kubectl edit ds -n ingress-nginx ingress-nginx-controller
  annotations:
    prometheus.io/port: "10254"
    prometheus.io/scrape: "true"
### --- 查看pod自动发现配置
~~~     均开启了自动发现的annotations,端口为10254
~~~     告诉了Prometheus是可以被自动发现的

[root@k8s-master01 Ingressnginx监控]# kubectl get po -n ingress-nginx ingress-nginx-controller-7lpqc  -oyaml
  annotations:
    prometheus.io/port: "10254"
    prometheus.io/scrape: "true"
四、配置secrets
### --- 配置secrets

~~~     ——>http://krm.test.com/——>secrets——>Namespace:monitoring
~~~     ——>additional-scrape-configs——>编辑:最下面添加如下内容——>update——>END
- job_name: 'ingress-nginx-endpoints'
  kubernetes_sd_configs:
  - role: pod
    namespaces:
      names:
      - ingress-nginx
  relabel_configs:
  - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
    action: keep
    regex: true
  - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
    action: replace
    target_label: __scheme__
    regex: (https?)
  - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
    action: replace
    target_label: __metrics_path__
    regex: (.+)
  - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
    action: replace
    target_label: __address__
    regex: ([^:]+)(?::\d+)?;(\d+)
    replacement: $1:$2
  - source_labels: [__meta_kubernetes_service_name]
    regex: prometheus-server
    action: drop
### --- 通过浏览器访问查看:http://prom.test.com/——>status:targets——>均监控到

~~~     ——>查看Ingress的监控信息——>Alerts——>Enable query history:ingress
~~~     ——>获取监控数据——>END
五、配置dashboard
### --- 配置dashboard

~~~     # dashboard下载地址
~~~     https://github.com/kubernetes/ingress-nginx/tree/master/deploy/grafana/dashboards
### --- 导入dashboard

~~~     ——>http://grafana.test.com/——>+号——>Import
~~~     ——>Upload.json file:nginx.json、request-handling-performance.json
~~~     ——>Prometheus:Prometheus——>Import——>END
~~~     ——>dashboard——1:nginx.json——>END
~~~     ——>dashboard——2request-handling-performance.json

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(31)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示