Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Connection refused for KubeProxy

The metrics bind address of kube-proxy is default toto 127.0.0.1:10249that  that prometheus instancescannotaccess instances cannot access to. You should expose metrics by changingchanging metricsBindAddressfield  field value toto 0.0.0.0:10249if  if you want to collect them. To  To perform the modification, we access, in editing mode, the kube-proxy configmap ConfigMap

Code Block
languageyml
titleEdit cm kube-proxy
collapsetrue
# We access the ConfigMap via the command "$ kubectl edit cm kube-proxy -n kube-system" and then
apiVersion: v1
data:
  config.conf: |-
.
.
.
    kind: KubeProxyConfiguration
    metricsBindAddress: 0.0.0.0:10249 # <--- Edit this field
.
.
.

You have to restart the pods otherwise they do not get the configuration. Therefore we perform a rollout of the kube-proxy DaemonSet

Code Block
languagebash
titleRestart ds kube-proxy
collapsetrue
$ kubectl rollout restart ds kube-proxy -n kube-system
# You can check the status by
$ kubectl rollout status ds kube-proxy -n kube-system

...