mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Fix volume reconstruction in standalone mode
Kubelet in standalone mode won't have kubeclient, it cannot get node.status and get devices from it. Such a kubelet cannot mount attachable volumes anyway.
This commit is contained in:
parent
c8f001d798
commit
c4f8c3f628
@ -180,6 +180,14 @@ func (rc *reconciler) cleanOrphanVolumes() {
|
|||||||
func (rc *reconciler) updateReconstructedDevicePaths() {
|
func (rc *reconciler) updateReconstructedDevicePaths() {
|
||||||
klog.V(4).InfoS("Updating reconstructed devicePaths")
|
klog.V(4).InfoS("Updating reconstructed devicePaths")
|
||||||
|
|
||||||
|
if rc.kubeClient == nil {
|
||||||
|
// Skip reconstructing devicePath from node objects if kubelet is in standalone mode.
|
||||||
|
// Such kubelet is not expected to mount any attachable volume or Secrets / ConfigMap.
|
||||||
|
klog.V(2).InfoS("Skipped reconstruction of DevicePaths from node.status in standalone mode")
|
||||||
|
rc.volumesNeedDevicePath = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
node, fetchErr := rc.kubeClient.CoreV1().Nodes().Get(context.TODO(), string(rc.nodeName), metav1.GetOptions{})
|
node, fetchErr := rc.kubeClient.CoreV1().Nodes().Get(context.TODO(), string(rc.nodeName), metav1.GetOptions{})
|
||||||
if fetchErr != nil {
|
if fetchErr != nil {
|
||||||
// This may repeat few times per second until kubelet is able to read its own status for the first time.
|
// This may repeat few times per second until kubelet is able to read its own status for the first time.
|
||||||
|
Loading…
Reference in New Issue
Block a user