Commit Graph

1536 Commits (13b12e89408869c5b560a81e95bca33267bdb8e1)

Author SHA1 Message Date
Kubernetes Submit Queue 191f9dd5ff
Merge pull request #58549 from dims/backup-default-location-for-cloud-config
Automatic merge from submit-queue (batch tested with PRs 58480, 58549). 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 backup location to load cloud config for OpenStack

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

Since we are transitioning to external cloud provider, we need a way
to use the existing cinder volume plugin (from kubelet). With external
cloud manager kubelet will be run with --cloud=provider=external and
no --cloud-config file will be in the command line. So we need a way
to load the openstack config file from somewhere.

Taking a cue from kubeadm, which currently is picking up "/etc/kubernetes/cloud-config"
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/phases/controlplane/manifests.go#L44

let's support the scenario where we fall back to this static location if
there is no cloud provider specified in the command line.

This has been tested with local-up-cluster using the following params:
EXTERNAL_CLOUD_PROVIDER=true
CLOUD_PROVIDER=openstack
CLOUD_CONFIG=/etc/kubernetes/cloud-config


**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-01-23 05:01:31 -08:00
Kubernetes Submit Queue 5f6e12793b
Merge pull request #57948 from zhangxiaoyu-zidif/fix-ut-print
Automatic merge from submit-queue (batch tested with PRs 58438, 58523, 58513, 57948). 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 csi ut print

**What this PR does / why we need it**:
fix csi ut print

**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-01-23 03:53:33 -08:00
Kubernetes Submit Queue 1cb86fa1eb
Merge pull request #58513 from humblec/custom-name2
Automatic merge from submit-queue (batch tested with PRs 58438, 58523, 58513, 57948). 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 Namespace to glusterfs custom volume names.

For better isolation of volumes, users/admins would like to include `namespace` in custom volume names. This patch adds that support.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



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

**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

```
2018-01-23 03:53:31 -08:00
Davanum Srinivas 205b2eb3fd Use backup location to load cloud config for OpenStack
Since we are transitioning to external cloud provider, we need a way
to use the existing cinder volume plugin (from kubelet). With external
cloud manager kubelet will be run with --cloud=provider=external and
no --cloud-config file will be in the command line. So we need a way
to load the openstack config file from somewhere.

Taking a cue from kubeadm, which currently is picking up "/etc/kubernetes/cloud-config"
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/phases/controlplane/manifests.go#L44

let's support the scenario where we fall back to this static location if
there is no cloud provider specified in the command line.

This has been tested with local-up-cluster using the following params:
EXTERNAL_CLOUD_PROVIDER=true
CLOUD_PROVIDER=openstack
CLOUD_CONFIG=/etc/kubernetes/cloud-config
2018-01-22 09:40:09 -05:00
Kubernetes Submit Queue 5a44d2ccac
Merge pull request #58226 from lpabon/b58092
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>.

csi: Fix versioning error message

**What this PR does / why we need it**:
Incorrect error message

**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 #58092
2018-01-19 13:52:54 -08:00
Humble Chirammal 2c34b9cf77 Add Namespace to glusterfs custom volume names.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-01-19 17:07:08 +05:30
Kubernetes Submit Queue 8cc5ccfb49
Merge pull request #58209 from NickrenREN/csi-fstype
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>.

Add FSType for CSI volume source

**What this PR does / why we need it**:
Add FSType for CSI volume source to specify filesystems (alpha defaults to `ext4`)

**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 #58183

**Special notes for your reviewer**:

**Release note**:
```release-note
Add FSType for CSI volume source to specify filesystems
```

/assign @saad-ali 
cc @vladimirvivien
2018-01-18 09:35:58 -08:00
Kubernetes Submit Queue 3c99777d38
Merge pull request #57422 from joelsmith/nested_data_vol
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>.

Rework method of updating atomic-updated data volumes

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

This change affects the way that secret, configmap, downwardAPI and projected volumes (which all use the same underlying code) implement their data update functionality.

* Instead of creating a subdirectory hierarchy that will contain symlinks to each actual data file, create only symlinks to items in the root of the volume, whether they be files or directories.
* Rather than comparing the user-visible data directory to see if an update is needed, compare with the current version of the data directory.
* Fix data dir timestamp format year
* Create `..data` symlink even when a data volume has no data so consumers can have simplified update watch logic.

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

**Release note**:
```release-note
Correct issues that arise when volumes are mounted beneath another secret, configmap, downwardAPI or projected volume
```
2018-01-18 03:20:19 -08:00
Kubernetes Submit Queue 74f2305c4f
Merge pull request #57967 from jsafrane/fix-nfs-root-squash
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>.

Fixed TearDown of NFS with root squash.

NFS plugin should not use `IsLikelyNotMountPoint()`, as it uses `lstat()` / `stat()` to determine if the NFS volume is still mounted - NFS server may use root_squash and kubelet may not be allowed to do `lstat()` / `stat()` there.

It must use slower `IsNotMountPoint()` instead, including in `TearDown()` function.

**Release note**:

```release-note
NONE
```

/assign @gnufied @rootfs
2018-01-17 13:32:03 -08:00
Joel Smith b4e0923785 Rework method of updating atomic-updated data volumes
This change affects the way that secret, configmap, downwardAPI and projected
volumes (which all use the same underlying code) implement their data update
functionality.

* Instead of creating a subdirectory hierarchy that itself
  will contain symlinks to each actual data file, create only
  symlinks to items in the root of the volume, whether they
  be files or directories.
* Rather than comparing the user-visible data directory
  to see if an update is needed, compare with the current
  version of the data directory.
* Fix data dir timestamp format year
* Create ..data symlink even when a data volume has no data so
  consumers can have simplified update watch logic.
2018-01-17 12:09:20 -07:00
Mitsuhiro Tanino 6fa583381e Update comments for getting and removing loopback device at iSCSI,FC,RBD
This PR add comments for the background why plugin gets loopback
device and removes loopback device even if operation_generator has
same functionality.
2018-01-17 10:22:39 -05:00
Kubernetes Submit Queue 20f27a77ee
Merge pull request #58316 from andyzhangx/azurefile-setfsgroup
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>.

set fsGroup by securityContext.fsGroup in azure file

**What this PR does / why we need it**:
set fsGroup by securityContext.fsGroup in azure file
This PR respects `securityContext.fsGroup`, while if user both sets `gid=xxx` in mountOptions in azure storage class and `securityContext.fsGroup`,  `gid=xxx` setting in mountOptions will win.

```
apiVersion: v1
kind: Pod
metadata:
  name: security-context-demo
spec:
  securityContext:
    fsGroup: 2000
  volumes:
  - name: sec-ctx-vol
    emptyDir: {}
  containers:
  - name: sec-ctx-demo
    image: gcr.io/google-samples/node-hello:1.0
    volumeMounts:
    - name: sec-ctx-vol
      mountPath: /data/demo
    securityContext:
      allowPrivilegeEscalation: false
