Skip to content

Failed to scrape node - on public ip instead of advertised / bound api ip #1834

Description

@jerger

What happened:

On a newly installed / single node k3s (v1.36.2+k3s1) kube-system/metrics-server (v0.8.1) tries to scrap from node ip.

scraper.go:149] "Failed to scrape node" err="Get \"https://62.238.34.122:10250/metrics/resource │
│ \": dial tcp 62.238.34.122:10250: connect: connection refused" node="repo-2026-07"

What you expected to happen:

I would expect metrics-server would scrap from private ip where api is bound to.

Environment:

# deployment
    spec:
       containers:
       - args:
         - --cert-dir=/tmp
         - --secure-port=10250
         - --kubelet-insecure-tls=true
         - --kubelet-preferred-address-types=InternalIP
         - --kubelet-use-node-status-port
         - --metric-resolution=40s
         - --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE    _RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
         image: rancher/mirrored-metrics-server:v0.8.1
# /etc/rancher/k3s/config.yaml
node-ip:
  - ${node_ipv4}
  - ${node_ipv6}
bind-address: ${private_ipv4}
advertise-address: ${private_ipv4}

/kind bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions