【问题标题】:Prometheus for k8s - "Context Deadline" as soon as a worker node is addedPrometheus for k8s - 添加工作节点后的“上下文截止日期”
【发布时间】:2021-09-17 23:52:02
【问题描述】:

我正在尝试使用以下 link 部署 Prometheus。

当我尝试在单节点 K8S 集群设置上运行它时,它运行得非常好。

http:///targets

但是,当我向 k8s 集群添加一个工作节点并尝试删除 pod 并在工作节点上创建一个新 pod 时,Prometheus 不知何故无法工作。

输出:

链接:

http:/targets

这是我的配置:

[![在此处输入图片描述][6]][6]

2:

【问题讨论】:

    标签: docker kubernetes prometheus


    【解决方案1】:

    在我看来,您的问题在于目标。至少你应该验证这一点。

    现在你只能从localhost:9090 抓取。但是http:< worker-node-IP > 呢?

    来自Querying multi-target exporters with Prometheus

    我们在静态配置下添加实际目标:targets。我们还使用 几个,因为我们现在可以做到:

      static_configs:
        - targets:
          - http://prometheus.io    # Target to probe with http
          - https://prometheus.io   # Target to probe with https
          - http://example.com:8080 # Target to probe with http on port 8080
    

    你的版本是

      static_configs:
        - targets:
          - localhost:9090
          - worker-node-IP:9090
    

    【讨论】:

    • 您好,感谢您的回复。我尝试更新配置,但仍然无法正常工作。
    • 按照您的建议更新了问题中的配置
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多