Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm upgrade node panics if config has KubeletConfiguration #3161

Closed
nadiamoe opened this issue Feb 15, 2025 · 1 comment · Fixed by kubernetes/kubernetes#130202
Closed
Labels
area/upgrades kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@nadiamoe
Copy link

[root@moniserver ~]# kubeadm --config /etc/kubernetes/kubeadm.yaml upgrade node
W0215 12:30:36.826324  766880 upgradeconfiguration.go:135] [config] WARNING: YAML document with Component Configs kubelet.config.k8s.io is deprecated for upgrade and will be ignored
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5f2c6db5b612]

goroutine 1 [running]:
k8s.io/kubernetes/cmd/kubeadm/app/util/config.prepareStaticVariables({0x5f2c6e75d560, 0x0})
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/util/config/common.go:398 +0x152
k8s.io/kubernetes/cmd/kubeadm/app/util/config.LoadOrDefaultUpgradeConfiguration({0x7ffd1cac1d91, 0x1c}, 0xc00074fba0, {0x0, 0x0})
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/util/config/upgradeconfiguration.go:160 +0x1a5
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newNodeData(0xc000776908, 0xc000458910, {0x5f2c6e890ae8, 0xc00007c030})
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/cmd/upgrade/node.go:184 +0x3ba
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newCmdNode.func2(0xc000776908, {0xc00006d720, 0x0, 0x2})
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/cmd/upgrade/node.go:127 +0x9b
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).InitData(0xc00016e240, {0xc00006d720, 0x0, 0x2})
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/cmd/phases/workflow/runner.go:185 +0xd8
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.newCmdNode.func1(0xc000776908, {0xc00006d720, 0x0, 0x2})
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/cmd/upgrade/node.go:90 +0xce
github.com/spf13/cobra.(*Command).execute(0xc000776908, {0xc00006d700, 0x2, 0x2})
	/build/kubernetes/src/kubernetes-1.32.1/vendor/github.com/spf13/cobra/command.go:985 +0xfca
github.com/spf13/cobra.(*Command).ExecuteC(0xc000452608)
	/build/kubernetes/src/kubernetes-1.32.1/vendor/github.com/spf13/cobra/command.go:1117 +0x9d0
github.com/spf13/cobra.(*Command).Execute(0xc000452608)
	/build/kubernetes/src/kubernetes-1.32.1/vendor/github.com/spf13/cobra/command.go:1041 +0x32
k8s.io/kubernetes/cmd/kubeadm/app.Run()
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/app/kubeadm.go:47 +0xd1
main.main()
	/build/kubernetes/src/kubernetes-1.32.1/cmd/kubeadm/kubeadm.go:25 +0x13
[root@moniserver ~]# cat /etc/kubernetes/kubeadm.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
# Use a resolv.conf file without the curry domain/search to prevent ndots spam.
resolvConf: /etc/resolv-k8s.conf
# Wait this duration for pods to gracefully terminate.
shutdownGracePeriod: 120s
# Of the duration above, the following duration will be reserved for terminating critical pods after non-critical ones.
shutdownGracePeriodCriticalPods: 20s

Not specifying a --config with KubeletConfiguration for this operation works around the issue, but I thin it would be best if the config was gracefully ignored as the log message indicates.

@neolit123 neolit123 added kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. area/upgrades labels Feb 15, 2025
@neolit123
Copy link
Member

neolit123 commented Feb 15, 2025

kubeletconfig on upgrade is not supported but the panic should be fixed. we should also backport the fix for >= 1.31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/upgrades kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants