k8s上部署nebula-stats-exporter

推荐你使用prometheus-operator来部署

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts && helm repo update && \
helm install prometheus-operator prometheus-community/kube-prometheus-stack \
  --namespace=monitoring --version=21.0.3 --create-namespace \
  -f prometheus-operator.values.yaml
commonLabels:
  kubernetes.io/prometheus: cloud
prometheus:
  prometheusSpec:
    serviceMonitorSelector:
      matchLabels:
       kubernetes.io/prometheus: cloud
    additionalScrapeConfigs:
      - job_name: kubernetes-pods
        kubernetes_sd_configs:
          - role: pod
        relabel_configs:
          - action: keep
            regex: true
            source_labels:
              - __meta_kubernetes_pod_annotation_prometheus_io_scrape
          - action: replace
            regex: (.+)
            source_labels:
              - __meta_kubernetes_pod_annotation_prometheus_io_path
            target_label: __metrics_path__
          - action: replace
            regex: ([^:]+)(?::\d+)?;(\d+)
            replacement: $1:$2
            source_labels:
              - __address__
              - __meta_kubernetes_pod_annotation_prometheus_io_port
            target_label: __address__
          - action: labelmap
            regex: __meta_kubernetes_pod_label_(.+)
          - action: replace
            source_labels:
              - __meta_kubernetes_namespace
            target_label: kubernetes_namespace
          - action: replace
            source_labels:
              - __meta_kubernetes_pod_name
            target_label: kubernetes_pod_name
    replicas: 3
    retention: 15d
    storageSpec:
      volumeClaimTemplate:
        spec:
          storageClassName: fast-disks
          resources:
            requests:
              storage: 20Gi
    nodeSelector:
      kubernetes.io/mode: system
  service:
    type: NodePort

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。