vmagent获取node-exporter配置

news2024/11/26 14:54:37

vmagent

使用以下命令添加图表 helm 存储库:

helm repo add vm https://victoriametrics.github.io/helm-charts/

helm repo update

列出vm/victoria-metrics-agent可供安装的图表版本:

helm search repo vm/victoria-metrics-agent -l

victoria-metrics-agent将图表的默认值导出到文件values.yaml:

mkdir vmagent
cd vmagent/

helm show values vm/victoria-metrics-agent > values.yaml

根据环境需要更改values.yaml文件中的值。

# Default values for victoria-metrics-agent.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1


# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
deployment:
  enabled: true
  # ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
  strategy: {}
   # rollingUpdate:
   #  maxSurge: 25%
   #  maxUnavailable: 25%
   # type: RollingUpdate

# ref:  https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
statefulset:
  enabled: false
  # ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
  updateStrategy: {}
    # type: RollingUpdate


image:
  repository: victoriametrics/vmagent
  tag: "" # rewrites Chart.AppVersion
  pullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

containerWorkingDir: "/"

rbac:
  create: true
  pspEnabled: true
  annotations: {}
  extraLabels: {}

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name:

## See `kubectl explain poddisruptionbudget.spec` for more
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
podDisruptionBudget:
  enabled: false
  # minAvailable: 1
  # maxUnavailable: 1
  labels: {}

# WARN: need to specify at least one remote write url or one multi tenant url
remoteWriteUrls:
    - http://192.168.127.185:8480/insert/0/prometheus
#   - http://prometheus:8480/insert/0/prometheus

multiTenantUrls: []
# multiTenantUrls:
#   - http://vm-insert-az1:8480
#   - http://vm-insert-az2:8480

extraArgs:
  envflag.enable: "true"
  envflag.prefix: VM_
  loggerFormat: json
  # promscrape.maxScrapeSize: "167772160"

  # Uncomment and specify the port if you want to support any of the protocols:
  # https://victoriametrics.github.io/vmagent.html#features
  # graphiteListenAddr: ":2003"
  # influxListenAddr: ":8189"
  # opentsdbHTTPListenAddr: ":4242"
  # opentsdbListenAddr: ":4242"

# -- Additional environment variables (ex.: secret tokens, flags) https://github.com/VictoriaMetrics/VictoriaMetrics#environment-variables
env:
  []
  # - name: VM_remoteWrite_basicAuth_password
  #   valueFrom:
  #     secretKeyRef:
  #       name: auth_secret
  #       key: password

# extra Labels for Pods, Deployment and Statefulset
extraLabels: {}

# extra Labels for Pods only
podLabels: {}

# Additional hostPath mounts
extraHostPathMounts:
  []
  # - name: certs-dir
  #   mountPath: /etc/kubernetes/certs
  #   subPath: ""
  #   hostPath: /etc/kubernetes/certs
  #   readOnly: true

# Extra Volumes for the pod
extraVolumes:
  []
  # - name: example
  #   configMap:
  #     name: example

# Extra Volume Mounts for the container
extraVolumeMounts:
  []
  # - name: example
  #   mountPath: /example

extraContainers: []
#   - name: config-reloader
#     image: reloader-image

podSecurityContext:
  {}
  # fsGroup: 2000

securityContext:
  {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

service:
  enabled: true
  annotations: {}
  extraLabels: {}
  clusterIP: ""
  ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
  ##
  externalIPs: []
  loadBalancerIP: ""
  loadBalancerSourceRanges: []
  servicePort: 8429
  type: ClusterIP
  # Ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
  # externalTrafficPolicy: "local"
  # healthCheckNodePort: 0
ingress:
  enabled: false
  annotations: {}
  #   kubernetes.io/ingress.class: nginx
  #   kubernetes.io/tls-acme: 'true'

  extraLabels: {}
  hosts: []
  #   - name: vmagent.local
  #     path: /
  #     port: http
  tls: []
  #   - secretName: vmagent-ingress-tls
  #     hosts:
  #       - vmagent.local
  # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
  # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
  # ingressClassName: nginx
  # -- pathType is only for k8s >= 1.1=
  pathType: Prefix
resources:
  {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

# Annotations to be added to the deployment
annotations: {}

# Annotations to be added to pod
podAnnotations: {}

nodeSelector: {}

tolerations: []

affinity: {}

# vmagent scraping configuration:
# https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmagent.md#how-to-collect-metrics-in-prometheus-format

# use existing configmap if specified
# otherwise .config values will be used
configMap: ""

# -- priority class to be assigned to the pod(s)
priorityClassName: ""

serviceMonitor:
  enabled: false
  extraLabels: {}
  annotations: {}
#    interval: 15s
#    scrapeTimeout: 5s
  # -- Commented. HTTP scheme to use for scraping.
#    scheme: https
  # -- Commented. TLS configuration to use when scraping the endpoint
#    tlsConfig:
#      insecureSkipVerify: true

persistence:
  enabled: false
  # storageClassName: default
  accessModes:
    - ReadWriteOnce
  size: 10Gi
  annotations: {}
  extraLabels: {}
  existingClaim: ""
  # -- Bind Persistent Volume by labels. Must match all labels of targeted PV.
  matchLabels: {}

config:
  global:
    scrape_interval: 10s

  # scrape self by default
  scrape_configs:
    - job_name: node-exporter
      static_configs:
        - targets: ["10.1.138.177:9100"]
        - targets: ["10.1.138.178:9100"]

      ## COPY from Prometheus helm chart https://github.com/helm/charts/blob/master/stable/prometheus/values.yaml

      # Scrape config for API servers.
      #
      # Kubernetes exposes API servers as endpoints to the default/kubernetes
      # service so this uses `endpoints` role and uses relabelling to only keep
      # the endpoints associated with the default/kubernetes service using the
      # default named port `https`. This works for single API server deployments as
      # well as HA API server deployments.
    - job_name: "kubernetes-apiservers"
      kubernetes_sd_configs:
        - role: endpoints
      # Default to scraping over https. If required, just disable this or change to
      # `http`.
      scheme: https
      # This TLS & bearer token file config is used to connect to the actual scrape
      # endpoints for cluster components. This is separate to discovery auth
      # configuration because discovery & scraping are two separate concerns in
      # Prometheus. The discovery auth config is automatic if Prometheus runs inside
      # the cluster. Otherwise, more config options have to be provided within the
      # <kubernetes_sd_config>.
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        # If your node certificates are self-signed or use a different CA to the
        # master CA, then disable certificate verification below. Note that
        # certificate verification is an integral part of a secure infrastructure
        # so this should only be disabled in a controlled environment. You can
        # disable certificate verification by uncommenting the line below.
        #
        insecure_skip_verify: true
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      # Keep only the default/kubernetes service endpoints for the https port. This
      # will add targets for each API server which Kubernetes adds an endpoint to
      # the default/kubernetes service.
      relabel_configs:
        - source_labels:
            [
              __meta_kubernetes_namespace,
              __meta_kubernetes_service_name,
              __meta_kubernetes_endpoint_port_name,
            ]
          action: keep
          regex: default;kubernetes;https
    - job_name: "kubernetes-nodes"
      # Default to scraping over https. If required, just disable this or change to
      # `http`.
      scheme: https
      # This TLS & bearer token file config is used to connect to the actual scrape
      # endpoints for cluster components. This is separate to discovery auth
      # configuration because discovery & scraping are two separate concerns in
      # Prometheus. The discovery auth config is automatic if Prometheus runs inside
      # the cluster. Otherwise, more config options have to be provided within the
      # <kubernetes_sd_config>.
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        # If your node certificates are self-signed or use a different CA to the
        # master CA, then disable certificate verification below. Note that
        # certificate verification is an integral part of a secure infrastructure
        # so this should only be disabled in a controlled environment. You can
        # disable certificate verification by uncommenting the line below.
        #
        insecure_skip_verify: true
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      kubernetes_sd_configs:
        - role: node
      relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/$1/proxy/metrics
    - job_name: "kubernetes-nodes-cadvisor"
      # Default to scraping over https. If required, just disable this or change to
      # `http`.
      scheme: https
      # This TLS & bearer token file config is used to connect to the actual scrape
      # endpoints for cluster components. This is separate to discovery auth
      # configuration because discovery & scraping are two separate concerns in
      # Prometheus. The discovery auth config is automatic if Prometheus runs inside
      # the cluster. Otherwise, more config options have to be provided within the
      # <kubernetes_sd_config>.
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        # If your node certificates are self-signed or use a different CA to the
        # master CA, then disable certificate verification below. Note that
        # certificate verification is an integral part of a secure infrastructure
        # so this should only be disabled in a controlled environment. You can
        # disable certificate verification by uncommenting the line below.
        #
        insecure_skip_verify: true
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      kubernetes_sd_configs:
        - role: node
      # This configuration will work only on kubelet 1.7.3+
      # As the scrape endpoints for cAdvisor have changed
      # if you are using older version you need to change the replacement to
      # replacement: /api/v1/nodes/$1:4194/proxy/metrics
      # more info here https://github.com/coreos/prometheus-operator/issues/633
      relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor

    # Scrape config for service endpoints.
    #
    # The relabeling allows the actual service scrape endpoint to be configured
    # via the following annotations:
    #
    # * `prometheus.io/scrape`: Only scrape services that have a value of `true`
    # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
    # to set this to `https` & most likely set the `tls_config` of the scrape config.
    # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
    # * `prometheus.io/port`: If the metrics are exposed on a different port to the
    # service then set this appropriately.
    - job_name: "kubernetes-service-endpoints"
      kubernetes_sd_configs:
        - role: endpoints
      relabel_configs:
        - action: drop
          source_labels: [__meta_kubernetes_pod_container_init]
          regex: true
        - action: keep_if_equal
          source_labels: [__meta_kubernetes_service_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number]
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_scheme]
          action: replace
          target_label: __scheme__
          regex: (https?)
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels:
            [
              __address__,
              __meta_kubernetes_service_annotation_prometheus_io_port,
            ]
          action: replace
          target_label: __address__
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_service_name]
          action: replace
          target_label: kubernetes_name
        - source_labels: [__meta_kubernetes_pod_node_name]
          action: replace
          target_label: kubernetes_node
    # Scrape config for slow service endpoints; same as above, but with a larger
    # timeout and a larger interval
    #
    # The relabeling allows the actual service scrape endpoint to be configured
    # via the following annotations:
    #
    # * `prometheus.io/scrape-slow`: Only scrape services that have a value of `true`
    # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
    # to set this to `https` & most likely set the `tls_config` of the scrape config.
    # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
    # * `prometheus.io/port`: If the metrics are exposed on a different port to the
    # service then set this appropriately.
    - job_name: "kubernetes-service-endpoints-slow"
      scrape_interval: 5m
      scrape_timeout: 30s
      kubernetes_sd_configs:
        - role: endpoints
      relabel_configs:
        - action: drop
          source_labels: [__meta_kubernetes_pod_container_init]
          regex: true
        - action: keep_if_equal
          source_labels: [__meta_kubernetes_service_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number]
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_scrape_slow]
          action: keep
          regex: true
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_scheme]
          action: replace
          target_label: __scheme__
          regex: (https?)
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_path]
          action: replace
          target_label: __metrics_path__
          regex: (.+)
        - source_labels:
            [
              __address__,
              __meta_kubernetes_service_annotation_prometheus_io_port,
            ]
          action: replace
          target_label: __address__
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_service_name]
          action: replace
          target_label: kubernetes_name
        - source_labels: [__meta_kubernetes_pod_node_name]
          action: replace
          target_label: kubernetes_node
    # Example scrape config for probing services via the Blackbox Exporter.
    #
    # The relabeling allows the actual service scrape endpoint to be configured
    # via the following annotations:
    #
    # * `prometheus.io/probe`: Only probe services that have a value of `true`
    - job_name: "kubernetes-services"
      metrics_path: /probe
      params:
        module: [http_2xx]
      kubernetes_sd_configs:
        - role: service
      relabel_configs:
        - source_labels:
            [__meta_kubernetes_service_annotation_prometheus_io_probe]
          action: keep
          regex: true
        - source_labels: [__address__]
          target_label: __param_target
        - target_label: __address__
          replacement: blackbox
        - source_labels: [__param_target]
          target_label: instance
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_service_name]
          target_label: kubernetes_name
    # Example scrape config for pods
    #
    # The relabeling allows the actual pod scrape endpoint to be configured via the
    # following annotations:
    #
    # * `prometheus.io/scrape`: Only scrape pods that have a value of `true`
    # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
    # * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
    - job_name: "kubernetes-pods"
      kubernetes_sd_configs:
        - role: pod
      relabel_configs:
        - action: drop
          source_labels: [__meta_kubernetes_pod_container_init]
          regex: true
        - action: keep_if_equal
          source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number]
        - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
          action: keep
          regex: true
        - 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
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_pod_label_(.+)
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: kubernetes_namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: kubernetes_pod_name
      ## End of COPY

# -- Extra scrape configs that will be appended to `config`
extraScrapeConfigs: []

 

使用命令测试安装:

helm install vmagent vm/victoria-metrics-agent -f values.yaml -n victoria-metrics --debug --dry-run

使用命令安装:

helm install vmagent vm/victoria-metrics-agent -f values.yaml -n victoria-metrics

通过运行以下命令获取 pod 列表:

kubectl get pods -A | grep 'agent'

通过运行以下命令获取应用程序:

helm list -f vmagent -n victoria-metrics

使用命令查看应用程序版本的历史记录vmagent。

helm history vmagent -n victoria-metrics

更新配置

cd vmagent/
#修改value.yaml文件
helm upgrade vmagent vm/victoria-metrics-agent -f values.yaml -n victoria-metrics

 

vmgent deployment

[root@bastion ci-test]# kubectl get deploy vmagent-victoria-metrics-agent -n victoria-metrics -o yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "6"
    meta.helm.sh/release-name: vmagent
    meta.helm.sh/release-namespace: victoria-metrics
  creationTimestamp: "2022-06-22T05:53:42Z"
  generation: 6
  labels:
    app.kubernetes.io/instance: vmagent
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: victoria-metrics-agent
    app.kubernetes.io/version: v1.78.0
    helm.sh/chart: victoria-metrics-agent-0.8.8
  name: vmagent-victoria-metrics-agent
  namespace: victoria-metrics
  resourceVersion: "64544377"
  uid: 964ad1c5-8e52-4173-8cdd-4c138845f9c9
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: vmagent
      app.kubernetes.io/name: victoria-metrics-agent
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        checksum/config: 05df4ae3a0ba0f3719e0e0be1197216ea9c8d5a9f12fdb211b0aea2af9d24d8c
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: vmagent
        app.kubernetes.io/name: victoria-metrics-agent
    spec:
      containers:
      - args:
        - -promscrape.config=/config/scrape.yml
        - -remoteWrite.tmpDataPath=/tmpData
        - -remoteWrite.url=http://192.168.127.185:8480/insert/0/prometheus
        - -envflag.enable=true
        - -envflag.prefix=VM_
        - -loggerFormat=json
        image: victoriametrics/vmagent:v1.83.0
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 15
          successThreshold: 1
          tcpSocket:
            port: http
          timeoutSeconds: 5
        name: victoria-metrics-agent
        ports:
        - containerPort: 8429
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: http
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 1
        resources: {}
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmpData
          name: tmpdata
        - mountPath: /config
          name: config
        workingDir: /
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: vmagent-victoria-metrics-agent
      serviceAccountName: vmagent-victoria-metrics-agent
      terminationGracePeriodSeconds: 30
      volumes:
      - emptyDir: {}
        name: tmpdata
      - configMap:
          defaultMode: 420
          name: vmagent-victoria-metrics-agent-config
        name: config
status:
  availableReplicas: 1
  conditions:
  - lastTransitionTime: "2022-06-22T06:28:44Z"
    lastUpdateTime: "2022-11-02T02:35:05Z"
    message: ReplicaSet "vmagent-victoria-metrics-agent-75d9758b9f" has successfully
      progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  - lastTransitionTime: "2022-11-02T09:55:33Z"
    lastUpdateTime: "2022-11-02T09:55:33Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  observedGeneration: 6
  readyReplicas: 1
  replicas: 1
  updatedReplicas: 1

node-exporter

使用以下命令添加 helm chart存储库

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

列出vm/victoria-metrics-agent可供安装的图表版本:

helm search repo prometheus-community/prometheus-node-exporter -l

victoria-metrics-agent将图表的默认值导出到文件values.yaml:

mkdir node-exporter
cd node-exporter/

helm show values prometheus-community/prometheus-node-exporter > values.yaml

根据环境需要更改values.yaml文件中的值。

# Default values for prometheus-node-exporter.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
  repository: quay.io/prometheus/node-exporter
  # Overrides the image tag whose default is {{ printf "v%s" .Chart.AppVersion }}
  tag: ""
  pullPolicy: IfNotPresent

imagePullSecrets: []
# - name: "image-pull-secret"

service:
  type: ClusterIP
  port: 9100
  targetPort: 9100
  nodePort:
  portName: metrics
  listenOnAllInterfaces: true
  annotations:
    prometheus.io/scrape: "true"

