Skip to content

Kured crashes when removing label #1281

@jjacobs-poa

Description

@jjacobs-poa

We have configured Kured to set a certain label and remove it after the reboot. We defined it as follows in the helm chart:

    configuration:
      logFormat: "json" # log format specified as text or json, defaults to text
      preRebootNodeLabels:
        - "node.kubernetes.io/exclude-from-external-load-balancers"
      # labels to add to nodes after uncordoning (default [])
      postRebootNodeLabels:
        - "node.kubernetes.io/exclude-from-external-load-balancers-"
      concurrency: 1 # amount of nodes to concurrently reboot. (default 1)

We noticed the label got set before the reboot, but after the reboot and after the uncordon stage, kured crashes and we think it's because it's trying to remove the label. Error message:

{"level":"info","msg":"Uncordoning node k8sdevops-master-lib-01.redacted.local","time":"2026-02-02T14:36:03Z"}
panic: runtime error: index out of range [1] with length 1

goroutine 21 [running]:
main.updateNodeLabels(0xc0003ddc00, 0xc000192008, {0xc00029ab70, 0x1, 0xc00010bb10?})
        github.com/kubereboot/kured/cmd/kured/main.go:541 +0x714
main.uncordon(0xc0003ddc00, 0xc000192008)
        github.com/kubereboot/kured/cmd/kured/main.go:477 +0x16e
main.rebootAsRequired({0xc00005205e, 0x39}, {0x22b8dc0, 0xc000419380}, {0x22b8da0, 0xc00029b670}, {0x0, 0x0, 0xc0001c4f50?}, 0xc00027fcc0, ...)
        github.com/kubereboot/kured/cmd/kured/main.go:584 +0x305
created by main.main in goroutine 1
        github.com/kubereboot/kured/cmd/kured/main.go:288 +0x1e65

Once we removed the postRebootNodeLabels again, Kured did no longer crash.

We assumed Kured followed the same logic as kubectl when removing a label, by adding a "minus-sign" at the end. If this is not the correct way, could you please explain how to remove a label. I could not find a clear answer in the docs.

We use version 1.20.0 btw

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepThis won't be closed by the stale bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions