我使用了 https://prometheus-community.github.io/helm-charts 中的 Prometheus Helm Chart 在 EKS 上为我设置了 Prometheus 服务器。这也涉及到 prometheus-node-exporter。现在我想做的是将 prometheus-node-exporter 服务端口从 9100 修改为另一个端口。
我将 prometheus-node-exportes/values.yaml 下的值更新为:
service:
type: ClusterIP
port: 9400
targetPort: 9400
nodePort:
portName: metrics
listenOnAllInterfaces: true
annotations:
prometheus.io/scrape: "true"
但是当我这样做时:
helm upgrade prometheus prometheus-community/prometheus --namespace monitoring
更改根本不会生效。
如何更新 helm 图表中其他子图表(例如 prometheus-node-exporter)的值?
您的命令运行的方式是从互联网上提取图表,您没有传递任何额外的值文件。
如果您要更改的只是端口,请使用此命令传递端口值:
helm upgrade prometheus prometheus-community/prometheus --namespace monitoring --set prometheus-node-exporter.service.port=<your-port>
否则,您可以下载 promethues 值文件,然后向其中添加 mods,例如:
prometheus-node-exporter:
## If false, node-exporter will not be installed
##
enabled: true
rbac:
pspEnabled: false
containerSecurityContext:
allowPrivilegeEscalation: false
service:
port: <your-port>
然后,使用
-f values.yaml
将值文件传递给升级命令
另外,请检查此文档。