gpt4 book ai didi

kubernetes - 所有 Kubernetes 代理目标都关闭 - Prometheus Operator

转载 作者:行者123 更新时间:2023-12-03 23:27:36 24 4
gpt4 key购买 nike

我在 openstack 中部署了一个 k8s 集群。我已经为它部署了 Prometheus operator 来监控集群。但是我收到了所有节点的 Kubernetes 代理停机警报。

我想知道 Prometheus operator 如何抓取 Kubernetes 代理的基础知识?还想知道需要做哪些配置来修复它。

我可以看到 kube 代理正在 10249 端口的所有节点中运行。

错误:

Get http://10.8.10.11:10249/metrics: dial tcp 10.8.10.11:10249: connect: connection refused

HELM 值配置
kubeProxy:
enabled: true

## If your kube proxy is not deployed as a pod, specify IPs it can be found on
##
endpoints: []
# - 10.141.4.22
# - 10.141.4.23
# - 10.141.4.24

service:
port: 10249
targetPort: 10249
# selector:
# k8s-app: kube-proxy

serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
##
interval: ""

## Enable scraping kube-proxy over https.
## Requires proper certs (not self-signed) and delegated authentication/authorization checks
##
https: false

最佳答案

为 metric-bind-address 设置 kube-proxy 参数

$ kubectl edit cm/kube-proxy -n kube-system

...
kind: KubeProxyConfiguration
metricsBindAddress: 0.0.0.0:10249
...

$ kubectl delete pod -l k8s-app=kube-proxy -n kube-system

关于kubernetes - 所有 Kubernetes 代理目标都关闭 - Prometheus Operator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60734799/

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