当前位置:   article > 正文

【prometheus-operator】k8s监控集群外redis

【prometheus-operator】k8s监控集群外redis

1、部署exporter

GitHub - oliver006/redis_exporter: Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x, 4.x, 5.x, 6.x, and 7.x

redis_exporter-v1.57.0.linux-386.tar.gz

# 解压

tar -zxvf redis_exporter-v1.57.0.linux-386.tar.gz

# 启动
nohup ./redis_exporter -redis.password 111111 -web.listen-address 0.0.0.0:9122 &

访问确认启动成功

http://ip:9122/metrics 

2、创建k8s对象

集群内部创建Endpoints代理外部端点

  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: redis-exporter-monitor
  6. namespace: monitor
  7. labels:
  8. app: redis-exporter-monitor
  9. spec:
  10. type: ClusterIP
  11. ports:
  12. - name: tcp-9122
  13. port: 9122
  14. protocol: TCP
  15. targetPort: 9122
  16. ---
  17. apiVersion: v1
  18. kind: Endpoints
  19. metadata:
  20. name: redis-exporter-monitor
  21. namespace: monitor
  22. labels:
  23. app: redis-exporter-monitor
  24. side: mid
  25. subsets:
  26. - addresses:
  27. - ip: {ip}
  28. ports:
  29. - name: tcp-9122
  30. port: 9122
  31. ---
  32. apiVersion: monitoring.coreos.com/v1
  33. kind: ServiceMonitor
  34. metadata:
  35. name: redis-exporter-monitor
  36. namespace: monitor
  37. labels:
  38. team: hit
  39. side: mid
  40. spec:
  41. selector:
  42. matchLabels:
  43. app: redis-exporter-monitor
  44. namespaceSelector:
  45. matchNames:
  46. - monitor
  47. endpoints:
  48. - port: tcp-9122
  49. path: /metrics

3、grafana模板

id:17507

 关联文章:

【prometheus-operator】k8s监控集群redis

以上内容对您有帮助,请点赞支持,谢谢!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/327804
推荐阅读
相关标签
  

闽ICP备14008679号