gpt4 book ai didi

kubernetes - 远程写和远程读的Prometheus错误 “server returned HTTP status 401 Unauthorized”

转载 作者:行者123 更新时间:2023-12-02 11:42:20 28 4
gpt4 key购买 nike

我已经在Kubernetes中安装了Prometheus,并且尝试对InfluxDB使用remote_write和remote_read选项。我还在数据库中创建了一个具有读写特权的用户。但是我收到这样的错误

http://url:port/api/v1/prom/write?db=dbname&u=xxx&p=yyy msg=non-recoverable error" count=100 err="server returned HTTP status 401 Unauthorized: {\"error\":\"authorization failed\"}"
我对普罗米修斯的配置是
 prometheus.yml: |-
global:
scrape_interval: 5s
evaluation_interval: 5s
rule_files:
- /etc/prometheus/prometheus.rules
remote_write:
- url: "http://url:port/api/v1/prom/write?db=dbname&u=xxxx&p=yyy"

remote_read:
- url: "http://url:port/api/v1/prom/read?db=dbname&u=xxx&p=yyy"

最佳答案

您可以将 secret 定义为卷:

 volumeMounts:
- name: prometheus-secret
readOnly: true
mountPath: "/etc/prometheus-secret"

then use it in your prometheus yaml config as:

basic_auth:
password_file: "/etc/prometheus-secret"

关于kubernetes - 远程写和远程读的Prometheus错误 “server returned HTTP status 401 Unauthorized”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62716229/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com