Commit Graph

253 Commits (bad9f6341a093c371f71e26aa27c0f695be1ba86)

Author SHA1 Message Date
Andrew Kim a62ee8b0a9 clean up volume rounding functions and move to k8s.io/cloud-provider/volume 2019-02-09 01:16:55 -05:00
Kubernetes Prow Robot f0b72df47e
Merge pull request #73789 from vladimirvivien/volume-plugin-can-attach
AttachableVolumePlugin CanAttach() method for attachable check
2019-02-08 09:06:17 -08:00
Vladimir Vivien 0a653b3b80 Adds method CanAttach() to check plugin attachability 2019-02-08 08:04:15 -05:00
Roy Lenferink b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
danielqsj cf1fb8a1cd fix format issue 2019-01-31 22:01:13 +08:00
Daniel (Shijun) Qian e72b32558c
Merge branch 'master' into keymutex 2019-01-31 20:50:57 +08:00
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
Andrew Kim 84191eb99b replace pkg/util/file with k8s.io/utils/path 2019-01-29 15:20:13 -05: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
Kubernetes Prow Robot 8743a0e3c6
Merge pull request #72033 from galexrt/more_logging_in_rbd_provisioner
rbd: log error when unable to get Secret
2019-01-08 07:48:57 -08:00
danielqsj 8092904e3c Cleanup PathExists callers 2019-01-08 22:16:11 +08:00
mlmhl 34a2f23dc1 use json format to get rbd image size 2018-12-29 19:45:13 +08:00
Alexander Trost f9e7ba07b7
rbd: log error when unable to get Secret
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-12-11 19:31:21 +01:00
k8s-ci-robot e5326f22ea
Merge pull request #70471 from xichengliudui/fix181031
Fix some typos
2018-11-29 00:48:16 -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
xichengliudui 8477389e7c Fix some types
Fix some typos
2018-10-31 04:05:25 -04:00
Aniket Kulkarni 75350d11e9 adding support for expanding in use persistent volumes for Flex 2018-10-24 15:31:16 -04:00
Masaki Kimura 3d808540df Fix descriptor lock release logic for block volume unmapDevice
Fixes: #69114
2018-10-03 14:40:54 +00:00
Jacob Hilker 4eb6f16b54
Random typo fix 2018-09-26 16:18:04 -04:00
NickrenREN 0df3e167ac only when accessmodes equals to ROX, we don't need check rbd status of being used 2018-08-28 18:43:38 +08:00
Kubernetes Submit Queue c5e74d128d
Merge pull request #66884 from NickrenREN/attacher-detacher-refactor
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Attacher/Detacher refactor for local storage

Proposal link: https://github.com/kubernetes/community/pull/2438

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

Attacher/Detacher refactor for the plugins which just need to mount device, but do not need to attach, such as local storage plugin.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

```release-note
Attacher/Detacher refactor for local storage
```

/sig storage
/kind feature
2018-08-15 07:03:48 -07:00
NickrenREN 81e360d20f update volume plugins accordingly 2018-08-14 11:12:54 +08:00
Kubernetes Submit Queue 6696ae39ee
Merge pull request #66332 from jianglingxia/jlx-k8s-201807181704
Automatic merge from submit-queue (batch tested with PRs 66602, 67178, 67207, 67125, 66332). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add UT to RBD volume test of TestGetAccessModes and TestRequiresRemount

**What this PR does / why we need it**:
Add UT to RBD volume test of TestGetAccessModes and TestRequiresRemount
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-10 14:13:19 -07:00
Di Xu b3dfe0c652 nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08:00
jianglingxia aeef7fdca2 Add UT to RBD volume test of TestGetAccessModes and TestRequiresRemount 2018-07-26 10:00:44 +08:00
Kubernetes Submit Queue 69176615e5
Merge pull request #66202 from tanshanshan/fixformat
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix wrong description 

**What this PR does / why we need it**:
fix wrong description 
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-24 21:24:30 -07:00
Matthew Wong 093e231289 Avoid overflowing int64 in RoundUpSize and return error if overflow int 2018-07-23 13:48:45 -04:00
tanshanshan 3ed3873748 fixformat 2018-07-14 10:34:21 +08:00
Jan Safranek 1c22dc9a5a Block volumes should have empty FSType
FSType in block PVs has no meaning and it should be empty in provisioned
PVs.
2018-07-02 14:04:50 +02:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Kubernetes Submit Queue 1bdee5636a
Merge pull request #64555 from wenlxie/upstream.master.fixrbdblockmode
Automatic merge from submit-queue (batch tested with PRs 65254, 64837, 64782, 64555, 64850). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix rbd device works at block mode not get mapped to container 

In my environment, restart docker will caused all of the container restart(our kernel is a bit old). 
Kubelet will also be restart.
After the  container up , I checked the container and find the RBD block device is not mapped to container.
When I inspect the container, its {HostConfig.Devices[]} field is empty.
I did some debug,  then find that  at code https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kubelet_pods.go#L113
The volName is empty. 

```release-notes
Fix issues for block device not mapped to container.
```
2018-06-20 11:28:17 -07:00
Kubernetes Submit Queue 6e97339d1f
Merge pull request #64271 from xiaoxubeii/fix-64119
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix #64119 RBD volumes cannot be mapped read only to more than 1 container

**What this PR does / why we need it**:
RBD volumes cannot be mapped read only to more than 1 container.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #64119

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-20 08:31:41 -07:00
Yecheng Fu c542b6be5d Remove mount.GetMountRefs in favor of mounter.GetMountRefs 2018-06-20 17:01:27 +08:00
Huamin Chen 11c6126aa0 update rbd and cephfs volume owners
Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-06-08 11:04:23 -04:00
Kubernetes Submit Queue c615098a96
Merge pull request #63193 from lichuqiang/provision_0425
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Volume topology aware dynamic provisioning: work based on new API

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

The PR has been split to 3 parts:

Part1: https://github.com/kubernetes/kubernetes/pull/63232 for basic scheduler and PV controller plumbing
Part2: https://github.com/kubernetes/kubernetes/pull/63233 for API change

and the PR itself includes work based on the API change:

- Dynamic provisioning allowed topologies scheduler work
- Update provisioning interface to be aware of selected node and topology

**Which issue(s) this PR fixes** 
Feature: https://github.com/kubernetes/features/issues/561
Design: https://github.com/kubernetes/community/issues/2168

**Special notes for your reviewer**:
/sig storage
/sig scheduling
/assign @msau42 @jsafrane @saad-ali @bsalamat

@kubernetes/sig-storage-pr-reviews
@kubernetes/sig-scheduling-pr-reviews

**Release note**:

```release-note
Volume topology aware dynamic provisioning
```
2018-06-05 15:31:58 -07:00
lichuqiang bccc8fe979 Provision interface change 2018-06-05 16:35:16 +08:00
wenlxie ca276336e1 1. fix rbd device works at block mode not get mapped to container when docker restart
2. Add unit test case for rbd
2018-06-05 13:21:54 +08:00
Vladimir Vivien 3569287993 Refactor of GenerateMapDeviceFunc to delegate Map call to volume plugin. 2018-06-03 17:25:37 -04:00
Jan Safranek 08564f203e Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
Tardis Xu 015871bf57 Format 2018-05-25 00:07:41 +08:00
Tardis Xu 56289ef3f8 Fix issue 64119. 2018-05-24 23:48:19 +08:00
Kubernetes Submit Queue f8decc04eb
Merge pull request #63579 from jsafrane/fix-rbd-double-mount
Automatic merge from submit-queue (batch tested with PRs 63830, 63579, 64173). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix iSCSI and RBD UnmountDevice with mount containers.

Google's [configure-helper.sh](https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/gci/configure-helper.sh) script bind-mounts `/var/lib/kubelet` somewhere into `/home/kubernetes` and thus every mount that Kubernetes does is visible **twice** in `/proc/mounts`.

iSCSI and RBD volume plugins should not rely on counting entries in `/proc/mounts` and unmount device when Kubernetes thinks it's unusued. Kubernetes tracks the mounts by itself and most of other volume plugins already rely on it safely.

/sig storage

Fixes #56704
(well, it does not fix it, but it makes Kubernetes working with double mounts)

**Release note**:

```release-note
NONE
```

@rootfs, PTAL
2018-05-22 23:52:06 -07:00
Kubernetes Submit Queue f321613dad
Merge pull request #63424 from xiaoxubeii/issue-63183-master
Automatic merge from submit-queue (batch tested with PRs 63424, 63657). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix #63183 Pods on different nodes mount Ceph RBD PVC stuck on ContainerCreating

