Nacos

Endpoint

apiVersion: v1
kind: Endpoints
metadata:
  name: nacos-exporter
  namespace: monitoring
subsets:
- addresses:
  - ip: # 列举 nacos 的机器的ip1
  - ip: # 列举 nacos 的机器的ip2 ...
  ports:
  - name: http
    port: 8848  # nacos-exporter 端口
    protocol: TCP

Service

apiVersion: v1
kind: Service
metadata:
  labels:
    app: nacos-exporter
    type: nacos
    version: 1.4.4
    platform: mos
  name: nacos-exporter
  namespace: monitoring
spec:
  ports:
  - port: 8848  # nacos-exporter 端口
    protocol: TCP
    targetPort: http
  type: ClusterIP

ServiceMonitor

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: nacos-exporter
  namespace: monitoring
spec:
  endpoints:
  - interval: 15s
    path: /nacos/actuator/prometheus
    port: http
  targetLabels: [platform]
  namespaceSelector:
    matchNames:
    - monitoring
  selector:
    matchLabels:
      app: nacos-exporter
      type: nacos