k3s/pkg/volume
Jing Xu b02481708a Fix volume states out of sync problem after kubelet restarts
When kubelet restarts, all the information about the volumes will be
gone from actual/desired states. When update node status with mounted
volumes, the volume list might be empty although there are still volumes
are mounted and in turn causing master to detach those volumes since
they are not in the mounted volumes list. This fix is to make sure only
update mounted volumes list after reconciler starts sync states process.
This sync state process will scan the existing volume directories and
reconstruct actual states if they are missing.

This PR also fixes the problem during orphaned pods' directories. In
case of the pod directory is unmounted but has not yet deleted (e.g.,
interrupted with kubelet restarts), clean up routine will delete the
directory so that the pod directoriy could be cleaned up (it is safe to
delete directory since it is no longer mounted)

The third issue this PR fixes is that during reconstruct volume in
actual state, mounter could not be nil since it is required for creating
container.VolumeMap. If it is nil, it might cause nil pointer exception
in kubelet.

Details are in proposal PR #33203
2016-10-25 12:29:12 -07:00
..
aws_ebs autogenerated 2016-10-21 17:32:32 -07:00
azure_dd autogenerated 2016-10-21 17:32:32 -07:00
azure_file autogenerated 2016-10-21 17:32:32 -07:00
cephfs autogenerated 2016-10-21 17:32:32 -07:00
cinder autogenerated 2016-10-21 17:32:32 -07:00
configmap autogenerated 2016-10-21 17:32:32 -07:00
downwardapi autogenerated 2016-10-21 17:32:32 -07:00
empty_dir autogenerated 2016-10-21 17:32:32 -07:00
fc autogenerated 2016-10-21 17:32:32 -07:00
flexvolume autogenerated 2016-10-21 17:32:32 -07:00
flocker autogenerated 2016-10-21 17:32:32 -07:00
gce_pd Fix volume states out of sync problem after kubelet restarts 2016-10-25 12:29:12 -07:00
git_repo autogenerated 2016-10-21 17:32:32 -07:00
glusterfs autogenerated 2016-10-21 17:32:32 -07:00
host_path autogenerated 2016-10-21 17:32:32 -07:00
iscsi autogenerated 2016-10-21 17:32:32 -07:00
nfs autogenerated 2016-10-21 17:32:32 -07:00
quobyte autogenerated 2016-10-21 17:32:32 -07:00
rbd autogenerated 2016-10-21 17:32:32 -07:00
secret autogenerated 2016-10-21 17:32:32 -07:00
testing autogenerated 2016-10-21 17:32:32 -07:00
util Fix volume states out of sync problem after kubelet restarts 2016-10-25 12:29:12 -07:00
vsphere_volume autogenerated 2016-10-21 17:32:32 -07:00
BUILD autogenerated 2016-10-21 17:32:32 -07:00
OWNERS Update pkg/volume/OWNERS to include Jan Safranek 2016-10-20 12:21:06 -05:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
metrics_cached.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
metrics_du.go Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10:00
metrics_du_test.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
metrics_errors.go Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10:00
metrics_nil.go Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10:00
metrics_nil_test.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
metrics_statfs.go Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10:00
plugins.go Pass whole PVC to provisioner plugin 2016-10-12 12:22:01 +02:00
plugins_test.go Print/log pointers of structs with %#v instead of %+v 2016-08-01 22:27:56 +02:00
util.go Send recycle events from pod to pv. 2016-09-08 12:57:57 +02:00
util_test.go Send recycle events from pod to pv. 2016-09-08 12:57:57 +02:00
volume.go Use strongly-typed types.NodeName for a node name 2016-09-27 10:47:31 -04:00
volume_linux.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
volume_unsupported.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00