node-exporter-template.yaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: prometheus-node-exporter
  5. annotations:
  6. openshift.io/display-name: Prometheus Node Exporter
  7. description: Prometheus exporter for node host metrics
  8. iconClass: fa fa-cogs
  9. tags: monitoring,prometheus
  10. openshift.io/support-url: https://access.redhat.com
  11. openshift.io/provider-display-name: Red Hat, Inc.
  12. parameters:
  13. - name: IMAGE
  14. value: openshift/prometheus-node-exporter:v0.16.0
  15. - name: MEMORY_REQUESTS
  16. value: 30Mi
  17. - name: CPU_REQUESTS
  18. value: 100m
  19. - name: MEMORY_LIMITS
  20. value: 50Mi
  21. - name: CPU_LIMITS
  22. value: 200m
  23. objects:
  24. - apiVersion: v1
  25. kind: ServiceAccount
  26. metadata:
  27. name: prometheus-node-exporter
  28. - apiVersion: v1
  29. kind: Service
  30. metadata:
  31. annotations:
  32. prometheus.io/scrape: "true"
  33. labels:
  34. app: prometheus-node-exporter
  35. name: prometheus-node-exporter
  36. spec:
  37. clusterIP: None
  38. ports:
  39. - name: scrape
  40. port: 9102
  41. protocol: TCP
  42. targetPort: 9102
  43. selector:
  44. app: prometheus-node-exporter
  45. - apiVersion: extensions/v1beta1
  46. kind: DaemonSet
  47. metadata:
  48. name: prometheus-node-exporter
  49. labels:
  50. app: prometheus-node-exporter
  51. role: monitoring
  52. spec:
  53. updateStrategy:
  54. type: RollingUpdate
  55. template:
  56. metadata:
  57. labels:
  58. app: prometheus-node-exporter
  59. role: monitoring
  60. name: prometheus-exporter
  61. spec:
  62. serviceAccountName: prometheus-node-exporter
  63. hostNetwork: true
  64. hostPID: true
  65. containers:
  66. - image: ${IMAGE}
  67. name: node-exporter
  68. args:
  69. - --no-collector.wifi
  70. - --web.listen-address=:9102
  71. ports:
  72. - containerPort: 9102
  73. name: scrape
  74. resources:
  75. requests:
  76. memory: ${MEMORY_REQUESTS}
  77. cpu: ${CPU_REQUESTS}
  78. limits:
  79. memory: ${MEMORY_LIMITS}
  80. cpu: ${CPU_LIMITS}
  81. volumeMounts:
  82. - name: proc
  83. readOnly: true
  84. mountPath: /host/proc
  85. - name: sys
  86. readOnly: true
  87. mountPath: /host/sys
  88. volumes:
  89. - name: proc
  90. hostPath:
  91. path: /proc
  92. - name: sys
  93. hostPath:
  94. path: /sys