# Additional environment variables that will be passed to the daemonset
env: {}
##  env:
##    VARIABLE: value

prometheus:
  monitor:
    enabled: false
    additionalLabels: {}
    namespace: ""

    jobLabel: ""

    scheme: http
    basicAuth: {}
    bearerTokenFile:
    tlsConfig: {}

    ## proxyUrl: URL of a proxy that should be used for scraping.
    ##
    proxyUrl: ""

    ## Override serviceMonitor selector
    ##
    selectorOverride: {}

    relabelings: []
    metricRelabelings: []
    interval: ""
    scrapeTimeout: 10s

## Customize the updateStrategy if set
updateStrategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 200m
  #   memory: 50Mi
  # requests:
  #   cpu: 100m
  #   memory: 30Mi

serviceAccount:
  # Specifies whether a ServiceAccount should be created
  create: true
  # The name of the ServiceAccount to use.
  # If not set and create is true, a name is generated using the fullname template
  name:
  annotations: {}
  imagePullSecrets: []
  automountServiceAccountToken: false

securityContext:
  fsGroup: 65534
  runAsGroup: 65534
  runAsNonRoot: true
  runAsUser: 65534

containerSecurityContext: {}
  # capabilities:
  #   add:
  #   - SYS_TIME

rbac:
  ## If true, create & use RBAC resources
  ##
  create: true
  ## If true, create & use Pod Security Policy resources
  ## https://kubernetes.io/docs/concepts/policy/pod-security-policy/
  pspEnabled: true
  pspAnnotations: {}

# for deployments that have node_exporter deployed outside of the cluster, list
# their addresses here
endpoints: []

# Expose the service to the host network
hostNetwork: true

# Share the host process ID namespace
hostPID: true

# Mount the node's root file system (/) at /host/root in the container
hostRootFsMount:
  enabled: true
  # Defines how new mounts in existing mounts on the node or in the container
  # are propagated to the container or node, respectively. Possible values are
  # None, HostToContainer, and Bidirectional. If this field is omitted, then
  # None is used. More information on:
  # https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation
  mountPropagation: HostToContainer

## Assign a group of affinity scheduling rules
##
affinity: {}
#   nodeAffinity:
#     requiredDuringSchedulingIgnoredDuringExecution:
#       nodeSelectorTerms:
#         - matchFields:
#             - key: metadata.name
#               operator: In
#               values:
#                 - target-host-name

# Annotations to be added to node exporter pods
podAnnotations:
  # Fix for very slow GKE cluster upgrades
  cluster-autoscaler.kubernetes.io/safe-to-evict: "true"

# Extra labels to be added to node exporter pods
podLabels: {}

# Custom DNS configuration to be added to prometheus-node-exporter pods
dnsConfig: {}
# nameservers:
#   - 1.2.3.4
# searches:
#   - ns1.svc.cluster-domain.example
#   - my.dns.search.suffix
# options:
#   - name: ndots
#     value: "2"
#   - name: edns0

## Assign a nodeSelector if operating a hybrid cluster
##
nodeSelector: {}
#   beta.kubernetes.io/arch: amd64
#   beta.kubernetes.io/os: linux

tolerations:
  - effect: NoSchedule
    operator: Exists

## Assign a PriorityClassName to pods if set
# priorityClassName: ""

## Additional container arguments
##
extraArgs: []
#   - --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v)d[a-z]|nvme\\d+n\\d+p)\\d+$
#   - --collector.textfile.directory=/run/prometheus

## Additional mounts from the host
##
extraHostVolumeMounts: []
#  - name: <mountName>
#    hostPath: <hostPath>
#    mountPath: <mountPath>
#    readOnly: true|false
#    mountPropagation: None|HostToContainer|Bidirectional

## Additional configmaps to be mounted.
##
configmaps: []
# - name: <configMapName>
#   mountPath: <mountPath>
secrets: []
# - name: <secretName>
#   mountPath: <mountPatch>
## Override the deployment namespace
##
namespaceOverride: ""

## Additional containers for export metrics to text file
##
sidecars: []
##  - name: nvidia-dcgm-exporter
##    image: nvidia/dcgm-exporter:1.4.3

## Volume for sidecar containers
##
sidecarVolumeMount: []
##  - name: collector-textfiles
##    mountPath: /run/prometheus
##    readOnly: false

## Additional InitContainers to initialize the pod
##
extraInitContainers: []

## Liveness probe
##
livenessProbe:
  failureThreshold: 3
  httpGet:
    httpHeaders: []
    scheme: http
  initialDelaySeconds: 0
  periodSeconds: 10
  successThreshold: 1
  timeoutSeconds: 1

## Readiness probe
##
readinessProbe:
  failureThreshold: 3
  httpGet:
    httpHeaders: []
    scheme: http
  initialDelaySeconds: 0
  periodSeconds: 10
  successThreshold: 1
  timeoutSeconds: 1

测试安装

helm install node-exporter prometheus-community/prometheus-node-exporter -f values.yaml -n victoria-metrics --debug --dry-run

安装

helm install node-exporter prometheus-community/prometheus-node-exporter -f values.yaml -n victoria-metrics

更新配置

cd node-exporter/
#修改value.yaml文件
helm upgrade node-exporter prometheus-community/prometheus-node-exporter -f values.yaml -n victoria-metrics

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/881296.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

iObit Uninstaller 最新版13 Pro更新了什么?

iObit Uninstaller 专业且易用的 Windows 卸载程序&#xff0c;它可以轻松删除不需要的程序&#xff0c;插件和 Windows 应用程序&#xff0c;还可以对电脑旧的应用一键更新。 功能和特点 安装监视器 安装监视器会检测并记录安装中的所有系统更改&#xff0c;以确保在将来彻底…