```

**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 #44085

**Special notes for your reviewer**:

**Release note**:

```
set fsGroup by securityContext.fsGroup in azure file
```

/assign @karataliu 
cc @rootfs @avaranovich
2018-01-17 04:29:03 -08:00
andyzhangx c38e7589a4 set fsGroup by securityContext.fsGroup in azure file
fix comments

fix comments

fix comments
2018-01-17 09:24:50 +00:00
Cao Shufeng 4e7398b67b remove duplicated import 2018-01-17 09:34:59 +08:00
NickrenREN 87cebae738 Add fsType for CSI 2018-01-16 12:34:04 +08:00
Luis Pabón ea31f8f7ec csi: Fix versioning error message
Closes #58092
2018-01-15 10:27:00 -08:00
Kubernetes Submit Queue b5eb9149ee
Merge pull request #58089 from mtanino/issue/58085
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>.

[FC Plugin] Create proper volumeSpec during ConstructVolumeSpec

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

Currently, FC plugin returns volume name and empty FCVolumeSource during ConstrutVolumeSpec of filesystem volume's reconstruction.

In this fix, ConstructVolumeSpec retrieves global mount path, and analyzes volume parameters such as
WWN, LUN, WWID from the path.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

cc @rootfs @jsafrane 
/sig storage
2018-01-12 16:26:23 -08:00
Kubernetes Submit Queue 744a6f0cde
Merge pull request #57516 from humblec/custom
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>.

Add custom volume name based on SC parameter.

At present glusterfs dynamic PVs are created with
    random names. However an admin would like to have some
    handle on the volume names created dynamically for
    various purposes. One example would be having a filter
    for sorting out PVs created for a particular storage class.
    
    This patch enables the functionality by having a custom
    volume name as a prefix to dynamic PVs. This is an optional
    parameter in SC and if set, the dynamic volumes are created
    in below format where `_` is the field seperator/delimiter:
    
    customvolumeprefix_PVCname_randomUUID

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-01-12 04:51:54 -08:00
Kubernetes Submit Queue 820ea04f08
Merge pull request #51098 from jsafrane/exec-git
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>.

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

This prepares volume plugins to run things in containers instead of running
them on the host.

**Special notes for your reviewer**:

* instead of `cmd.SetDir(<dir>); cmd.Exec("git <command>")`, we do `cmd.Exec("git -C <dir> <command>")` - mounter.Exec does not have SetDir()
* there are lot of changes in the tests because a different exec interface is used.

@kubernetes/sig-storage-pr-reviews 

```release-note
gitRepo volumes in pods require git 1.8.5 or later
```

/assign @rootfs
2018-01-11 09:22:21 -08:00
mtanino 41cb533ad6 [FC Plugin] Create proper volumeSpec during ConstructVolumeSpec
Currently, FC plugin returns volume name and empty
FCVolumeSource during ConstrutVolumeSpec during
filesystem volume's reconstruction.

In this fix, ConstructVolumeSpec retrieves global
mount path, analyzes volume parameters such as
WWN, LUN, WWID from the path.

Fixes #58085
2018-01-11 12:04:56 -05:00
Kubernetes Submit Queue e4851c1c85
Merge pull request #52324 from linyouchong/linyouchong-20170912
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 bug:Kubelet failure to umount  mount points

What this PR does / why we need it:
Fix bug#41141:Kubelet failure to umount glusterfs mount points
kubelet failure to umount mount moints in these cases:
1. glusterfs volume : transport endpoint is not connected
2. nfs volume : stale NFS file handle
this PR will fix it

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
fixes #41141
Special notes for your reviewer:
NONE
Release note:
NONE
2018-01-11 07:04:07 -08:00
Kubernetes Submit Queue 53a8ac753b
Merge pull request #56846 from zetaab/fixvolumeattached
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 cinder detach problems

**What this PR does / why we need it**: We have currently huge problems in cinder volume detach. This PR tries to fix these issues.

**Which issue(s) this PR fixes**:
Fixes #50004 
Fixes #57497

**Special notes for your reviewer**: 
**Release note**:

```release-note
openstack cinder detach problem is fixed if nova is shutdowned
```
2018-01-11 04:24:09 -08:00
Humble Chirammal 66c7fdb892 Update bazel.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-01-11 14:14:29 +05:30
Humble Chirammal e826a77919 Add custom volumename option to GlusterFS dynamic PVs.
At present glusterfs dynamic PVs are created with
random names. However an admin would like to have some
handle on the volume names created dynamically for
various purposes. One example would be having a filter
for sorting out PVs created for a particular storage class.

This patch enables the functionality by having a custom
volume name as a prefix to dynamic PVs. This is an optional
parameter in SC and if set, the dynamic volumes are created
in below format where `_` is the field seperator/delimiter:

customvolumeprefix_PVCname_randomUUID

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-01-11 14:01:07 +05:30
Kubernetes Submit Queue 2f17d782eb
Merge pull request #54752 from mtanino/pr/BlockVolumesSupport-iscsi
Automatic merge from submit-queue (batch tested with PRs 54230, 58100, 57861, 54752). 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>.

Block volumes Support: iSCSI plugin update

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

Add interface changes to iSCSI volume plugin to enable block volumes support feature.

**Which issue this PR fixes**: 
Based on this proposal (kubernetes/community#805 & kubernetes/community#1265) and this feature issue: kubernetes/features#351

**Special notes for your reviewer**:

This PR temporarily includes following changes except iSCSI plugin change for reviewing purpose.
These changes will be removed from the PR once they are merged.
- (#50457) API Change 
- (#51494) Container runtime interface change, volumemanager changes, operationexecutor changes

There are another PRs related to this functionality.
(#50457) API Change
(#53385) VolumeMode PV-PVC Binding change
(#51494) Container runtime interface change, volumemanager changes, operationexecutor changes
(#55112) Block volume: Command line printer update
Plugins
(#51493) Block volumes Support: FC plugin update
(#54752) Block volumes Support: iSCSI plugin update

**Release note**:

```
NONE
```
2018-01-10 13:29:38 -08:00
Kubernetes Submit Queue 70ee7d826f
Merge pull request #57823 from mlmhl/rbd_device_mount_path
Automatic merge from submit-queue (batch tested with PRs 57823, 58091, 58093, 58096, 57020). 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 ConstructVolumeSpec bug

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

Fix rbd `ConstructVolumeSpec` bug as its global device mount path is not canonical. Full details are in #57744 .

**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 #57744 

**Release note**:

```release-note
NONE
```

/sig storage
/kind bug
2018-01-10 12:37:38 -08:00
Jesse Haka 4e1b5c6a32 move detach out of os volumes attach
add test

add test

fix bazel

fix tests

change loglevel, remove else statement
2018-01-10 19:09:32 +02:00
mtanino 96509d4f5b generated code for iSCSI plugin change 2018-01-10 11:39:01 -05: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
Kubernetes Submit Queue f65be3747d
Merge pull request #56823 from humblec/volid-delete-resize
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>.

Add volID based delete() and resize() if volID is available in pv spec.
2018-01-10 07:17:47 -08:00
linyouchong 19003486bf Fix bug:Kubelet failure to umount mount points 2018-01-10 21:36:05 +08:00
Humble Chirammal fc6443ce2c Add volID based delete() and resize() if volID is available in pv spec.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-01-10 18:30:55 +05:30
Kubernetes Submit Queue 6b925ac24b
Merge pull request #56851 from zouyee/ceph-1
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>.

check function return err

**What this PR does / why we need it**:
check function return err

**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**:

```NONE

