external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

panic when scaling up cluster

Open redbaron opened this issue 6 months ago • 0 comments
trafficstars

What happened:

when scaling up Linode LKE cluster with external-dns running and pod source configured, I have encountered following panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x1b0 pc=0x10659b084]

goroutine 1 [running]:
sigs.k8s.io/external-dns/source.(*podSource).Endpoints(0x140005140e0, {0x1077c6e68?, 0x1086da720?})
	/Users/yamlcoder/repos/external-dns/source/pod.go:116 +0x7f4
sigs.k8s.io/external-dns/source.(*multiSource).Endpoints(0x14000704000, {0x108c3f2c0, 0x140007042a0})
	/Users/yamlcoder/repos/external-dns/source/multisource.go:36 +0x98
sigs.k8s.io/external-dns/source.(*dedupSource).Endpoints(0x14000502550, {0x108c3f2c0, 0x140007042a0})
	/Users/yamlcoder/repos/external-dns/source/dedupsource.go:43 +0x8c
sigs.k8s.io/external-dns/source.(*nat64Source).Endpoints(0x14000704030, {0x108c3f2c0, 0x140007042a0})
	/Users/yamlcoder/repos/external-dns/source/nat64source.go:55 +0x1b8

What you expected to happen:

Smooth sailing

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Failing code ignores error from Lister call and attempts to dereference nil pointer because of that:

node, _ := ps.nodeInformer.Lister().Get(pod.Spec.NodeName)
for _, address := range node.Status.Addresses {

Environment:

  • External-DNS version (use external-dns --version): https://github.com/kubernetes-sigs/external-dns/commit/8d8f81369f02beeba479944e26f55dfbcb53195d
  • DNS provider: Linode
  • Others: pod source, Linode Kubernets 1.32.1

redbaron avatar May 15 '25 10:05 redbaron