基于Mysqlrouter+MHA+keepalived实现高可用半同步 MySQL Cluster项目

目录 项目名称&#xff1a; 基于Mysqlrouter MHA keepalived实现半同步主从复制MySQL Cluster MySQL Cluster&#xff1a; 项目架构图&#xff1a; 项目环境&#xff1a; 项目环境安装包&#xff1a; 项目描述&#xff1a; 项目IP地址规划&#xff1a; 项目步骤: 一…

java不支持发行版本5

这篇文章主要给大家介绍了关于如何解决java错误:不支持发行版本5的相关资料,发行版本5是Java5,已经是十多年前的版本了,现在已经不再被支持,需要的朋友可以参考下 − 目录 问题描述&#xff1a;解决方法&#xff1a;永久解决方法&#xff1a;总结 问题描述&#xff1a; 在i…

小红书内容+直播数据分析,品牌打开秋天的正确方式

秋天的第一杯奶茶&#xff0c;你喝了吗&#xff1f;不知不觉&#xff0c;秋日以至。季节轮转&#xff0c;随之而来的还有变化的消费需求。目前&#xff0c;各大社媒已逐渐开启关于秋天的讨论&#xff0c;新的季节&#xff0c;品牌要如何布局内容呢&#xff1f;本期&#xff0c;…

点成案例丨比浊仪用于乳酸菌抑菌活性测定

乳酸菌概述 自1929年英国科学家弗莱明发现青霉素以来&#xff0c;抗生素为人类医学的进步做出了巨大贡献。然而&#xff0c;抗生素在临床上广泛且持续的使用导致病原微生物产生了耐药性。目前&#xff0c;病原微生物对抗生素的耐药性正在威胁人们的健康&#xff0c;寻找具有抑…

Scratch 之 制作超丝滑 FNF 推条

这个教程是不用画笔的&#xff0c;所以不用担心推条是最后一层了&#xff01; 导入素材 你以为真是这样吗&#xff1f;NO&#xff0c;NO&#xff0c;NO&#xff0c;其实是这样的 没错&#xff0c;中间是空的&#xff01;中间是空的&#xff01;中间是空的&#xff01;&#xf…

【Gazebo安装教程】2023年最新安装全流程详解!

安装 实验环境&#xff1a;ubuntu22.04LTS 安装 Gazebo 首先我们需要安装必须的工具 sudo apt-get update sudo apt-get install lsb-release wget gnupg之后修改源&#xff0c;并 update 一下来更新 sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/shar…

实现无限创建敌人。(Unity)

首先我们创建一个空物体GameObject产怪点改名为Enemypoint&#xff0c;这个点是敌人出现的位置。我们首先在空物体里面的transform组件中重置这个点的位置为0&#xff0c;并且给这个点设置一个颜色&#xff0c;方便找到这个点。如果给这个点设置一个位置&#xff0c;修改它的tr…

移动硬盘只显示盘符不显示容量怎么办

在使用移动硬盘时&#xff0c;有时候可能会遇到移动硬盘只显示盘符而不显示容量的困扰。这种情况可能会引起数据无法读取或无法保存的问题&#xff0c;给用户带来不便。本文将详细解释这个问题的原因&#xff0c;并提供一些解决方法&#xff0c;让您能够轻松恢复移动硬盘的容量…

高忆管理:真金白银落到实处 27家沪市公司更新回购增持“进度条”

或抛出方案&#xff0c;或更新进展&#xff0c;一大批沪市公司及其股东正加速跑在回购增持的路上。仅8月14日晚&#xff0c;沪市便有27家上市公司会集发表回购增持类公告&#xff0c;以真金白银持续提振商场决心。 据上海证券报记者计算&#xff0c;到现在&#xff0c;在回购方…

网络基础--ARP协议介绍

