Commit Graph

94 Commits (08c127d4eb3349df0428e07e0c58f8b8860ad0a1)

Author SHA1 Message Date
Serguei Bezverkhi 335c5d959f Adding support for Block Volume to rbd plugin 2018-01-05 23:56:37 -05:00
Kubernetes Submit Queue 4562198ae6
Merge pull request #56925 from wenjun93/fix_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>.

fix rbd volume ConstructVolumeSpec

**What this PR does / why we need it**:
1. rbd plugin.ConstructVolumeSpec() construct volume spec with fake value, cause kubelet volume manager will create two volumesInUse in node Status.
2. change plugin.GetVolumeName(), create volumeName using rbd pool instead of monitors, because monitors is a group of IPs, which makes the volumeName too long. Also, this is to fit plugin.ConstructVolumeSpec() since makeGlobalPDName only uses rbd pool and image.

```
before fix:
volumesAttached:
  - devicePath: ""
    name: kubernetes.io/rbd/[xxxxxxx:6789 xxxxxxxxx:6789]:volume-9a106847-4def-4d1e-9603-4c7099b22a31
  volumesInUse:
  - 'kubernetes.io/rbd/[]:'
  - kubernetes.io/rbd/[xxxxxxx:6789 xxxxxxxxx:6789]:volume-9a106847-4def-4d1e-9603-4c7099b22a31

after fix:
volumesAttached:
  - devicePath: ""
    name: kubernetes.io/rbd/volumes:volume-9a106847-4def-4d1e-9603-4c7099b22a31
  volumesInUse:
  - kubernetes.io/rbd/volumes:volume-9a106847-4def-4d1e-9603-4c7099b22a31
2017-12-21 22:32:47 -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 e6e3b756c6 fix rbd volume plugin ConstructVolume 2017-12-07 19:34:44 +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 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
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
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
Serguei Bezverkhi 1411c2698e Refactor RBD volume 2017-10-23 16:59:34 -04: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
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
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
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 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Di Xu 50bfe02fea make default values as const vars 2017-07-20 16:13:17 +08:00
Alexander Block 8057056d1c Support "fstype" parameter in dynamically provisioned PVs 2017-07-19 10:34:13 +02:00
Jacob Simpson 29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Kubernetes Submit Queue e554dd6d3d Merge pull request #45805 from weiwei04/ceph-imageformat-2
Automatic merge from submit-queue

storageclass ceph add imageformat parameter

**What this PR does / why we need it**:
Add a imageformat parameter for StorageClass(ceph rbd)

k8s hard coded ceph imageformat 1, according to [ceph manual](http://docs.ceph.com/docs/master/man/8/rbd/), imageformat 1 was deprecated, we should add an extra ceph parameter to set ceph rbd imageformat. Ceph rbd imageformat can only be 1 or 2, set the default value to 1.

**Release note**:
```release-note
Allow StorageClass Ceph RBD to specify image format and image features.
```
2017-06-23 16:43:37 -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
Yecheng Fu 4e5e9ca0cd Only `layering` RBD image format 2 feature should be supported for now. 2017-06-16 18:07:03 +00:00
Yecheng Fu 0c7cdf773b Add `imageFeatures` parameter for RBD volume plugin, which is used to
customize RBD image format 2 features.
Update RBD docs in examples/persistent-volume-provisioning/README.md.
2017-06-16 18:07:03 +00:00
Wei Wei 2632bdd5e0 storageclass ceph add imageformat parameter 2017-06-16 18:07:03 +00:00
Matthew Wong 5e788a6a67 Don't provision for PVCs with AccessModes unsupported by plugin 2017-06-12 12:56:41 -04:00
NickrenREN a02d6cd5d8 Add createdby annotation for rbd and quobyte and make dynamical createdby key const
make dynamical createdby key const
2017-05-26 16:55:11 +08:00
Jamie Hannaford 9440a68744 Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02: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
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Dr. Stefan Schimanski d7eb3b6870 pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
Kubernetes Submit Queue ee49906c45 Merge pull request #39661 from NickrenREN/clientset-redundant-modify
Automatic merge from submit-queue

fix redundant alias clientset

remove redundant alias clientset
2017-01-12 13:29:16 -08:00
NickrenREN a12dea14e0 fix redundant alias clientset 2017-01-12 10:21:05 +08:00
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
Kubernetes Submit Queue 49fe0bea97 Merge pull request #37380 from jsafrane/rbd-errors
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

Improve error reporting in Ceph RBD provisioner.

- We should report an error when user references a secret that cannot be found
- We should report output of rbd create/delete commands, logging "exit code 1"
  is not enough.


Before:
```
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  33m           33m             1       {persistentvolume-controller }                  Warning         ProvisioningFailed      Failed to provision volume with StorageClass "cephrbdprovisioner": rbd: create volume failed, err: exit status 1
```

After:

```
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  33m           33m             1       {persistentvolume-controller }                  Warning         ProvisioningFailed      Failed to provision volume with StorageClass "cephrbdprovisioner": failed to create rbd image: exit status 1, command output: rbd: couldn't connect to the cluster
```


@rootfs, PTAL
2017-01-03 09:45:22 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Jan Safranek 9484de5d09 Improve error reporting in Ceph RBD provisioner.
- We should report an error when user references a secret that cannot be found
- We should report output of rbd create/delete commands, logging "exit code 1"
  is not enough.


Before:
```
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  33m           33m             1       {persistentvolume-controller }                  Warning         ProvisioningFailed      Failed to provision volume with StorageClass "cephrbdprovisioner": rbd: create volume failed, err: exit status 1
```

After:

```
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  33m           33m             1       {persistentvolume-controller }                  Warning         ProvisioningFailed      Failed to provision volume with StorageClass "cephrbdprovisioner": failed to create rbd image: exit status 1, command output: rbd: couldn't connect to the cluster
```
2016-11-28 12:08:09 +01:00
Chao Xu bb675d395f dependencies: pkg/volume 2016-11-23 15:53:09 -08:00