Commit Graph

559 Commits

Author SHA1 Message Date
Hemant Kumar
dc9e64c31e Implement return status codes 2019-12-02 12:02:27 -05:00
Hemant Kumar
34a6007dfe Add code to mark volume as uncertain
Update bazel files
Add tests for volume mounts in uncertain state
2019-12-02 12:01:40 -05:00
Hemant Kumar
a795f3de88 Add code for introducing uncertain state of mounts
Add a comment about volumestate
2019-12-02 11:57:40 -05:00
Travis Rhoden
0c5c3d8bb9
Remove pkg/util/mount (moved out of tree)
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.
2019-11-15 08:29:12 -07:00
Kubernetes Prow Robot
372ebd24f5
Merge pull request #83098 from ddebroy/disable-intree
CSI Migration phase 2: disable probing of in-tree plugins
2019-11-14 20:51:42 -08:00
Deep Debroy
129f15328b Disable in-tree plugins migrated to CSI
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-11-14 17:28:21 -08:00
Masaki Kimura
a275026ad4 Split CustomBlockVolumeMapper and CustomBlockVolumeUnmapper
- Move SetUpDevice to BlockVolumeStager
  - Move MapPodDevice to BlockVolumePublisher
  - Move TearDownDevice to BlockVolumeUnstager
  - Move UnmapPodDevice to BlockVolumeUnpublisher
  - Implement BlockVolumePublisher only in local and csi plugin
  - Implement BlockVolumeUnstager only in fc, iscsi, rbd, and csi plugin
  - Implement BlockVolumeStager and BlockVolumeUnpublisher only in csi plugin
2019-11-14 22:01:19 +00:00
Masaki Kimura
f363a03f0b Refactor BlockVolumeMapper and BlockVolumeUnmapper interface
- Rename MapDevice to MapPodDevice in BlockVolumeMapper
- Add UnmapPodDevice in BlockVolumeUnmapper (This will be used by csi driver later)
- Add CustomBlockVolumeMapper and CustomBlockVolumeUnmapper interface
- Move SetUpDevice and MapPodDevice to CustomBlockVolumeMapper
- Move TearDownDevice and UnmapPodDevice to CustomBlockVolumeUnmapper
- Implement CustomBlockVolumeMapper only in local and csi plugin
- Implement CustomBlockVolumeUnmapper only in fc, iscsi, rbd, and csi plugin
- Change MapPodDevice to return path and SetUpDevice not to return path
2019-11-14 22:01:11 +00:00
Masaki Kimura
560d9c56eb Change mount.NewOSExec to utilexec.New 2019-11-14 15:58:27 +00:00
Masaki Kimura
8a09460c2f Change getDeviceMajorMinor to use unix.Stat 2019-11-14 15:58:27 +00:00
Masaki Kimura
aee875a855 Fix error messages in operation_generator.go 2019-11-14 15:58:27 +00:00
Masaki Kimura
a2cbc028f4 Remove remaining empty file in unmapBindMountDevice 2019-11-14 15:58:27 +00:00
Masaki Kimura
dd945424e1 Rename IsBindMountExist to IsDeviceBindMountExist 2019-11-14 15:58:26 +00:00
Masaki Kimura
bee6514d79 Remove klog for output error instead return err with context 2019-11-14 15:58:26 +00:00
Masaki Kimura
7abb704e7b Improve comments for volume path hanlder and volume.go 2019-11-14 15:58:26 +00:00
Masaki Kimura
5a351e3014 Check and return error first in IsSymlinkExist and IsBindMountExist 2019-11-14 15:58:26 +00:00
Masaki Kimura
8a159d7253 Move MapBlockVolume call to operation_generator and add UnmapBlockVolume 2019-11-14 15:58:26 +00:00
Masaki Kimura
68be3947b8 Make descriptor lock per pod and release it per pod
This change is needed to avoid unmapVolumeFunc for one pod blocked,
when the lock for the same volume is taken for another pod.
2019-11-14 15:58:26 +00:00
Masaki Kimura
2ecdc5e8d1 Change globalMapPath to bind mount from symlink
This change is needed to make descriptor lock per pod, in the next commit.
If losetup is called for symlink, path in the output for losetup is resolved,
as a result, we can't distinguish which path the lock is taken.
2019-11-14 15:58:26 +00:00
Travis Rhoden
367f879131
Retire mount.Exec for k8s.io/utils/exec
This patch removes mount.Exec entirely and instead uses the common
utility from k8s.io/utils/exec.

The fake exec implementation found in k8s.io/utils/exec differs a bit
than mount.Exec, with the ability to pre-script expected calls to
Command.CombinedOutput(), so tests that previously relied on a callback
mechanism to produce specific output have been updated to use that
mechanism.
2019-11-13 14:09:57 -07:00
Travis Rhoden
1fd8921546
Move mount/fake.go to mount/fake_mount.go
This patch moves fake.go to mount_fake.go, and follows to principle of
always returning a discrete type rather than an Interface. All callers
of "FakeMounter" are changed to instead use "NewFakeMounter()". The
FakeMounter "Log" struct member is changed to not be exported, and
instead only access through a new "GetLog()" method.
2019-11-08 08:07:41 -07:00
Janario Oliveira
c9e97151b3 Changed unmount function for subpath with dirs 2019-11-07 10:05:26 +01:00
Janario Oliveira
cb0ab22b2e Added test case for subpath mount with file 2019-11-07 10:05:26 +01:00
Janario Oliveira
2ca213579d Renamed function 2019-11-07 10:05:26 +01:00
Janario Oliveira
439ce51441 Changed test case to use filepath.Walk 2019-11-07 10:05:26 +01:00
Janario Oliveira
67ec00d6b8 Unmount subpath should only scan the first level dir 2019-11-07 10:05:26 +01:00
Jordan Liggitt
297570e06a hack/update-vendor.sh 2019-11-06 17:42:34 -05:00
Kubernetes Prow Robot
08410cbf06
Merge pull request #84365 from codenrhoden/rm-mount-container
Remove Alpha feature MountContainers
2019-11-03 21:29:41 -08:00
Kubernetes Prow Robot
a45917008f
Merge pull request #84301 from yutedz/pvc-expand-fail
Add event for pvc in case node expansion fails
2019-10-28 14:09:29 -07:00
Travis Rhoden
2e054a4f4c
Remove Alpha feature Mount Containers
The alpha feature for mount containers is unused, and is
superseded by CSI. By removing it, we can remove a lot of unnecessary
code, and also clean up the mount library even more before moving it out
of tree.
2019-10-25 09:25:13 -06:00
Ted Yu
e8bd5c7785 Add event for pvc in case node expansion fails 2019-10-24 09:11:01 -07:00
Kubernetes Prow Robot
900c0cf0b6
Merge pull request #84137 from cwdsuzhou/Octo/add_success_events
Add an event to pvc when node expand successfully
2019-10-24 07:33:15 -07:00
Kubernetes Prow Robot
18cef954a1
Merge pull request #83591 from jingxu97/Oct/cache
Flush data cache during unmount device for GCE-PD in Windows
2019-10-21 21:11:36 -07:00
caiweidong
909be01bd6 Add an event to pvc when node expand successfully 2019-10-21 11:33:46 +08:00
Jing Xu
1636b2b452 Flush data cache during unmount device for GCE-PD in Windows
This PR fixes the issue mentioned in #83590 for GCE-PD. It uses
WriteVolumeCache API to writes the file system cache to disk during
UnmountDevice in Windows. Linux does not need to explicitly flush cache
because unmount will automatically sync the disk which also flush the
cache.

