Commit Graph

86 Commits (bad9f6341a093c371f71e26aa27c0f695be1ba86)

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
danielqsj 1add6b0cfa migrate to k8s.io/utils/keymutex 2019-01-30 10:23:59 +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
jianglingxia 6159bab94a
Merge branch 'master' into jlx201811031619 2018-11-17 12:53:21 +08:00
jianglingxia 0094e05975 fix golint problem of volume cephfs/iscsi/nfs 2018-11-17 12:50:47 +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
Yecheng Fu 798838a6a0 Using a fixed set of locks, then we don't need to free unused locks
anymore.
See kubernetes/kubernetes/pull/66442 for discussions.
2018-08-24 12:24:09 +08:00
Ben Swartzlander 6d23d8edbb Avoid deleted iSCSI LUNs in the kernel
This change ensures that iSCSI block devices are deleted after
unmounting, and implements scanning of individual LUNs rather
than scanning the whole iSCSI bus.

In cases where an iSCSI bus is in use by more than one attachment,
detaching used to leave behind phantom block devices, which could
cause I/O errors, long timeouts, or even corruption in the case
when the underlying LUN number was recycled. This change makes
sure to flush references to the block devices after unmounting.

The original iSCSI code scanned the whole target every time a LUN
was attached. On storage controllers that export multiple LUNs on
the same target IQN, this led to a situation where nodes would
see SCSI disks that they weren't supposed to -- possibly dozens or
hundreds of extra SCSI disks. This caused 3 significant problems:

1) The large number of disks wasted resources on the node and
caused a minor drag on performance.
2) The scanning of all the devices caused a huge number of uevents
from the kernel, causing udev to bog down for multiple minutes in
some cases, triggering timeouts and other transient failures.
3) Because Kubernetes was not tracking all the "extra" LUNs that
got discovered, they would not get cleaned up until the last LUN
on a particular target was detached, causing a logout. This led
to significant complications:

In the time window between when a LUN was unintentially scanned,
and when it was removed due to a logout, if it was deleted on the
backend, a phantom reference remained on the node. In the best
case, the phantom LUN would cause I/O errors and timeouts in the
udev system. In the worst case, the backend could reuse the LUN
number for a new volume, and if that new volume were to be
scheduled to a pod with a phantom reference to the old LUN by the
same number, the initiator could get confused and possibly corrupt
data on that volume.

To avoid these problems, the new implementation only scans for
the specific LUN number it expects to see. It's worth noting that
the default behavior of iscsiadm is to automatically scan the
whole bus on login. That behavior can be disabled by setting
node.session.scan = manual
in iscsid.conf, and for the reasons mentioned above, it is
strongly recommended to set that option. This change still works
regardless of the setting in iscsid.conf, and while automatic
scanning will cause some problems, this change doesn't make the
problems any worse, and can make things better in some cases.
2018-07-24 23:58:19 -04:00
Yecheng Fu c542b6be5d Remove mount.GetMountRefs in favor of mounter.GetMountRefs 2018-06-20 17:01:27 +08:00
Vladimir Vivien 3569287993 Refactor of GenerateMapDeviceFunc to delegate Map call to volume plugin. 2018-06-03 17:25:37 -04:00
Humble Chirammal 2f9f78206e Add volumemetrics for ISCSI Plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-03-15 13:40:50 +05:30
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
linyouchong e92f6eb0fe fix incorrect logic in canSupport 2018-02-09 11:45:15 +08:00
Mitsuhiro Tanino a6d979dd88 Block volumes Support: iSCSI plugin update
This patch adds block volume support to iSCSI volume plugin.
2018-01-10 11:38:36 -05:00
supereagle 032416c75d use core client with explicit version
fix more usage of deprecated core client
2017-11-25 08:14:10 +08:00
Huamin Chen bb34a0b7ef use SecretObject to reference iSCSI CHAP secret
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-11-18 20:02:44 +00:00
mtanino 629718ef0b Refactoring and improvements for iSCSI and FC
This PR makes following changes.

- Simplify volume tearDown path for iSCSI and FC using
  util.UnmountPath().
- Log lastErr during iscsi connection
  If iscsid fails to connect second portal, currently
  the error is ignored silently. The lastErr should be
  logged to find the root cause of problem.
- Remove iscsi plugin directory after iscsi connection
  is successfully closed.
2017-09-18 21:33:11 -04:00
mtanino e21b68b4ca Support iscsi volume attach and detach
Fixes #48953
2017-08-26 17:23:47 -04:00
Jan Safranek bc6ad1ad9f iscsi: Use VolumeHost.GetExec() to execute stuff in volume plugins 2017-08-23 14:56:51 +02:00
Kubernetes Submit Queue d235fa3f1c Merge pull request #48789 from mtanino/issue/47311
Automatic merge from submit-queue (batch tested with PRs 50806, 48789, 49922, 49935, 50438)

iSCSI volume plugin: iSCSI initiatorname support

**What this PR does / why we need it**:

This PR adds iSCSI initiatorname parameter to ISCSIVolumeSource to enable automatic configuration of initiator name per volume. This would allow for more fine grained configuration, and remove the need to configure the initiator name on the host by administrator.

**Which issue this PR fixes**: fixes #47311

**Special notes for your reviewer**:

/cc @rootfs @jsafrane @msau42

**Release note**:

```
iSCSI volume plugin: Support customization of iSCSI initiator name per volume
```
2017-08-22 19:45:29 -07:00
Mitsuhiro Tanino a6e523f2e7 iSCSI volume plugin: iSCSI initiatorname support
This PR adds iSCSI initiatorname parameter to ISCSIVolumeSource
to enable automatic configuration of initiator name per volume.
This would allow for more fine grained configuration, and remove
the need to configure the initiator name on the host by
administrator.

fixes: #47311
2017-08-21 11:26:56 -04:00
Jan Safranek 0e547bae22 SafeFormatAndMount should use volume.Exec provided by VolumeHost
We need to execute mkfs / fsck where the utilities are.
2017-08-14 12:16:27 +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
mtanino aebaee39d5 Log out from multiple portals with iscsi storage plugin
When using iscsi storage with multiple target portal (TP)
addresses and multipathing the volume manager logs on to
the IQN for all portal addresses, but when a pod gets
destroyed the volume manager only logs out for the primary
TP and sessions for another TPs are always remained.

This patch adds methods to store and load iscsi disk
configrations, then uses the stored config at DetachDisk
path.

Fix #45394
2017-05-31 16:53:47 -04:00
Jamie Hannaford 9440a68744 Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
Huamin Chen 9298217126 Add iSCSI CHAP authentication
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-04-07 16:38:29 +00: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
Humble Chirammal 332e26dc8c Add portals field to iscsi volume source to achieve multipathing.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-06 17:06:33 +05:30
rkouj 32766e3b6d Check if path exists before performing unmount 2017-01-11 14:33:05 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Chao Xu bb675d395f dependencies: pkg/volume 2016-11-23 15:53:09 -08:00
Rajat Ramesh Koujalagi d81e216fc6 Better messaging for missing volume components on host to perform mount 2016-11-09 15:16:11 -08:00
Jedrzej Nowak f0988b95e7 Typos and englishify pkg/volume 2016-10-03 22:39:33 +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
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
tobad357 1811ded396 This is an update that allows the iscsi volume to check if a iscsi device belongs to a mpio device
If it does belong to the device then we make sure we mount the mpio device instead of
the raw device.

Heuristics
Login into /dev/disk/by-path/iqn-example.com.2999 -> /dev/sde
Check if sde existsin in /sys/block/[dm-X]/slaves/xx
If it does mount /dev/[dm-x] which will look like /dev/mapper/mpiodevicename in mount

examples/iscsi has more details
2016-04-20 09:42:11 +08:00
k8s-merge-robot 2205a30348 Merge pull request #23368 from saad-ali/renameBuilderCleaner
Auto commit by PR queue bot
2016-03-26 13:01:25 -07:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07:00