**What this PR does / why we need it**:
Ceph/RBD pvc can be attached on different nodes when use ReadOnlyMany.


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63183

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-05-10 06:31:16 -07:00
Kubernetes Submit Queue 75af0646ba
Merge pull request #59034 from wenlxie/githubupstream.master.ignoreloopdevicenotfounderrorforrbd
Automatic merge from submit-queue (batch tested with PRs 59034, 63565, 63533). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[RBD block device ]ignore the loopbackdevice error, or the rbd volume will not get detached

The rbd volume loop device maybe not found and then the volume will  not get detached.
so need to ignore the error.
@mtanino @sbezverk
Can you take a look?

Release note:
```
ignore the loopback device not found error when  `GetLoopDevice` 
```
2018-05-09 05:13:08 -07:00
Tardis Xu 6d3b41cd85 Fix issue #63183 that pods on different nodes mount Ceph RBD PVC stuck on ContainerCreating. 2018-05-09 16:04:24 +08:00
Jan Safranek 906fd7529e Fix iSCSI and RBD UnmountDevice with mount containers.
Google's configure-helper.sh script bind-mounts /var/lib/kubelet somewhere
into /home/kubernetes and thus every mount that Kubernetes does is visible
twice in /proc/mounts.

iSCSI and RBD should not rely on counting on entries in /proc/mounts and
unmount device when Kubernetes thinks it's unusued. Kubernetes tracks
the mounts by itself and most of other volume plugins rely on it safely.
2018-05-09 09:52:37 +02:00
Kubernetes Submit Queue 186dd7beb1
Merge pull request #62903 from cofyc/fixfsgroupcheckinlocal
Automatic merge from submit-queue (batch tested with PRs 62657, 63278, 62903, 63375). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add more volume types in e2e and fix part of them.

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

- Add dir-link/dir-bindmounted/dir-link-bindmounted/bockfs volume types for e2e tests.
- Fix fsGroup related e2e tests partially.
- Return error if we cannot resolve volume path.
  - Because we should not fallback to volume path, if it's a symbolic link, we may get wrong results.

To safely set fsGroup on local volume, we need to implement these two methods correctly for all volume types both on the host and in container:

- get volume path kubelet can access
  - paths on the host and in container are different
- get mount references
  - for directories, we cannot use its mount source (device field) to identify mount references, because directories on same filesystem have same mount source (e.g. tmpfs), we need to check filesystem's major:minor and directory root path on it

Here is current status:

| | (A) volume-path (host) | (B) volume-path (container) | (C) mount-refs (host) | (D) mount-refs (container) |
| --- | --- | --- | --- | --- |
| (1) dir | OK | FAIL | FAIL | FAIL |
| (2) dir-link | OK | FAIL | FAIL | FAIL |
| (3) dir-bindmounted | OK | FAIL | FAIL | FAIL |
| (4) dir-link-bindmounted | OK | FAIL | FAIL | FAIL |
| (5) tmpfs| OK | FAIL | FAIL | FAIL |
| (6) blockfs| OK | FAIL | OK | FAIL |
| (7) block| NOTNEEDED | NOTNEEDED | NOTNEEDED | NOTNEEDED |
| (8) gce-localssd-scsi-fs| NOTTESTED | NOTTESTED | NOTTESTED | NOTTESTED |

- This PR uses `nsenter ... readlink` to resolve path in container as @msau42  @jsafrane [suggested](https://github.com/kubernetes/kubernetes/pull/61489#pullrequestreview-110032850). This fixes B1:B6 and D6, , the rest will be addressed in https://github.com/kubernetes/kubernetes/pull/62102.
- C5:D5 marked `FAIL` because `tmpfs` filesystems can share same mount source, we cannot rely on it to check mount references. e2e tests passes due to we use unique mount source string in tests.
- A7:D7 marked `NOTNEEDED` because we don't set fsGroup on block devices in local plugin. (TODO: Should we set fsGroup on block device?)
- A8:D8 marked `NOTTESTED` because I didn't test it, I leave it to `pull-kubernetes-e2e-gce`. I think it should be same as `blockfs`.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-02 20:13:11 -07:00
Yecheng Fu 3748197876 Add more volume types in e2e and fix part of them.
- Add dir-link/dir-bindmounted/dir-link-bindmounted/blockfs volume types for e2e
tests.
- Return error if we cannot resolve volume path.
- Add GetFSGroup/GetMountRefs methods for mount.Interface.
- Fix fsGroup related e2e tests partially.
2018-05-02 10:31:42 +08:00