Change-Id: Ife2745c92b8c0446e79a52e9f9ec7851d2f6b90d
2019-10-16 10:12:35 -07:00
Bob Killen
6e68d80013
Prune inactive owners from pkg/volume/* OWNERS files. 2019-10-13 08:44:11 -04:00
Kubernetes Prow Robot
14e5adfc85
Merge pull request #82683 from davidz627/fix/translationStruct
Refactor CSI Translation Library into a struct that is injected into various components to simplify unit testing
2019-09-29 10:11:37 -07:00
David Zhu
92cb06a2e7 Refactor CSI Translation Library into a struct that is injected into various components to simplify unit testing in future 2019-09-27 12:59:53 -07:00
chenyaqi01
66be69bb0e replace bytes.Compare() with bytes.Equal() 2019-09-27 10:08:49 +08:00
Kubernetes Prow Robot
8a106a5714
Merge pull request #82994 from yutedz/rm-persist-vol-mode
Remove unused func GetPersistentVolumeClaimVolumeMode
2019-09-25 13:51:04 -07:00
Ted Yu
ba45f73c1f Remove unused func GetPersistentVolumeClaimVolumeMode 2019-09-22 08:54:01 -07:00
hwdef
386f981116 fix(pkg): delete unused var or const 2019-09-21 17:13:13 +08:00
Kubernetes Prow Robot
3a19f1e80b
Merge pull request #82472 from draveness/feature/remove-feature-gates-in-1-17
feat: cleanup several GA feature flags which should be removed in 1.17
2019-09-17 06:58:24 -07:00
Kubernetes Prow Robot
d1c6898ab5
Merge pull request #82474 from cwdsuzhou/du_one_file_system
Add -x to du commands to not traverse other file systems
2019-09-11 18:29:45 -07:00
Kubernetes Prow Robot
60bc301889
Merge pull request #81613 from tedyu/op-exec-vol-cont
Continue with remaining volumeAttached's in VerifyVolumesAreAttached
2019-09-10 14:31:33 -07:00
Ted Yu
8819a4b6b4 Continue with remaining volumeAttached's in VerifyVolumesAreAttached 2019-09-09 15:52:53 -07:00
draveness
2c0d6053fa feat: remove PersistentLocalVolumes feature gates 2019-09-09 08:10:27 +08:00
Travis Rhoden
935c23f2ad
Move HostUtil to pkg/volume/util/hostutil
This patch moves the HostUtil functionality from the util/mount package
to the volume/util/hostutil package.

All `*NewHostUtil*` calls are changed to return concrete types instead
of interfaces.

All callers are changed to use the `*NewHostUtil*` methods instead of
directly instantiating the concrete types.
2019-08-30 10:14:42 -06:00
Kubernetes Prow Robot
96439cc97f
Merge pull request #82028 from codenrhoden/rename-isbind
Rename mount.IsBind to mount.MakeBindOpts
2019-08-30 00:43:32 -07:00
Kubernetes Prow Robot
4170a19749
Merge pull request #81437 from jingxu97/Aug/metricfs
Fix Windows disk usage metric measurement
2019-08-29 21:21:59 -07:00
Jing Xu
3b7e696c2f Fix Windows disk usage metric measurement
This PR will fix issue #81088. The current fs_windows utility reports
the whole file system usage instead of specific file path. This PR fix
this and walk the dir tree under the file path and collect the disk
usage.

Change-Id: I502ccf0af4bd07be69b61be043be616660499e4d
2019-08-29 15:37:25 -07:00
Han Kang
6f70f781df add some documentation around the metrics stability migration changes for clarity 2019-08-28 11:17:33 -07:00
Han Kang
3a50917795 migrate kubelet's metrics/probes & metrics endpoint to metrics stability framework 2019-08-28 11:16:38 -07:00
Travis Rhoden
ef855c7c08
Rename mount.IsBind to mount.MakeBindOpts 2019-08-27 11:34:42 -06:00
Travis Rhoden
a30ba6197d
Internalize mount.Interface.IsMountPointMatch
IsMountPointMatch() had no callers outside of the mount package, and has
internal implementation details. This patch makes it no longer be
public.
2019-08-26 09:47:07 -06:00
Kubernetes Prow Robot
f105fef3d5
Merge pull request #81429 from huffmanca/resize_block_volume
Enables resizing of block volumes.
2019-08-23 17:59:05 -07:00
Kubernetes Prow Robot
b55f3252e1
Merge pull request #81843 from codenrhoden/remove-nsenter
Remove nsenter impl from pkg/vol/util
2019-08-23 15:49:06 -07:00
Travis Rhoden
dde8a6f7f6
Remove nsenter impl from pkg/vol/util
With the removal of the `--containerized` flag from kubelet, nothing
uses this code anymore.
2019-08-23 10:09:49 -06:00
Lee Verberne
b465d579de Add ephemeral container to GetPodVolumeNames test 2019-08-23 13:36:22 +00:00
Kubernetes Prow Robot
f1453953b7
Merge pull request #81745 from codenrhoden/mv-hasmountrefs
mv HasMountRefs from mount pkg to vol/util
2019-08-23 00:52:13 -07:00
Hemant Kumar
9dbe0b3ad8 Fix devicePath for raw block expansion
Fix tests
2019-08-22 22:48:46 -04:00
Christian Huffman
7a4cdf5ab2 Included resizing for CSI-based block volumes.
Perform a no-op when volume is of type raw block

Fix bug with checking volume mounts for readonly
2019-08-22 15:45:57 -04:00
Travis Rhoden
a7830a2c6e
mv HasMountRefs from mount pkg to vol/util
HasMountRefs is only used internal to K8s and should not be moved out
with the mount package. move it to pkg/volume/util instead.
2019-08-21 14:53:34 -06:00
Michelle Au
fa822f3c51 Use VisitContainers instead of directly accessing pod container fields
Change-Id: I354513683e7b5bf4d1837f567ef0e84b17f6e174
2019-08-20 11:16:35 -07:00
Jan Safranek
8d580262f9 Refactor makeMountsMap into GetPodVolumeNames
The function will be handy in subsequent patches. Also change custom maps
into sets.String.
2019-08-15 10:48:38 +02:00
Kubernetes Prow Robot
76e19a1619
Merge pull request #81204 from codenrhoden/rename-hu-pathexists
Rename HostUtils.ExistsPath to PathExists
2019-08-12 20:12:12 -07:00
Travis Rhoden
0e73131ca6
Rename HostUtils.GetFSGroup to HostUtils.GetOwner
This patch renames GetFSGroup (a process property) to GetOwner (a file
property), returning both the uid and gid of the given pathname. This
method is only used in one place in the k/k codebase, but having
"GetOwner" instead of "GetGroup" seems to have more utility.
2019-08-09 13:20:35 -06:00
Travis Rhoden
14e25b7c04
Rename HostUtils.ExistsPath to PathExists 2019-08-09 12:40:19 -06:00
Eytan Heidingsfeld
6a94d50fb3 Add -s to du commands to not traverse other file systems 2019-08-06 14:59:19 +08:00
Masaki Kimura
c130b77a48 Move nil check for mapperPlugin earlier in reconstructVolume 2019-08-01 20:36:21 +00:00
Jan Safranek
bab81b809b Don't create mounter when reconstructing block volume
CSI mounter will create a new directory + json for a filesystem volume,
leading to even more orphaned files/directories.
2019-08-01 20:04:10 +00:00
David Zhu
290a7f12ce Add migration shim for VerifyVolumesAreAttached and BulkVolumeVerify 2019-07-23 12:57:47 -07:00
Kubernetes Prow Robot
2bf8ab13c4
Merge pull request #80048 from davidz627/fix/tests
Fixes mount/unmount paths for migrated inline volumes
2019-07-12 20:19:17 -07:00
David Zhu
2820c1d8c8 Add davidz627 (David Zhu) to Approvers for OperationExecutor and GCE PD 2019-07-11 13:14:31 -07:00
David Zhu
93d6356d2f Fixes mount/unmount paths for migrated inline volumes. Some minor fixes for GCE specific inline migrated volumes 2019-07-11 11:51:43 -07:00
Kubernetes Prow Robot
514a157adf
Merge pull request #74691 from cpuguy83/epoll_use_cloexec
Use EPOLL_CLOEXEC to prevent fd leaks.
2019-07-10 21:38:55 -07:00
Kubernetes Prow Robot
d59a603f1b
Merge pull request #78267 from mucahitkurt/cleanup/operation-generator-migration-scenarios-unit-tests
unit tests for operationGenerator.GenerateUnmapVolumeFunc
2019-07-09 18:20:25 -07:00
Brian Goff
0051db89a7 Use O_CLOEXEC for volume subpath util
This prevents fd's from leaking to subprocesses.
2019-07-09 10:03:59 -07:00
Kubernetes Prow Robot
a5e3d74691
Merge pull request #79534 from odinuge/volume-util-fd
Fix possible fd leak and closing of dirs in doSafeMakeDir
2019-07-01 15:09:58 -07:00
Kubernetes Prow Robot
2501a9083d
Merge pull request #68513 from codenrhoden/mount-refactor
Refactor util/mount interface in prep for moving out of k/k
2019-06-28 13:57:28 -07:00
Odin Ugedal
626a0f7b4b Fix closing of dirs in doSafeMakeDir
This fixes the issue where "childFD" from syscall.Openat is assigned to
a local variable inside the for loop, instead of the correct one in the
function scope. This results in that when trying to close the "childFD"
in the function scope, it will be equal to "-1", instead of the correct
value.
2019-06-28 18:21:12 +02:00
Lee Verberne
a0b57ad3db Update BUILD files for container helper 2019-06-21 08:32:04 +00:00
Lee Verberne
ee821e2a04 Create helpers for iterating containers in a pod 2019-06-21 08:32:04 +00:00
Travis Rhoden
be7da5052f Refactor pkg/util/mount to be more reusable
This patch refactors pkg/util/mount to be more usable outside of
Kubernetes. This is done by refactoring mount.Interface to only contain
methods that are not K8s specific. Methods that are not relevant to
basic mount activities but still have OS-specific implementations are
now found in a mount.HostUtils interface.
2019-06-14 09:35:18 -06:00
Kubernetes Prow Robot
518f16636f
Merge pull request #78593 from RobertKrawitz/ephemeral-storage-quota-cleanup
Ephemeral storage quota cleanup
2019-06-14 05:33:18 -07:00
Mucahit Kurt
db1c07750a unit tests for the volume plugin name that's used inside GeneratedUnmapVolumeFunc for csi migration on/off scenarios
Signed-off-by: Mucahit Kurt <mucahitkurt@gmail.com>
2019-06-11 08:32:25 +03:00
Kubernetes Prow Robot
333081e79c
Merge pull request #78595 from gnufied/fix-aws-dangling-volumes
Add dangling volume as uncertain
2019-06-06 16:47:59 -07:00
Hemant Kumar
7bcebe98bb Add dangling volume as uncertain 2019-06-06 15:25:10 -04:00
Kubernetes Prow Robot
8657b24d86
Merge pull request #78681 from yuxiangqian/e2efix
fix label mismatching which broke e2e serial test
2019-06-04 10:53:21 -07:00
xiangqian
d616c6fb5a fix label mismatching which broke e2e serial test 2019-06-03 23:33:37 -07:00
Hemant Kumar
0f62e3fbe8 Make language of error msgs and func names consistent: ExpandVolumeInUse
change feature flag
Fix the e2e test for online and offline expansion
2019-06-03 12:26:56 -04:00
Kubernetes Prow Robot
b3c1bbb471
Merge pull request #78061 from yuxiangqian/metrics
Enhance to record more accurate e2e provision/deletion latency metric
2019-05-31 20:45:13 -07:00
Kubernetes Prow Robot
b7fa33ec15
Merge pull request #77703 from ddebroy/inline-mig-1
API changes to support migration of inline in-tree volumes to CSI
2019-05-31 12:23:19 -07:00
Robert Krawitz
bf1f0fa5d9 Remove pod UID from volumeMount, we can get it elsewhere 2019-05-31 14:25:01 -04:00
Robert Krawitz
10d37bb748 Rename pkg/volume/util/quota -> pkg/volume/util/fsquota 2019-05-31 13:57:44 -04:00
Kubernetes Prow Robot
cf76868b34
Merge pull request #66928 from RobertKrawitz/ephemeral-storage-quota-exp
Ephemeral storage monitoring via filesystem quotas
2019-05-30 20:44:26 -07:00
Deep Debroy
de7be9d613 Populate InlineVolumeSpec in CSI attacher and translation library
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-05-30 09:35:22 +00:00
Kubernetes Prow Robot
05df640f33
Merge pull request #77994 from gnufied/csi-resize-migration
Handle CSI volume resize migration.
2019-05-29 21:28:43 -07:00
xiangqian
9688511595 record provision and deletion latency metric
instead of using provisioner from storage class directly, uses plugin name firstly
2019-05-29 14:15:30 -07:00
Robert Krawitz
f8661d6240 Use xfs_quota command to apply quotas 2019-05-29 15:12:28 -04:00