kubernetesprometheuskubernetes-helmprometheus-node-exporter

How can I update prometheus-node-exporter when deploying prometheus through helm charts?


I have used the prometheus helm chart from https://prometheus-community.github.io/helm-charts to setup a prometheus server on EKS for me. That involves prometheus-node-exporter too. Now what I'm trying to do is modify the prometheus-node-exporter service port to another one from 9100.

I updated the value under prometheus-node-exportes/values.yaml to this :

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

but when I do :

helm upgrade prometheus prometheus-community/prometheus --namespace monitoring the changes do not take effect at all.

How can I update values of other subcharts like prometheus-node-exporter in my helm chart?


Solution

  • The way that your command is running, is pulling the chart from the internet, you are not passing any extra values file.

    If the port is all you are changing, use this command to pass the port value: helm upgrade prometheus prometheus-community/prometheus --namespace monitoring --set prometheus-node-exporter.service.port=<your-port>

    Otherwise, you can download the promethues values file, then add the mods to it, e.g.:

    prometheus-node-exporter:
      ## If false, node-exporter will not be installed
      ##
      enabled: true
    
      rbac:
        pspEnabled: false
    
      containerSecurityContext:
        allowPrivilegeEscalation: false
    
      service:
      port: <your-port>
    

    Then, pass the values file to the upgrade command using -f values.yaml

    Also, check this doc.