```
2018-01-10 03:12:28 -08:00
Kubernetes Submit Queue b9a62423c6
Merge pull request #57953 from andyzhangx/azuredisk-remount-fix
Automatic merge from submit-queue (batch tested with PRs 57733, 57613, 57953). 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 device name change issue for azure disk: add remount logic

**What this PR does / why we need it**:
fix device name change issue for azure disk: add remount logic

Accoding to [Troubleshoot Linux VM device name change](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/troubleshoot-device-names-problems), there is possibility of device name change, so when kubelet is restarted, we need to check whether the following two paths are still valid:
1. `/var/lib/kubelet/plugins/kubernetes.io/azure-disk/mounts/m358246426`: in MountDevice func
2. `/var/lib/kubelet/pods/950f2eb8-d4e7-11e7-bc95-000d3a041274/volumes/kubernetes.io~azure-disk/pvc-67e4e319-d4e7-11e7-bc95-000d3a041274`: in SetUpAt func

**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 #57952

**Special notes for your reviewer**:
 this is a corresponding fix of https://github.com/kubernetes/kubernetes/pull/57549, #57549 uses '/dev/disk/by-id', and this PR would check whether the mountPath is valid when kubelet restart(e.g.  after VM reboot since device name may change), if not valid, remount,  remember '/dev/disk/by-id' will be always valid.

**Release note**:

```
fix device name change issue for azure disk: add remount logic
```
2018-01-09 21:51:40 -08:00
Kubernetes Submit Queue 33134cb02c
Merge pull request #57993 from humblec/volume-metrics
Automatic merge from submit-queue (batch tested with PRs 57993, 58028). 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 volumemetrics for glusterfs plugin.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



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

**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

```
2018-01-09 19:39:29 -08:00
Kubernetes Submit Queue 389089846a
Merge pull request #57264 from zhangxiaoyu-zidif/fix-binary-check-cephfs
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 binary check for cephfs.go

**What this PR does / why we need it**:
unify the check method. see ref issue: #56479

**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 #56479

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-09 13:26:54 -08:00
Humble Chirammal dc0b7da5b7 Add volumemetrics for glusterfs plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-01-09 22:44:33 +05:30
mlmhl 2ccf22a5d0 fix rbd ConstructVolumeSpec bug 2018-01-09 10:27:05 +08:00
Kubernetes Submit Queue 8a9954d471
Merge pull request #56651 from sbezverk/block_rbd_volume_plugin
Automatic merge from submit-queue (batch tested with PRs 57784, 56651). 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>.

Adding support for Block Volume to rbd plugin

Adding support for Block Volume to rbd plugin

```release-note
Adding support for Block Volume type to rbd plugin.
```
2018-01-08 09:12:49 -08:00
Jan Safranek 45d21ee36b Fixed TearDown of NFS with root squash.
NFS plugin should not use IsLikelyNotMountPoint(), as it uses lstat() / stat()
to determine if the NFS volume is still mounted - NFS server may use
root_squash and kubelet may not be allowed to do lstat() / stat() there.

It must use slower IsNotMountPoint() instead, including TearDown() function.
2018-01-08 14:01:33 +01:00
andyzhangx 1bfb5d0670 add remount logic if original mount path is invalid 2018-01-08 06:01:42 +00:00
zhangxiaoyu-zidif 0209ce9137 fix csi attach ut print 2018-01-08 12:03:55 +08:00
zhangxiaoyu-zidif ed3912e9e3 fix csi mounter ut print 2018-01-08 10:42:05 +08:00
Serguei Bezverkhi 335c5d959f Adding support for Block Volume to rbd plugin 2018-01-05 23:56:37 -05:00
Kubernetes Submit Queue c02f54851f
Merge pull request #56315 from humblec/return-volid
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>.

Record volumeID in GlusterFS PV spec.
2018-01-04 13:26:12 -08:00
Kubernetes Submit Queue d8680a3c43
Merge pull request #57549 from andyzhangx/azurediskid-fix
Automatic merge from submit-queue (batch tested with PRs 56382, 57549). 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 azure disk not available issue when device name changed

