Commit Graph

177 Commits (15f427ac2c67ab75d573b7ee4aa4596733588cf0)

Author SHA1 Message Date
Kubernetes Submit Queue 88ae1ef52b
Merge pull request #56658 from wenjun93/master
Automatic merge from submit-queue (batch tested with PRs 56480, 56675, 56624, 56648, 56658). 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>.

minor fix error typo of rbd volume teardown

fix typo in rbd volume plugin `diskTearDown`
2017-12-16 03:24:51 -08:00
Kubernetes Submit Queue 876259435a
Merge pull request #55991 from supereagle/core-client-with-version
Automatic merge from submit-queue (batch tested with PRs 54604, 55781, 55806, 55935, 55991). 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>.

Use core client with explicit version

**What this PR does / why we need it**:
Core client without explicit version has been deprecated, change them to the one with explicit version.

**Which issue(s) this PR fixes**:
Fixes partially #55993

**Special notes for your reviewer**:
/cc @kubernetes/sig-api-machinery-pr-reviews
/cc @caesarxuchao @k82cn @sttts @kevin-wangzefeng 

**Release note**:
```release-note
NONE
```
2017-12-13 22:26:01 -08:00
wenjgao 81918177d9 fix error typo of rbd volume teardown 2017-12-01 10:07:59 +08:00
supereagle 032416c75d use core client with explicit version
fix more usage of deprecated core client
2017-11-25 08:14:10 +08:00
NickrenREN 6f7a1983ef Support ceph rbd resize 2017-11-22 19:48:02 +08:00
Kubernetes Submit Queue a7e76475ef
Merge pull request #54556 from cofyc/fix_cmd_not_found
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>.

RBD Plugin: Fix bug in checking command not found error.

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

Fix bug in error checking logic. 

`Error()` method of command not found error returned from `command.Run/Output` is not "executable file not found in $PATH". Actually, it's `exec: "<command>": executable file not found in $PATH`.

I followed the logic in https://github.com/kubernetes/kubernetes/blob/v1.9.0-alpha.1/pkg/kubectl/cmd/util/editor/editor.go#L129 to detect command not found error.


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

**Special notes for your reviewer**:

https://play.golang.org/p/yZJxtouUQL

**Release note**:

```release-note
NONE
```
2017-11-18 07:32:22 -08:00
Sergey Lanzman 3474747465 Move regexp.MustCompile to global variable 2017-11-16 22:03:12 +02:00
Yecheng Fu ff639e80e8 RBD Plugin: Fix bug in checking command not found error. 2017-11-16 16:52:57 +08:00
Mayank Kumar dbadf6d9b3 include rbd command output in errors, simplify ifelse logic 2017-11-14 11:47:29 -08:00
Clayton Coleman b844ac44f5
Tmpdir can be a symlink, also fake mount needs to call nested mounter 2017-11-03 22:21:29 -04:00
Kubernetes Submit Queue d4d326b39d
Merge pull request #54856 from jsafrane/fix-detacher-param-name
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>.

Rename Detach() parameter.

`Detach()` does not get device name, it gets volume name. Parameters named `deviceMountPath` or `deviceName` just confuses developers.

Note that this PR  just renames parameters here and there, there should be no behavior change.

@kubernetes/sig-storage-pr-reviews 

/assign @gnufied @jingxu97 

**Release note**:
```release-note
NONE
```
2017-11-03 14:33:16 -07:00
Kubernetes Submit Queue 443908193d
Merge pull request #54652 from msau42/update-owners
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>.

Update volume OWNERS to reflect active sig-storage reviewers

**What this PR does / why we need it**:
Update sig-storage reviewers to add new members and remove those that don't have as much time to review storage PRs.   Approvers are unchanged.

**Special notes for your reviewer**:
For all those that have been removed, please approve.  If you want to remain as a reviewer, let me know and I will add you back.

**Release note**:
NONE
2017-11-01 16:30:32 -07:00
Jan Safranek 6f160c3570 Rename Detach() parameter.
Detach() does not get device name, it gets volume name.
2017-10-31 10:55:19 +01:00
Kubernetes Submit Queue 713abdf2ee
Merge pull request #54696 from jsafrane/fix-rbd-exec
Automatic merge from submit-queue (batch tested with PRs 54635, 54250, 54657, 54696, 54700). 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>.

Don't cache exec and mounter in RBD volume plugin

#51608 has broken containerized RBD mount utilities proposed in https://github.com/kubernetes/kubernetes/pull/53440.

Volume plugin can get a different exec and mounter implementation with every call, it must not be cached.

```release-note
NONE
```

/sig storage
/assign @rootfs
2017-10-27 14:38:28 -07:00
Kubernetes Submit Queue 6d73f03d2b
Merge pull request #54549 from linyouchong/linyouchong-20171025
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 incorrect log

**What this PR does / why we need it**:
fix incorrect log in nfs_test.go
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
NONE
**Special notes for your reviewer**:
NONE
**Release note**:
NONE
2017-10-27 11:02:42 -07:00
Jan Safranek c718fc2ca7 Don't cache exec and mounter in RBD volume plugin
Volume plugin can get a different exec and mounter implementation with every
call, it must not be cached.
2017-10-27 13:14:35 +02:00
Kevin 4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Michelle Au 7d1e279d3b Update volume OWNERS to reflect active sig-storage reviewers 2017-10-26 13:26:33 -07:00
linyouchong 02e8ffe13c fix incorrect log 2017-10-26 01:40:24 +08:00
Yecheng Fu f2af1af82f RBD Plugin: No need to acquire advisory lock any more!
With central attachdetach controller, we don't need to lock the image
any more. But for backward compatibility, we should:

1) Check if the image is still used by nodes running old kubelet in
attaching.
2) Clean old rbd.json file and remove lock if found in detaching.
2017-10-25 18:31:57 +08:00
Yecheng Fu 3e570ad36d RBD Plugin: Remove deviceMountPath before return on error
Attach.MountDevice.
2017-10-25 17:44:19 +08:00
Yecheng Fu ba0d275f3b RBD Plugin: Implement Attacher/Detacher interfaces.
1) Modify rbdPlugin to implement volume.AttachableVolumePlugin
   interface.
2) Add rbdAttacher/rbdDetacher structs to implement
   volume.Attacher/Detacher interfaces.
3) Add mount.SafeFormatAndMount/mount.Exec fields to rbdPlugin, and
   setup them in rbdPlugin.Init for later uses.
   Attacher/Mounter/Unmounter/Detacher reference rbdPlugin to use mounter
   and exec. This simplifies code.
4) Add testcase struct to abstract RBD Plugin test case, etc.
5) Add newRBD constructor to unify rbd struct initialization.
2017-10-25 17:43:17 +08:00
Kubernetes Submit Queue 5f030f4568 Merge pull request #54454 from cofyc/rbd_status
Automatic merge from submit-queue (batch tested with PRs 54229, 54380, 54302, 54454). 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 Plugin: rbdStatus only check output of successful `rbd status` run

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

Current RBDUtil.rbdStatus implementation never return error in any cases, even if command not found or `rbd status` never succeed. This PR change it to only check output of successful `rbd status` run, and return error on other cases.

Because there are maybe network problem or ceph cluster unresponsive conditions which will cause `rbd status` command to fail. We cannot assume there is no watchers on given image. It's better to return error, and let the caller to decide what to do.

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


**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-24 08:35:14 -07:00
Yecheng Fu bcacfff798 RBD Plugin: rbdStatus only check output of successful `rbd status` run 2017-10-24 13:11:57 +08:00
Serguei Bezverkhi 1411c2698e Refactor RBD volume 2017-10-23 16:59:34 -04:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 3fa6761bd1 Merge pull request #51869 from cofyc/fix_persistent_rbd
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>..

RBD Plugin: Omit volume.MetricsProvider field and add some testcases.

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

Embedded struct `volume.MetricProvider` is capitalized and should be omitted in JSON marshalling.   It's also a unmarshalable struct, will cause error in `RBDUtil.loadRBD`. 

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

**Special notes for your reviewer**:

It's a bug I introduced in https://github.com/kubernetes/kubernetes/pull/48486. It's my bad, sorry about that.

**Release note**:

```release-note
```
2017-09-20 07:50:41 -07:00
Yecheng Fu 8fa92e48a8 RBD Plugin: Omit volume.MetricsProvider field and add some testcases. 2017-09-11 02:18:52 +00:00
Kubernetes Submit Queue 8c8b1b5e88 Merge pull request #51574 from dillaman/ceph-rbd-image-format
Automatic merge from submit-queue (batch tested with PRs 51574, 51534, 49257, 44680, 48836)

rbd: default image format to v2 instead of deprecated v1

**What this PR does / why we need it**:
Image format v1 has been deprecated since the Infernalis release of
Ceph over two years ago.

**Release note**:
```StorageClass Ceph RBD now defaults to using the v2 image format ```
2017-08-31 23:13:15 -07:00
Jason Dillaman 68c1eea2c6 rbd: default image format to v2 instead of deprecated v1
Image format v1 has been deprecated since the Infernalis release of
Ceph over two years ago.
2017-08-29 20:11:46 -04:00
Matthew Wong 5e772b8e4b Add storageClass.mountOptions and use it in all applicable plugins 2017-08-29 11:37:36 -04:00
Cheng Xing 396c3c7c6f Adding dynamic Flexvolume plugin discovery capability, using filesystem watch. 2017-08-25 11:42:32 -07:00
Kubernetes Submit Queue d3dc9cd9ba Merge pull request #51114 from jsafrane/exec-rbd
Automatic merge from submit-queue (batch tested with PRs 51114, 51233, 51024, 51053, 51197)

rbd: Use VolumeHost.GetExec() to execute stuff in volume plugins

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

This PR updates rbd volume plugin to use `VolumeHost.GetExec()` to execute utilities like mkfs and lsblk instead of simple `os/exec`. This prepares the volume plugin to run these utilities in containers instead of running them on the host + makes the volume plugin more independent and less hardcoded.

See proposal in https://github.com/kubernetes/community/pull/589.

Note that this PR does **not** change place where the utilities are executed - `VolumeHost.GetExec()` still leads directly to `os/exec`. It will be changed when the aforementioned proposal is merged and implemented.

@kubernetes/sig-storage-pr-reviews 

**Release note**:
```release-note
NONE
```
2017-08-25 06:22:09 -07:00
Kubernetes Submit Queue 0f3f232b6f Merge pull request #51095 from cofyc/rbd_log
Automatic merge from submit-queue

RBD Plugin: Log RBD Attach/Mount/Unmout actions in addition to Detach

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

Currently, RBD Plugin can log a info message for a successful action of RBD Unmap, e.g.:

```
I0822 09:32:31.595162   15177 rbd_util.go:349] rbd: successfully unmap device /dev/rbd0
```

This PR adds logs for another three important actions: Attach, Mount and Unmount.

Logging these actions and associated info is *very* useful in diagnosing problems.

**Special notes for your reviewer**:

Example RBD Plugin logs of successful pod volume attaching and mounting:

```
I0822 09:30:27.512015   15177 rbd_util.go:148] lock list output "2017-08-22 09:30:27.493889 7fa4ae3c23c0 -1 auth: unable to find a keyring on /etc/ceph/ceph.client.kube.keyring,/etc/ceph/ceph.keyring,/etc/ceph/keyring,/etc/ceph/keyring.bin: (2) No such file or directory\n"
W0822 09:30:27.547513   15177 rbd_util.go:460] rbd: no watchers on kubernetes-dynamic-pvc-83bfd49e-871c-11e7-b88e-000c291fbe71
I0822 09:30:27.704703   15177 rbd_util.go:315] rbd: successfully map image kube/kubernetes-dynamic-pvc-83bfd49e-871c-11e7-b88e-000c291fbe71 to /dev/rbd0
I0822 09:30:27.965603   15177 rbd_util.go:322] rbd: successfully mount image kube/kubernetes-dynamic-pvc-83bfd49e-871c-11e7-b88e-000c291fbe71 at /var/lib/kubelet/plugins/kubernetes.io/rbd/rbd/kube-image-kubernetes-dynamic-pvc-83bfd49e-871c-11e7-b88e-000c291fbe71
```

Example RBD Plugin logs of successful pod volume detaching and unmouting:

```
I0822 09:32:31.380124   15177 rbd_util.go:334] rbd: successfully umount mountpoint /var/lib/kubelet/plugins/kubernetes.io/rbd/rbd/kube-image-kubernetes-dynamic-pvc-83bfd49e-871c-11e7-b88e-000c291fbe71
I0822 09:32:31.459867   15177 rbd_util.go:148] lock list output "2017-08-22 09:32:31.443643 7f2bb8ab53c0 -1 auth: unable to find a keyring on /etc/ceph/ceph.client.kube.keyring,/etc/ceph/ceph.keyring,/etc/ceph/keyring,/etc/ceph/keyring.bin: (2) No such file or directory\nThere is 1 exclusive lock on this image.\nLocker       ID                     Address                    \nclient.64117 kubelet_lock_magic_k8s 192.168.2.128:0/4124042516 \n"
I0822 09:32:31.595162   15177 rbd_util.go:349] rbd: successfully unmap device /dev/rbd0
```

It does not add too much logs, but admins/ops can know what RBD plugin are doing internally and exact time a RBD image is mapped, mounted or unmounted (in addition to unmapped).

**Release note**:

```release-note
NONE
```
2017-08-25 05:00:21 -07:00
Yecheng Fu c648505f76 RBD Plugin: Log RBD Attach/Mount/Unmout actions at logging level 3 2017-08-24 15:43:15 +00:00
xiangpengzhao 35b45d60b2 Use Fatalf instead of Errorf when mounter/unmounter if nil in volume tests 2017-08-23 10:29:30 +08:00
Jan Safranek 73b101c14b rbd: Use VolumeHost.GetExec() to execute stuff in volume plugins 2017-08-22 15:49:21 +02: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
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Kubernetes Submit Queue ea89d62710 Merge pull request #48486 from cofyc/rbd_metrics
Automatic merge from submit-queue (batch tested with PRs 49081, 49318, 49219, 48989, 48486)

Use MetricsStatsFs to expose RBD volume plugin metrics.

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

We need to monitor RBD volume usage of our cluster and configure alerts if RBD volume is nearly full. Users of cluster also need to see usage history graph on Grafana.

This PR use MetricsStatsFs to implement MetricsProvider interface of RBD plugin (same as `gce_pd`), so kubelet /stat/summary can expose RBD volume stats.

**Special notes for your reviewer**:

cc @rootfs

**Release note**:

```release-note
NONE
```
2017-07-28 04:03:44 -07:00
Yecheng Fu 777595ef6e Use MetricsStatsFs to expose RBD volume plugin metrics. 2017-07-27 08:13:55 +00:00
Kubernetes Submit Queue 74b3d47392 Merge pull request #49271 from dixudx/fix_rbd_deleter_adminid
Automatic merge from submit-queue (batch tested with PRs 47357, 49514, 49271, 49572, 49476)

set default adminid for rbd deleter if unset

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

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

**Special notes for your reviewer**:
/cc @BastiPaeltz @sjenning

**Release note**:

```release-note
set default adminid for rbd deleter if unset 
```
2017-07-26 12:03:47 -07:00
deads2k 94e9993900 remove deads2k from volume reviewer 2017-07-25 08:52:25 -04:00
Di Xu 6addd4c9dd set default adminid for rbd deleter 2017-07-25 12:51:10 +08:00
Kubernetes Submit Queue ee7eb4a241 Merge pull request #49274 from dixudx/add_const_for_rbd
Automatic merge from submit-queue (batch tested with PRs 48911, 49475, 49438, 49362, 49274)

set RBD default values as constant vars

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

When working on #49225, I found some [default RBD parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#ceph-rbd) had not been declared as constant values, which will be error-prone.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
set RBD default values as constant vars
```
2017-07-24 20:39:22 -07:00
Kubernetes Submit Queue d286f56221 Merge pull request #45345 from codablock/storageclass_fstype
Automatic merge from submit-queue (batch tested with PRs 45345, 49470, 49407, 49448, 49486)

Support "fstype" parameter in dynamically provisioned PVs

This PR is a replacement for https://github.com/kubernetes/kubernetes/pull/40805. I was not able to push fixes and rebases to the original branch as I don't have access to the Github organization anymore.

I assume the PR will need a new "ok to test" 

**ORIGINAL PR DESCRIPTION**

**What this PR does / why we need it**: This PR allows specifying the desired FSType when dynamically provisioning volumes with storage classes. The FSType can now be set as a parameter:
```yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: test
provisioner: kubernetes.io/azure-disk
parameters:
  fstype: xfs
```

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

**Special notes for your reviewer**:
The PR also implicitly adds checks for unsupported parameters.

**Release note**:

```release-note
Support specifying of FSType in StorageClass
```
2017-07-24 07:40:47 -07:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00