1、ARP作用 ARP&#xff08; Address Resolution Protocol&#xff0c;地址解析协议&#xff09;是将 IP 地址解析为以太网 MAC 地址&#xff08;或称物理地址&#xff09;的协议。在局域网中&#xff0c;当主机或其它网络设备有数据要发送给另一个主机或设备时&#xff0c;它必…

云上社群学习系统部分接口设计详解

目录 一、项目简介 二、技术选型 三、数据库设计 四、接口设计及思考 回复帖子部分 4.1 回复帖子 4.1.1.1 实现逻辑 4.1.1.2创建Service接⼝ 4.1.1.3 实现Service接⼝ 4.1.1.4 实现Controller 4.1.1.5 测试接口 4.1.1.6 实现前端页面 4.2 点赞帖子 4.2.1.1 参数要求…

MySQL 根据多字段查询重复数据

MySQL 根据多字段查询重复数据 在实际的数据库应用中&#xff0c;我们经常需要根据多个字段来查询重复的数据。MySQL 提供了一些方法来实现这个功能&#xff0c;让我们能够快速准确地找到和处理重复数据。本文将介绍如何使用 MySQL 来根据多字段查询重复数据&#xff0c;并提供…

LeetCode 38题:外观数列

题目 给定一个正整数 n &#xff0c;输出外观数列的第 n 项。 「外观数列」是一个整数序列&#xff0c;从数字 1 开始&#xff0c;序列中的每一项都是对前一项的描述。 你可以将其视作是由递归公式定义的数字字符串序列&#xff1a; countAndSay(1) "1"countAnd…

【【verilog典型电路设计之复数乘法器】】

verilog典型电路设计之复数乘法器 典型电路设计之复数乘法器 复数乘法的算法是&#xff1a; 设复数xabi ; ycdi; 则复数乘法结果 x.y(abi)(cdi)(ac-bd) i(adbc) 复数乘法器 我们可以将复数x y 的实部与虚部相乘&#xff0c;减去 x与y的虚部相乘 得到输出结果的实部 就是ac-bd…

DC电源模块减小输入电源与输出负载之间的能量损失

BOSHIDA DC电源模块减小输入电源与输出负载之间的能量损失 随着电子产品的普及&#xff0c;DC电源模块已成为现代电子设备中不可或缺的组成部分。DC电源模块可以将交流电转化为直流电&#xff0c;并根据需要&#xff0c;以适当的电压和电流提供给输出负载。然而&#xff0c;在输…

css3-flex布局:基础使用 / Flexbox布局

一、理解flex 二、理解Flex布局&#xff08;又称Flexbox布局&#xff09; Flex布局&#xff08;又称Flexbox布局&#xff09;是一种基于Web的CSS3布局模式&#xff0c;其目的是为了更加灵活和自适应地布置各种各样的网页元素。Flex布局通过将一个父容器分割为一个或多个弹性项…

gitlab修改远程仓库地址

目录 背景&#xff1a; 解决&#xff1a; 1.删除本地仓库关联的远程地址&#xff0c;添加新的远程仓库地址 2.直接修改本地仓库关联的远程仓库地址 3.打开.git隐藏文件修改远程仓库地址 4.拉取代码报错(git host key verification failed) 背景&#xff1a; 公司搬家&#…

item_review-获得TB商品评论

一、接口参数说明&#xff1a; item_review-获得TB商品评论&#xff0c;点击更多API调试&#xff0c;请移步注册API账号点击获取测试key和secret 公共参数 请求地址: https://api-gw.onebound.cn/taobao/item_review 名称类型必须描述keyString是调用key&#xff08;点击获取…

el-table实现懒加载(el-table-infinite-scroll)

2023.8.15今天我学习了用el-table对大量的数据进行懒加载。 效果如下&#xff1a; 1.首先安装&#xff1a; npm install --save el-table-infinite-scroll2 2.全局引入&#xff1a; import ElTableInfiniteScroll from "el-table-infinite-scroll";// 懒加载 V…