简体   繁体   English

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

[英]All Kubernetes proxy targets down - Prometheus Operator

I have a k8s cluster deployed in openstack.我在 openstack 中部署了一个 k8s 集群。 I have deployed Prometheus operator for it to monitor the cluster.我已经为它部署了 Prometheus operator 来监控集群。 But I am getting Kubernetes proxy down alert for all the nodes.但是我收到了所有节点的 Kubernetes 代理停机警报。

I would like to know basics of how Prometheus operator scrapes Kubernetes proxy?我想知道 Prometheus operator 如何抓取 Kubernetes 代理的基础知识? also would like to know what configurations needs to be done to fix it.还想知道需要做哪些配置来修复它。

I can see that kube proxy is running in all nodes at 10249 port.我可以看到 kube 代理正在 10249 端口的所有节点中运行。

Error :错误 :

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

HELM values configuration 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

Set the kube-proxy argument for metric-bind-address为 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM