Commit Graph

242 Commits (af66376960b4f88be7e5bce83bf04c540d0d5a8c)

Author SHA1 Message Date
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
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
Kubernetes Submit Queue 0ae7fd3d2e
Merge pull request #59166 from zhangxiaoyu-zidif/clean-err-rbd
Automatic merge from submit-queue (batch tested with PRs 63251, 59166, 63250, 63180, 63169). 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>.

clean one redundant comment of rbd.go

**What this PR does / why we need it**:
This is a small PR for cleanup.

**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-04-27 10:45:09 -07:00
Lukasz Piatkowski 645d0d8e81 fix typo that redefines variable and breaks code 2018-04-05 13:49:02 +00:00
Kubernetes Submit Queue 06e3fefc21
Merge pull request #61738 from ianchakeres/osx-volume-ut-fix
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). 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>.

Skip volume unit tests that don't work on osx.

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

`volume/fc` and `volume/rbd` unit tests fail on osx.

```
$ pwd
<snip>/gopath/src/k8s.io/kubernetes/pkg/volume/fc
$ go test
--- FAIL: Test_ConstructVolumeSpec (0.00s)
    fc_test.go:450: couldn't fetch mountrefs
    fc_test.go:469: failed to retrieve WWIDs
    fc_test.go:450: couldn't fetch mountrefs
    fc_test.go:469: failed to retrieve WWIDs
FAIL
exit status 1
FAIL    k8s.io/kubernetes/pkg/volume/fc    0.054s
<snip>
$ pwd
<snip>/gopath/src/k8s.io/kubernetes/pkg/volume/rbd
$ go test
--- FAIL: TestConstructVolumeSpec (0.00s)
	rbd_test.go:575: ConstructVolumeSpec failed: directory /var/folders/59/yc7_f4fd53nbyw868zqpk78cn7shx9/T/rbd_test144865306/pods/pod123/volumes/kubernetes.io~rbd/vol is not mounted
	rbd_test.go:575: ConstructVolumeSpec failed: directory /var/folders/59/yc7_f4fd53nbyw868zqpk78cn7shx9/T/rbd_test144865306/pods/pod123/volumes/kubernetes.io~rbd/vol is not mounted
FAIL
exit status 1
FAIL	k8s.io/kubernetes/pkg/volume/rbd	0.063s
```

**Which issue(s) this PR fixes** :
Fixes #61569 and #61571 

**Special notes for your reviewer**:

To see these unit test fail, you need to run `go test` on an osx machine.

**Release note**:
```release-note
NONE
```
2018-03-27 09:47:22 -07:00
Ian Chakeres 470980d4a8 Skip volume unit tests that don't work on osx. 2018-03-26 12:47:36 -07:00
Kubernetes Submit Queue ffe3bb2567
Merge pull request #60189 from jeffrey4l/log_warning
Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). 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>.

Log warning message when failed to remove rbd lock

It is hard to debug without any error message when lock is not removed
successfully.
2018-03-20 00:42:06 -07:00
Kubernetes Submit Queue c64f19dd1b
Merge pull request #59728 from wgliang/master.append
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>.

more concise to merge the slice

**What this PR does / why we need it**:
more concise to merge the slice

**Special notes for your reviewer**:
2018-03-19 21:34:30 -07:00
wenlxie fd20c8b020 ignore the loopbackdevice error, or the rbd volume will not get detached 2018-03-04 23:03:57 +08:00
wackxu b3ba80b223 update bazel 2018-02-27 20:23:36 +08:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Ian Chakeres 110447844d Use rbd-nbd if present for rbd volume map and unmap operations, if rbd fails. 2018-02-26 07:06:07 -08:00
Jeffrey Zhang afbe47a382 Log warning message when failed to remove rbd lock
It is hard to debug without any error message when lock is not removed
successfully.
2018-02-22 17:53:02 +08:00