**What this PR does / why we need it**:
There is possibility that device name(`/dev/sd*`) would change when attach/detach data disk in Azure VM according to  [Troubleshoot Linux VM device name change](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/troubleshoot-device-names-problems). 
And We did hit this issue, see customer [case](https://github.com/Azure/acs-engine/issues/1918). 
This PR would use `/dev/disk/by-id` instead of `/dev/sd*` for azure disk and `/dev/disk/by-id` would not change even device name changed.

**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 #57444

**Special notes for your reviewer**:
In a customer [case](https://github.com/Azure/acs-engine/issues/1918), customer is unable to use azure disk in StatefulSet since /dev/sd* changed after detach/attach disk. 
we are using `/dev/sd*`(code is [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/azure_common_linux.go#L140)) to "mount -bind" k8s path, while `/dev/sd*` could be changed when VM is attach/detaching data disks, see [Troubleshoot Linux VM device name change](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/troubleshoot-device-names-problems)
And I have also checked related AWS, GCE code, they are using `/dev/disk/by-id/` other than `/dev/sd*`, see [aws code](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/aws_ebs/aws_util.go#L228)  
[gce code](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/gce_pd/gce_util.go#L278)

**Release note**:

```
fix azure disk not available when device name changed
```
/sig azure
/assign @rootfs 
@karataliu @brendandburns @khenidak
2018-01-04 06:40:34 -08:00
zhangxiaoyu-zidif ec6b9eb956 fix-binary-check-cephfs 2018-01-04 11:08:40 +08:00
Kubernetes Submit Queue 5e70562c6a
Merge pull request #57512 from cofyc/improve_rbd_highavailability
Automatic merge from submit-queue (batch tested with PRs 57572, 57512, 57770). 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: Pass monitors addresses in a comma-separed list instead of trying one by one.

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

In production, monitors may crash (or have a network problem), if we try monitors one by one, rbd
command will hang a long time (e.g. `rbd map -m <unconnectable_host_ip>`
on linux 4.4 timed out in 6 minutes) when trying a unconnectable monitor. This is unacceptable.

Actually, we can simply pass a comma-separated list monitor addresses to `rbd`
command utility. Kernel rbd/libceph modules will pick monitor randomly
and try one by one, `rbd` command utility succeed soon if there is a
good one in monitors list.

[Docs](http://docs.ceph.com/docs/jewel/man/8/rbd/#cmdoption-rbd-m) about `-m` option of `rbd` is wrong,  'rbd' utility simply pass '-m <mon>' parameter to kernel rbd/libceph modules, which
takes a comma-seprated list of one or more monitor addresses (e.g. ip1[:port1][,ip2[:port2]...]) in its first version in linux (see 602adf4002/net/ceph/ceph_common.c (L239)). Also, libceph choose monitor randomly, so we can simply pass all addresses without randomization (see 602adf4002/net/ceph/mon_client.c (L132)).

From what I saw, there is no need to iterate monitor hosts one by one.

**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**:

Run `rbd map` against unconnectable monitor address logs on Linux 4.4:

```
root@myhost:~# uname -a
Linux myhost 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@myhost:~# time rbd map kubernetes-dynamic-pvc-941ff4d2-b951-11e7-8836-049fca8e58df --pool <pool> --id <id> -m <unconnectable_host_ip> --key=<password>
rbd: sysfs write failed
2017-12-20 18:55:11.810583 7f7ec56863c0  0 monclient(hunting): authenticate timed out after 300
2017-12-20 18:55:11.810638 7f7ec56863c0  0 librados: client.<id> authentication error (110) Connection timed out
rbd: couldn't connect to the cluster!
In some cases useful info is found in syslog - try "dmesg | tail" or so.
rbd: map failed: (110) Connection timed out

real	6m0.018s
user	0m0.052s
sys	0m0.064s
```  

We can simply pass a comma-separated list of monitors, if there is a good one in them, `rbd map` succeed soon.

```
root@myhost:~# time rbd map kubernetes-dynamic-pvc-941ff4d2-b951-11e7-8836-049fca8e58df --pool <pool> --id <id> -m <unconnectable_host_ip>,<good_host_ip> --key=<password>

/dev/rbd3

real	0m0.426s
user	0m0.008s
sys	0m0.008s
```

**Release note**:

```release-note
NONE
```
2018-01-03 13:46:32 -08:00
Kubernetes Submit Queue b729472952
Merge pull request #57779 from jolestar/flex-volume-fix
Automatic merge from submit-queue (batch tested with PRs 57366, 57779). 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>.

Remove unused command waitfordetach from flex volume driver

**What this PR does / why we need it**:
Clean unused code.

**Special notes for your reviewer**:
See #35629
Original PR is https://github.com/kubernetes/kubernetes/pull/50754 , the PR's repo has bean deleted,so I create a new PR and merge upstream for test.
**Release note**:

```release-note
NONE
```
2018-01-03 12:09:34 -08:00
Kubernetes Submit Queue 6dfc4b38fb
Merge pull request #57702 from mlmhl/volume_resize_event
Automatic merge from submit-queue (batch tested with PRs 57702, 57128). 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>.

format error message and remove duplicated event for resize volume failure

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

1. The `operationGenerator.resizeFileSystem` method returns errors generated by `volumeToMount.GenerateErrorDetailed`, and the outside code(`operationGenerator.GenerateMountVolumeFunc`) uses `volumeToMount.GenerateError` to generate a new error again, which lead to the event message redundant and confused, we should use `volumeToMount.GenerateError` inside `operationGenerator.resizeFileSystem` only, in outside code is not necessary.

2. The `eventRecorderFunc` will record an event if `resizeFileSystem` returns an error, so we needn't to record event inside `resizeFileSystem` itself.

**Release note**:

```release-note
NONE
```

/sig storage
/kind enhancement
2018-01-03 08:30:30 -08:00