We know that Kubernetes releases are minor and patched. For example, 20 in 1.20.7 is minor and 7 is patch. In general, the patch version contains the latest patches and security fixes for the current minor version, and users are advised to follow the patch version to upgrade.
However, in the latest patches (1.18.19, 1.19.11, 1.20.7, and 1.21.1), kubelet Panic occurred during portForward requests due to community PR 99839 not handling null Pointers properly while fixing memory leaks.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x17e78f8]
goroutine 1168860 [running]:
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy.(*connection).RemoveStreams(0xc002b30080.0xc0032f7160.0x2.0x2)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go:101 +0x78
k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward.(*httpStreamHandler).removeStreamPair(0xc00349c310.0x6c657a8.0x1)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go:168 +0x16d
k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward.(*httpStreamHandler).monitorStreamPair(0xc00349c310.0xc000f6ef50.0xc00369fd40)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go:148 +0x1fe
created by k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward.(*httpStreamHandler).run
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go:227 +0x58a
Copy the code
Therefore, the Kubernetes community recommends that users avoid upgrading to these versions.
The issue has been fixed by the community Maintenance release branch (see 102489) and will be included in the next patch release. 2021-06-16 will release 1.21.2, 1.20.8, 1.19.12 when users can upgrade to these versions to avoid the Kubelet Panic issue.
Unfortunately, the 1.18.x branch is no longer maintained, so users of 1.18.19 will need to upgrade to 1.19.x.
Welcome to search and follow the official account of Cloud native on wechat to learn more about cloud native knowledge.