Commit Graph

77 Commits (750881c0ab62a9f59d53582bc33826caa167aa83)

Author SHA1 Message Date
danielqsj 657a1a1a34 change import alias of utils/strings 2019-01-30 10:44:09 +08:00
danielqsj 093328e57f migrate to k8s.io/utils/strings 2019-01-30 10:24:00 +08:00
Kubernetes Prow Robot cc1be28943
Merge pull request #72624 from danielqsj/clean_unmount
Cleanup callers of deprecated functions in volume/util
2019-01-28 23:06:20 -08:00
David Zhu d8c9dc5bb5 Add IsMigratableToCSI to volume plugin interface 2019-01-17 14:43:52 -08:00
danielqsj d94cd822b7 Cleanup UnmountPath/UnmountMountPoint callers 2019-01-08 22:13:50 +08:00
Davanum Srinivas 954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Slava Semushin 180535c1fc pkg/volume/nfs/nfs.go: correct error messages. 2018-03-05 12:12:51 +01:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Jan Safranek 45d21ee36b Fixed TearDown of NFS with root squash.
NFS plugin should not use IsLikelyNotMountPoint(), as it uses lstat() / stat()
to determine if the NFS volume is still mounted - NFS server may use
root_squash and kubelet may not be allowed to do lstat() / stat() there.

It must use slower IsNotMountPoint() instead, including TearDown() function.
2018-01-08 14:01:33 +01:00
zhangxiaoyu-zidif 3323861ed3 fix binary check for nfs.go 2017-11-24 10:55:03 +08:00
Jan Safranek 85495bd102 nfs: Use VolumeHost.GetExec() to execute stuff in volume plugins 2017-08-22 15:17:07 +02:00
Jan Safranek bc0e170d9c Add pluginName to VolumeHost.GetMouter
Different plugins can get different mounter, depending where the mount
utilities are.
2017-08-14 12:16:26 +02:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
mbohlool c91a12d205 Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00
zhangxiaoyu-zidif aec46961e9 nfs.go: cleancode err 2017-05-06 19:06:27 +08:00
Jamie Hannaford 9440a68744 Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
Kubernetes Submit Queue 854441643f Merge pull request #38801 from nak3/nfs-mkdir
Automatic merge from submit-queue

Catch error when failed to make directory in NFS volume plugin

NFS: Catch error when failed to make directory

Currently, NFS volume plugin doesn't catch the error from
os.MkdirAll. That makes it difficult to debug why failed to make the
directory. This patch adds error catch to os.MkdirAll.
2017-04-07 16:48:46 -07:00
Hemant Kumar 786da1de12 Impement bulk polling of volumes
This implements Bulk volume polling using ideas presented by
justin in https://github.com/kubernetes/kubernetes/pull/39564

But it changes the implementation to use an interface
and doesn't affect other implementations.
2017-03-02 14:59:59 -05:00
Hemant Kumar 2d3008fc56 Implement support for mount options in PVs
Add support for mount options via annotations on PVs
2017-03-01 11:50:40 -05:00
Kevin Griffith 9448aa66ff cleanup the volume plugin for recycle
update commit to reflect changes
2017-02-06 10:38:49 -06:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
rkouj c14d47dffe Use common unmount util func for TearDownAt() 2016-12-19 16:40:55 -08:00
Kenjiro Nakayama 13660ef701 Catch error when failed to make directory in NFS volume plugin 2016-12-15 17:04:35 +09:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
Chao Xu bb675d395f dependencies: pkg/volume 2016-11-23 15:53:09 -08:00
Jan Safranek 76755034a1 Fix recycler pod deletion race.
We should use clone of recycler pod template instead of reusing the same
one for two or more recyclers running in parallel.

Also add some logs to relevant places to spot the error easily next time.
2016-11-15 17:22:32 +01:00
Rajat Ramesh Koujalagi d81e216fc6 Better messaging for missing volume components on host to perform mount 2016-11-09 15:16:11 -08:00
pospispa dc9bb87ac7 Simplifies NFS and Host Path Plugin - Removed newRecyclerFunc, newDeleterFunc and newProvisionerFunc
struct hostPathPlugin contains newRecyclerFunc, newDeleterFunc and newProvisionerFunc items that have only one instance, i.e. newRecycler, newDeleter or newProvisioner function.

That's why the newRecyclerFunc, newDeleterFunc and newProvisionerFunc items are removed and the newRecycler, newDeleter or newProvisioner functions are called directly.

In addition, the TestRecycler tests whether NewFakeRecycler function is called and returns nil. This is no longer needed so this particular part of the test is removed. In addition, the no longer used NewFakeRecycler function is removed also.

Similarly for the NFS plugin, struct nfsPlugin contains newRecyclerFunc item that has only one instance, i.e. newRecycler function. That's why the newRecyclerFunc item is removed and the newRecycler function is called directly. In addition, the TestRecycler tests whether newMockRecycler function is called and returns nil. This is no longer needed so this particular part of the test is removed. In addition, the no longer used newMockRecycler function is removed also.
2016-11-07 10:39:04 +01:00
Jan Safranek d7111b282f Send recycle events from pod to pv.
This allows users to diagnose what's wrong with recycler. Recycler pods are
started automatically with a cryptic name and they are deleted immediately
when they finish.

kubectl describe pods will show:

  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason          Message
  ---------     --------        -----   ----                            -------------   --------        ------          -------
  59m           59m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(5421800e-347b-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  53m           53m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(3c9809e5-347c-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  46m           46m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(250dd2a2-347d-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  40m           40m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(0d84ea33-347e-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  33m           33m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(f5fb63bf-347e-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  27m           27m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(de7128fd-347f-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  1h            3m              75      {persistentvolume-controller }                  Normal          RecyclerPod     Recycler pod: Successfully assigned recycler-for-nfs to 127.0.0.1
  1h            3m              76      {persistentvolume-controller }                  Normal          RecyclerPod     Recycler pod: Pod was active on the node longer than specified deadline
  1h            1m              12      {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  20m           1m              4       {persistentvolume-controller }                  Warning         RecyclerPod     (events with common reason combined)


These steps were necessary:

- added event watcher to volume.RecycleVolumeByWatchingPodUntilCompletion

- pass all these events through volume plugins to volume controller

- rework volume.RecycleVolumeByWatchingPodUntilCompletion unit tests to a table
  (too much copy-paste)

- fix all unit tests along the way
2016-09-08 12:57:57 +02:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
saadali 542f2dc708 Introduce new kubelet volume manager
This commit adds a new volume manager in kubelet that synchronizes
volume mount/unmount (and attach/detach, if attach/detach controller
is not enabled).

This eliminates the race conditions between the pod creation loop
and the orphaned volumes loops. It also removes the unmount/detach
from the `syncPod()` path so volume clean up never blocks the
`syncPod` loop.
2016-06-15 09:34:08 -07:00
saadali 9b6a505f8a Rename UniqueDeviceName to UniqueVolumeName
Rename UniqueDeviceName to UniqueVolumeName and move helper functions
from attacherdetacher to volumehelper package.
Introduce UniquePodName alias
2016-06-15 09:32:12 -07:00
Jan Safranek 0ee9160f88 volume recycler: Don't start a new recycler pod if one already exists.
Recycling is a long duration process and when the recycler controller is
restarted in the meantime, it should not start a new recycler pod if there is
one already running.

This means that the recycler pod must have deterministic name based on name
of the recycled PV, we then get name conflicts when creating the pod.

Two things need to be changed:
- recycler controller and recycler plugins must pass the PV.Name to place,
  where the pod is created.

- create recycler pod with deterministic name and check "already exists" error.

When at it, remove useless 'resourceVersion' argument and make log messages
starting with lowercase.
2016-05-19 12:58:25 +02:00
saadali 79012f6d53 Rename volume.Builder to Mounter and volume.Cleaner to Unmounter 2016-03-25 11:29:58 -07:00
k8s-merge-robot 3f5e417999 Merge pull request #19502 from swagiaal/internalize-ownership
Auto commit by PR queue bot
2016-01-26 23:06:39 -08:00
harry 7405c7899b Add strings pkg to hold strings utils
Replace funtions with strings pkg

Fix all references and rename the pkg
2016-01-15 12:37:50 +08:00
Sami Wagiaalla 7767698459 Remove SupportsOwnershipManagement volume attribute 2016-01-13 10:37:10 -05:00
Sami Wagiaalla f650648aae Add fsGroup to SetUp and SetUpAt 2016-01-13 10:37:10 -05:00
Chakravarthy Nelluri fa76de79e5 Add support for flex volume. Flex volume adds support for thirdparty(vendor)
volumes and custom mounts.
2015-12-23 14:11:38 -08:00
Phillip Wittrock c67ce887f2 Volume Metrics Interface and base implementation.
- Add volume.MetricsProvider function to Volume interface.
- Add volume.MetricsDu for providing metrics via executing "du".
- Add volulme.MetricsNil for unsupported Volumes.
2015-12-09 16:06:24 -08:00
Paul Morie 911757486d Refactor volume.Builder.IsReadOnly() to volume.Builder.GetAttributes() 2015-11-13 23:34:48 -05:00
markturansky d3bb6575fb Revert "nfs: check if /sbin/mount.nfs* is present in CanSupport()"
This reverts commit 1b3a88dc87.
2015-11-03 16:09:57 -05:00
Sami Wagiaalla 1d352a16b8 Support volume relabling for pods which specify an SELinux label 2015-10-28 09:26:58 -04:00
Paul Morie 3cd12f5e05 FSGroup implementation 2015-10-22 16:40:59 -04:00
Huamin Chen 1b3a88dc87 nfs: check if /sbin/mount.nfs* is present in CanSupport()
Signed-off-by: Huamin Chen <hchen@redhat.com>
2015-10-21 13:47:41 -04:00
Filip Grzadkowski 7fe34f2050 Introduce nsenter writer for volume plugins 2015-09-17 16:40:29 +02:00