Commit Graph

2279 Commits (40a4c1f723449e27797d587dda27528875f5b530)

Author SHA1 Message Date
Seungcheol Ko 4b3e50b61c fix verify-bazel error 2018-09-12 07:27:33 +00:00
Seungcheol Ko 8f7fcd5adc Add VolumeScheduling support for Cinder 2018-09-12 05:11:54 +00:00
Cheng Pan a5c4f341d7 fix golint issue for pkg/volume/util 2018-09-10 21:24:35 +00:00
Cheng Xing 4ca39ef0ed Consolidated CSIDriver logic under CSIDriverRegistry flag 2018-09-10 13:34:40 -07:00
Kubernetes Submit Queue f26556cc14
Merge pull request #67684 from verult/top-csi-driver-registration
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

CSI Node info registration in kubelet

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

**Special notes for your reviewer**:
Feature issue: https://github.com/kubernetes/features/issues/557
Design doc: https://github.com/kubernetes/community/pull/2034

Missing pieces:
* CSI client retry and exponential backoff logic.
* CSINodeInfo object validation
* e2e test with all the CSI machinery.

An RBAC rule is also added to support external-provisioner topology updates.

**Release note**:

```release-note
Registers volume topology information reported by a node-level Container Storage Interface (CSI) driver. This enables Kubernetes support of CSI topology mechanisms.
```
2018-09-08 00:16:52 -07:00
Cheng Xing 94d649b590 Rearranged feature flags 2018-09-07 17:45:27 -07:00
Kubernetes Submit Queue 5c8ef7eb3b
Merge pull request #68320 from NickrenREN/localvolume-metricspath
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Fix metricsStatFS volume path for local volume

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

Fix metricsStatFS volume path for local volume

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

/kind bug
/sig storage
/assign @msau42
2018-09-06 21:41:17 -07:00
Cheng Xing becc6a9c19 Implemented logic in kubelet for registering node info, including wiring to CSINodeInfo; added unit tests for node updates; updated RBAC, NodeAuthorizer, NodeRestriction. 2018-09-06 19:16:51 -07:00
Renaud Gaubert 78b55eb5bf Updated the CSI pluginwatcher handler 2018-09-06 15:34:46 +02:00
Kubernetes Submit Queue e5f55dd9d0
Merge pull request #68239 from cuppett/issue-59015
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Resolves #59015, Scheduler: Add support for EBS types t3, r5, & z1d

Fixes #59015

The new t3, r5, r5d and z1 need matched as well according to this:

From current AWS documentation:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html

T3, C5, C5d, M5, M5d, R5, R5d, and z1d instances support a maximum of
28 attachments, and every instance has at least one network interface
attachment. If you have no additional network interface attachments on
these instances, you could attach 27 EBS volumes.

**Release note**:

```NONE

```
2018-09-06 04:23:56 -07:00
NickrenREN e03635e02c fix metricsStatFS volume path for local volume 2018-09-06 11:38:06 +08:00
Stephen Cuppett d85daf0f4c Resolves #59015, extends existing regex to cover t3, r5(d) & z1d instance types
From current AWS documentation:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html

T3, C5, C5d, M5, M5d, R5, R5d, and z1d instances support a maximum of
28 attachments, and every instance has at least one network interface
attachment. If you have no additional network interface attachments on
these instances, you could attach 27 EBS volumes.
2018-09-05 21:24:09 -04:00
Jan Safranek 32ae639edf Add unit tests for pod information in NodePublish
Some refactoring of CSI tests was necessary.
2018-09-05 21:20:01 -04:00
Jan Safranek a30fc9ca48 Pass pod information in CSI NodePublish attributes. 2018-09-05 21:02:45 -04:00
Kubernetes Submit Queue ca43f007a3
Merge pull request #67731 from gnufied/fix-csi-attach-limit
Automatic merge from submit-queue (batch tested with PRs 68161, 68023, 67909, 67955, 67731). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Fix csi attach limit

Add support for volume limits for CSI.

xref: https://github.com/kubernetes/community/pull/2051

```release-note
Add support for volume attach limits for CSI volumes
```
2018-09-05 14:51:55 -07:00
Hemant Kumar fc61620db5 Fix compatibility tests for scheduler 2018-09-05 12:29:00 -04:00
Jan Safranek f1cef9bde4 Add e2e test for skipping attach 2018-09-05 10:35:54 -04:00
Jan Safranek f474b54447 Add unit tests for skipping attach 2018-09-05 10:15:43 -04:00
Jan Safranek c6c74d6846 Skip attach for non-attachable CSI volumes 2018-09-05 10:15:43 -04:00
Jan Safranek 7c1311bcdb Add CSIDriver lister to CSI plugin
So we don't instantiate a new lister in every SetUpAt() call.
2018-09-05 10:15:43 -04:00
Michelle Au 8091c7975b Integration and e2e tests 2018-09-04 16:30:14 -07:00
NickrenREN 8d3fdc5a32 fix UT errors and add new UTs 2018-09-03 13:35:17 +08:00
NickrenREN 8173ef1e8d local volume plugin changes 2018-09-03 13:35:04 +08:00
Kubernetes Submit Queue f1ac8956fe
Merge pull request #68129 from dixudx/hostpath_owner
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

as hostpathtype owner, adds myself to OWNERS file

**What this PR does / why we need it**:
As the owner of HostPathType, I would like to add myself to OWNERS file.

**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**:
/cc thockin saad-ali 
**Release note**:

```release-note
None
```
2018-09-02 10:28:19 -07:00
Kubernetes Submit Queue 85300f4f5d
Merge pull request #67803 from saad-ali/csiClusterReg3
Automatic merge from submit-queue (batch tested with PRs 64283, 67910, 67803, 68100). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

CSI Cluster Registry and Node Info CRDs

**What this PR does / why we need it**:
Introduces the new `CSIDriver` and `CSINodeInfo` API Object as proposed in https://github.com/kubernetes/community/pull/2514 and https://github.com/kubernetes/community/pull/2034

**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 https://github.com/kubernetes/features/issues/594

**Special notes for your reviewer**:
Per the discussion in https://groups.google.com/d/msg/kubernetes-sig-storage-wg-csi/x5CchIP9qiI/D_TyOrn2CwAJ the API is being added to the staging directory of the `kubernetes/kubernetes` repo because the consumers will be attach/detach controller and possibly kubelet, but it will be installed as a CRD (because we want to move in the direction where the API server is Kubernetes agnostic, and all Kubernetes specific types are installed).

**Release note**:

```release-note
Introduce CSI Cluster Registration mechanism to ease CSI plugin discovery and allow CSI drivers to customize Kubernetes' interaction with them.
```

CC @jsafrane
2018-08-31 16:46:41 -07:00
Kubernetes Submit Queue e1a270d6dc
Merge pull request #68117 from andyzhangx/azurefile-crsss-rg
Automatic merge from submit-queue (batch tested with PRs 68051, 68130, 67211, 68065, 68117). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

support cross resource group for azure file

**What this PR does / why we need it**:
support cross resource group for azure file: by `resourceGroup` field, azure cloud provider will create azure file on user specified resource group

```
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile-rg
provisioner: kubernetes.io/azure-file
parameters:
  resourceGroup: RESOURCE_GROUP_NAME
  storageAccount: EXISTING_STORAGE_ACCOUNT
```
**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 #64428

**Special notes for your reviewer**:

**Release note**:

```
resourcegroup parameter is added to AzureFile storage class to support azure file dyanmic provision in cross resource group.
```

/kind bug
/sig azure
/assign @feiskyer 
cd @khenidak
2018-08-31 15:32:49 -07:00
Jan Safranek 7d673cb8f0 Pass new CSI API Client and informer to Volume Plugins 2018-08-31 12:25:59 -07:00
Di Xu 1c637ffc71 as hostpathtype owner, adds myself to OWNERS file 2018-08-31 19:25:32 +08:00
andyzhangx 4e3b4a7f6a support cross resource group for azure file
fix test failure
2018-08-31 08:11:07 +00:00
andyzhangx 630c841075 fix select zone error in azure disk creation
fix comments
2018-08-30 07:33:43 +00:00
Kubernetes Submit Queue 37b29297aa
Merge pull request #67432 from lichuqiang/topo_provision_beta
Automatic merge from submit-queue (batch tested with PRs 67745, 67432, 67569, 67825, 67943). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Move volume dynamic provisioning scheduling to beta

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

*  Combine feature gate VolumeScheduling and DynamicProvisioningScheduling into one
* Add allowedTopologies description in kubectl

**Special notes for your reviewer**:
Wait until related e2e and downside plugins are ready.

/hold

**Release note**:

```release-note
Move volume dynamic provisioning scheduling to beta (ACTION REQUIRED: The DynamicProvisioningScheduling alpha feature gate has been removed. The VolumeScheduling beta feature gate is still required for this feature)
```
2018-08-29 15:19:34 -07:00
Kubernetes Submit Queue 720781e6af
Merge pull request #67745 from feiskyer/choose-zones
Automatic merge from submit-queue (batch tested with PRs 67745, 67432, 67569, 67825, 67943). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Fix panic when choosing zone or zones for volume

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

Fix panic when choosing zone or zones for volume, so that zoneSlice won't divide by zero now.

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

cc @ddebroy @andyzhangx
2018-08-29 15:19:30 -07:00
lichuqiang 4c43d626f2 related test update 2018-08-29 10:30:16 +08:00
lichuqiang b4a57f6855 combine feature gate VolumeScheduling and DynamicProvisioningScheduling into one 2018-08-29 10:30:08 +08: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 91e37eeb92
Merge pull request #67772 from andyzhangx/azuredisk-volumelimits2
Automatic merge from submit-queue (batch tested with PRs 67766, 67642, 67772). 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>.

Enable dynamic azure disk volume limits

**What this PR does / why we need it**:
Enable dynamic azure disk volume limits,
This is an azure cloud provider implementation related to feature: [Dynamic Maximum volume count](https://github.com/kubernetes/features/issues/554)

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

**Special notes for your reviewer**:
This PR use `az.VirtualMachineSizesClient.List` to list all vm sizes under region, match vm size with current node size, and then got `MaxDataDiskCount`, the `GetVolumeLimits` happens in kubelet and will return `attachable-volumes-azure-disk` in node status as following example:
```
agentpool-22082114-0
    ...
    allocatable:
      attachable-volumes-azure-disk: "8"
      cpu: "2"
      ephemeral-storage: "28043041951"
      hugepages-1Gi: "0"
      hugepages-2Mi: "0"
      memory: 7034772Ki
      pods: "30"
```

**Release note**:

```
Enable dynamic azure disk volume limits
```

/sig azure
/kind feature
2018-08-27 06:14:17 -07:00
andyzhangx dd63d407a4 Enable dynamic azure disk volume limits
use API to get max disk num

use continue when got exception

add logging

add cache and unit test

fix comments
2018-08-27 02:41:45 +00:00
Kubernetes Submit Queue 6a81baf133
Merge pull request #67822 from humblec/remove-config
Automatic merge from submit-queue (batch tested with PRs 67822, 67835). 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 provisioner config from log message.

Signed-off-by: hchiramm <hchiramm@redhat.com>
```
release-note-none

```
2018-08-26 10:38:58 -07:00
Kubernetes Submit Queue b2b3c36ecb
Merge pull request #67530 from ddebroy/ddebroy-gcepd1
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 DynamicProvisioningScheduling support for GCE PD and RePD

**What this PR does / why we need it**:
This PR adds support for the DynamicProvisioningScheduling feature for GCE PD and RePD. With this in place, if VolumeBindingMode: WaitForFirstConsumer is specified in a GCE storageclass and DynamicProvisioningScheduling is enabled, GCE PD provisioner will use the selected node's LabelZoneFailureDomain as (1) the zone to provision a GCE PD volume in (2) one of the zones to provision GCE RePD volume in.

**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**:
E2E tests for DynamicProvisioningScheduling scenarios for GCE PD to follow 

**Release note**:
```release-note
none
```
/sig storage
/assign @msau42
2018-08-24 18:23:19 -07:00
Kubernetes Submit Queue b883c5905a
Merge pull request #67328 from cofyc/fix65113-2
Automatic merge from submit-queue (batch tested with PRs 66916, 67252, 67794, 67619, 67328). 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>.

Using a fixed set of locks, then we don't need to free unused locks anymore.

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

Using a fixed set of locks, then we don't need to free unused locks anymore.
See kubernetes/kubernetes/pull/66442 for discussions.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @msau42 
/assign @thockin
2018-08-24 15:25:17 -07:00
Deep Debroy a2de7d2d8d Add DynamicProvisioningScheduling support for GCE PD and RePD
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-08-24 14:38:25 -07:00
hchiramm 5fff5226cd Remove provisioner config from log message.
Signed-off-by: hchiramm <hchiramm@redhat.com>
2018-08-24 19:40:37 +05:30
Yecheng Fu 798838a6a0 Using a fixed set of locks, then we don't need to free unused locks
anymore.
See kubernetes/kubernetes/pull/66442 for discussions.
2018-08-24 12:24:09 +08:00
Kubernetes Submit Queue 82924e71cd
Merge pull request #67604 from feiskyer/cross-rg-nodes
Automatic merge from submit-queue (batch tested with PRs 66980, 67604, 67741, 67715). 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 support of Azure cross resource group nodes

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

Part of feature [Cross resource group nodes](https://github.com/kubernetes/features/issues/604).

This PR adds support of Azure cross resource group nodes that are labeled with `kubernetes.azure.com/resource-group=<rg-name>` and `alpha.service-controller.kubernetes.io/exclude-balancer=true`

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

See designs [here](https://github.com/kubernetes/community/pull/2479).

**Release note**:

```release-note
Azure cloud provider now supports cross resource group nodes that are labeled with `kubernetes.azure.com/resource-group=<rg-name>` and `alpha.service-controller.kubernetes.io/exclude-balancer=true`
```

/sig azure
/kind feature
2018-08-23 03:14:07 -07:00
Kubernetes Submit Queue 36cb72cfa9
Merge pull request #67483 from andyzhangx/azuredisk-kind
Automatic merge from submit-queue (batch tested with PRs 59230, 66233, 67483, 67713). 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>.

change default value of kind for azure disk

**What this PR does / why we need it**:
change default value of kind for azure disk, as we are suggesting users to use managed disk, default value should be managed disk.

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

**Special notes for your reviewer**:
assign @feiskyer 
FYI @khenidak @brendandburns 

**Release note**:

```
change default value of kind for azure disk
```

/kind feature
/sig azure
2018-08-22 23:04:22 -07:00
Pengfei Ni 8e4ab129e9 Fix panic when choosing zone or zones for volume 2018-08-23 10:46:41 +08:00
Pengfei Ni 5fdc7154f2 Only set nodeSelectorTerms when there are zoned nodes 2018-08-23 10:37:57 +08:00
Hemant Kumar 4b17a48def Implement support for updating volume limits
Create a new predicate to count CSI volumes
2018-08-22 19:36:00 -04:00
Davanum Srinivas 9b43d97cd4
Add Labels to various OWNERS files
Will reduce the burden of manually adding labels. Information pulled
from:
https://github.com/kubernetes/community/blob/master/sigs.yaml

Change-Id: I17e661e37719f0bccf63e41347b628269cef7c8b
2018-08-21 13:59:08 -04:00
Kubernetes Submit Queue da2169f899
Merge pull request #67332 from nak3/ceph-fuse-opt
Automatic merge from submit-queue (batch tested with PRs 67332, 66737, 67281, 67173). 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>.

Support mount options for cephfs with ceph-fuse mount

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

When cephfs uses ceph-fuse for the mount command, mount option and
readOnly options are disregarded. This patch adds to ceph-fuse as
well.


**Special notes for your reviewer**:

N/A

**Release note**:

```release-note
NONE
```
2018-08-21 05:25:03 -07:00
Srini Brahmaroutu 6777dc7404 Provide Flex volume metrics if the plugin supports. 2018-08-17 11:54:29 -07:00
andyzhangx aa4594ffae add more sku support for azure disk
add error msg

update bazel
2018-08-17 06:52:46 +00:00
andyzhangx 3013df9e9e change default value of kind for azure disk 2018-08-16 07:13:01 +00:00
Kubernetes Submit Queue 2a81c37d4c
Merge pull request #67229 from feiskyer/unzoned-disks
Automatic merge from submit-queue (batch tested with PRs 66884, 67410, 67229, 67409). 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 node affinity for Azure unzoned managed disks

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

Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).

Add node affinity for Azure unzoned managed disks, so that unzoned disks only scheduled to unzoned nodes.

This is required because Azure doesn't allow attaching unzoned disks to zoned VMs.

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

Unzoned nodes would label `failure-domain.beta.kubernetes.io/zone=0` and the value is fault domain ( while availability zone is used for zoned nodes). So fault domain is used to populate unzoned disks.

Since there are at most 3 fault domains in each region, the PR adds 3 terms for them:

```yaml
kubectl describe pv pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
Name:              pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
Labels:            <none>
Annotations:       pv.kubernetes.io/bound-by-controller=yes
                   pv.kubernetes.io/provisioned-by=kubernetes.io/azure-disk
                   volumehelper.VolumeDynamicallyCreatedByKey=azure-disk-dynamic-provisioner
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      azuredisk-unzoned
Status:            Bound
Claim:             default/unzoned-pvc
Reclaim Policy:    Delete
Access Modes:      RWO
Capacity:          5Gi
Node Affinity:     
  Required Terms:  
    Term 0:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [0]
    Term 1:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [1]
    Term 2:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [2]
Message:           
Source:
    Type:         AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
    DiskName:     k8s-5b3d7b8f-dynamic-pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
    DiskURI:      /subscriptions/<subscription>/resourceGroups/<rg-name>/providers/Microsoft.Compute/disks/k8s-5b3d7b8f-dynamic-pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
    Kind:         Managed
    FSType:       
    CachingMode:  None
    ReadOnly:     false
Events:           <none>
```

**Release note**:

```release-note
Add node affinity for Azure unzoned managed disks
```

/sig azure
/kind feature

/cc @brendandburns @khenidak @andyzhangx @msau42
2018-08-15 07:10:15 -07: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
Kubernetes Submit Queue 5aea00d885
Merge pull request #67097 from chakri-nelluri/EIO-Unmountfix
Automatic merge from submit-queue (batch tested with PRs 67396, 67097, 67395, 67365, 67099). 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>.

Ignore EIO error in unmount path

**What this PR does / why we need it**:
This PR ignores EIO in unmount path. XFS shuts down filesystem when the target is down and it returns EIO for the stat calls used in unmount path.

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

**Special notes for your reviewer**:
We already handle ESTALE & ENOTCONN errors in isCorruptedMnt Call. Adding EIO to that list covers the XFS shutdown case.

Also Flexvolume doesn't check for these errors in its current form. Updated Flexvolume code to handle it.

```release-note
NONE
```
2018-08-15 05:45:17 -07:00
Kubernetes Submit Queue bc60801d18
Merge pull request #66895 from ctriple/master
Automatic merge from submit-queue (batch tested with PRs 61212, 66369, 66446, 66895, 66969). 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>.

pkg/volume/cephfs: fix doc typo, nfs -> cephfs
2018-08-14 21:18:15 -07:00
Kubernetes Submit Queue 76434bd62a
Merge pull request #66780 from NetApp/volumeresize
Automatic merge from submit-queue (batch tested with PRs 66780, 67330). 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>.

Changed admission controller to allow volume expansion for all volume plugins

**What this PR does / why we need it**:
There are two motivations for this change:

1. CSI plugins are soon going to support volume expansion. For such plugins, admission controller doesn't know whether the plugins are capabale of supporting volume expansion or not.
2. Currently, admission controller rejects PVC updates for in-tree plugins that don't support volume expansion (e.g., NFS, iSCSI). This change allows external controllers to expand volumes similar to how external provisioners are accommodated.

**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**:
This PR mimics the behavior of the PV controller when PVs are provisioned externally by logging and setting a new event for PVs that are being expanded externally. As SIG Storage is planning new types of operations on PVs, it may make more sense to a have a single event for all actions taken by external controllers.

**Release note**:

```release-note
The check for unsupported plugins during volume resize has been moved from the admission controller to the two controllers that handle volume resize.
```
/sig storage
/assign @gnufied @jsafrane @wongma7
2018-08-14 12:22:00 -07:00
Pengfei Ni dbdfd0fab2 Set nodeAffinity for unmanaged disks 2018-08-14 14:25:15 +08:00
Pengfei Ni cf4981fc80 Update bazel 2018-08-14 14:14:01 +08:00
Pengfei Ni 028f155b9e Add node affinity for unzoned managed disks 2018-08-14 14:14:01 +08:00
NickrenREN 55784f88d4 add UTs for devicemountable conditions 2018-08-14 11:13:02 +08:00
NickrenREN 81e360d20f update volume plugins accordingly 2018-08-14 11:12:54 +08:00
NickrenREN c7e4466873 attacher/detacher refactor 2018-08-14 11:12:41 +08:00
Kenjiro Nakayama 32117163e4 Support mount options for cephfs with ceph-fuse mount
When cephfs uses ceph-fuse for the mount command, mount option and
readOnly options are disregarded. This patch adds to ceph-fuse as
well.
2018-08-13 18:09:28 +09:00
Kubernetes Submit Queue 1dfe2e8bff
Merge pull request #67140 from NetApp/multipath-race-fix
Automatic merge from submit-queue (batch tested with PRs 67017, 67190, 67110, 67140, 66873). 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 wait loop for multipath devices to appear

It takes a variable amount of time for the multipath daemon
to create /dev/dm-XX in response to new LUNs being discovered.
The old iscsi_util code only discovered the multipath device
if it was created quickly enough, but in a significant number
of cases, kubelet would grab one of the individual paths and
put a filesystem it on before multipathd could construct a
multipath device.

This change waits for the multipath device to get created for
up to 10 seconds, but only if the PV actually had more than
one portal.

fixes #60894

```release-note
Dynamic provisions that create iSCSI PVs can ensure that multipath is used by specifying 2 or more target portals in the PV, which will cause kubelet to wait up to 10 seconds for the multipath device. PVs with just one portal continue to work as before, with kubelet not waiting for the multipath device and just using the first disk it finds.
```
2018-08-10 17:01:16 -07:00
Kubernetes Submit Queue 032a096d86
Merge pull request #67110 from verult/kubelet-nodeid
Automatic merge from submit-queue (batch tested with PRs 67017, 67190, 67110, 67140, 66873). 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 plugin now calls NodeGetInfo() to get driver's node ID

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
/sig storage
@sbezverk @vladimirvivien @saad-ali
2018-08-10 17:01:13 -07: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
Kubernetes Submit Queue 6c77dce9be
Merge pull request #67220 from verult/vsphere-panic
Automatic merge from submit-queue (batch tested with PRs 67058, 67083, 67220, 67222, 67209). 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 unsafe type cast in vSphere volume plugin

**What this PR does / why we need it**: Fixes the controller manager panic caused by vSphere volumes being used on the wrong cloud provider.

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

**Release note**:

```release-note
NONE
```

/assign @saad-ali
2018-08-09 20:58:10 -07:00
Cheng Xing 85c3de40e5 Fixed vsphere volume plugin unsafe type cast; added unit tests 2018-08-09 16:15:59 -07:00
Kubernetes Submit Queue facc84752b
Merge pull request #67184 from linyouchong/pr-0809
Automatic merge from submit-queue (batch tested with PRs 67195, 67184). 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 redundant code in aws_ebs_block.go

**What this PR does / why we need it**:
Remove redundant code in aws_ebs_block.go
There is the same code in aws_ebs.go

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

**Special notes for your reviewer**:
NONE

**Release note**:
```release-note
NONE
```

/sig storage
2018-08-09 12:18:21 -07:00
Masaki Kimura d03434e370 Fix provision fail issue for aws provisioner if fsType specified
fixes: #67146
2018-08-09 13:32:34 +00:00
linyouchong 5472f445dc Remove redundant code in aws_ebs_block.go 2018-08-09 15:57:05 +08:00
Pengfei Ni 7962954053 Parse zoned first before using it 2018-08-09 10:23:53 +08:00
Cheng Xing 7fa120c18c CSI plugin now calls NodeGetInfo() to get driver's node ID 2018-08-08 13:15:43 -07:00
Pengfei Ni 30fe79d63f Add DynamicProvisioningScheduling and VolumeScheduling support for AzureDisk 2018-08-08 17:05:46 +08:00
Ben Swartzlander 39e52ddae5 Add wait loop for multipath devices to appear
It takes a variable amount of time for the multipath daemon
to create /dev/dm-XX in response to new LUNs being discovered.
The old iscsi_util code only discovered the multipath device
if it was created quickly enough, but in a significant number
of cases, kubelet would grab one of the individual paths and
put a filesystem it on before multipathd could construct a
multipath device.

This change waits for the multipath device to get created for
up to 10 seconds, but only if the PV actually had more than
one portal.
2018-08-08 00:44:45 -04:00
Chakri Nelluri 93a19fce28 Ignore EIO error in unmount path 2018-08-07 21:04:39 -04:00
Kubernetes Submit Queue 14bcbb9450
Merge pull request #66553 from feiskyer/azure-disk-availablity-zone
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 availability zones support to Azure managed disks

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

Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).

This PR adds availability zone support for Azure managed disks and its storage class. Zoned managed disks is enabled by default if there are zoned nodes in the cluster.

The zone could also be customized by `zone` or `zones` parameter, e.g.

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
  name: managed-disk-zone-1
parameters:
  zone: "southeastasia-1"
  # zones: "southeastasia-1,"southeastasia-2"
  cachingmode: None
  kind: Managed
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: Immediate
```

All zoned AzureDisk PV will also be labeled with its availability zone, e.g.

```sh
$ kubectl get pvc pvc-azuredisk-az-1
NAME                 STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE
pvc-azuredisk-az-1   Bound     pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            managed-disk-zone-1   2h

$ kubectl get pv pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c --show-labels
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                        STORAGECLASS          REASON    AGE       LABELS
pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            Delete           Bound     default/pvc-azuredisk-az-1   managed-disk-zone-1             2h        failure-domain.beta.kubernetes.io/region=southeastasia,failure-domain.beta.kubernetes.io/zone=southeastasia-1
```

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

See also the [KEP](https://github.com/kubernetes/community/pull/2364).

DynamicProvisioningScheduling feature would be added in a following PR.

**Release note**:

```release-note
Azure managed disks now support availability zones and new parameters `zoned`, `zone` and `zones` are added for AzureDisk storage class.
```

/kind feature
/sig azure
/assign @brendandburns @khenidak @andyzhangx
2018-08-06 02:02:54 -07:00
Kubernetes Submit Queue cb1ef9f7e8
Merge pull request #64815 from dixudx/hostname_empty
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>.

error out empty hostname

**What this PR does / why we need it**:
For linux, the hostname is read from file `/proc/sys/kernel/hostname` directly, which can be overwritten with whitespaces.

Should error out such invalid hostnames.

**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 kubernetes/kubeadm#835

**Special notes for your reviewer**:
/cc luxas timothysc 

**Release note**:

```release-note
nodes: improve handling of erroneous host names
```
2018-08-03 17:13:32 -07:00
Kubernetes Submit Queue 55d6a013e6
Merge pull request #66675 from humblec/log-file
Automatic merge from submit-queue (batch tested with PRs 61389, 66817, 66903, 66675, 66965). 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>.

Provide an option to supply log-file mount option for gluster plugin.

At present, `log-file` location of glusterfs client mount is decided
by the plugin, however at times, users/admin want to configure log-file
of gluster fuse client process on their own in some setups. Even though they can pass log-file
mount option through storage class, before this patch glusterfs plugin
always discard it. This patch enable/give preference
to admin supplied log-file mount option if specified in storage class.
If the log-file mount option is incomplete or wrong, plugin fallback to the
location which is carved out by the combination of pvc and pod name.

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-08-03 07:33:16 -07:00
Kubernetes Submit Queue b95ae9312c
Merge pull request #61389 from linyouchong/linyouchong-20180320
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>.

csiAttacher: check deviceMountPath before hasStageUnstageCapability

csiAttacher#MountDevice: it is better to check `deviceMountPath` before `hasStageUnstageCapability`

**Release note**:
```
NONE
```
/release-note-none
/kind cleanup
/sig storage
2018-08-03 07:02:46 -07:00
Humble Chirammal 9e29ab985b Provide an option to supply log-file mount option for gluster plugin.
At present, `log-file` location of glusterfs client mount is decided
by the plugin, however at times, users/admin want to configure log-file
of gluster fuse client process on their own in some setups. Even though they can pass log-file
mount option through storage class, before this patch glusterfs plugin
always discard it. This patch enable/give preference
to admin supplied log-file mount option if specified in storage class.
If the log-file mount option is incomplete or wrong, plugin fallback to the
location which is carved out by the combination of pvc and pod name.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-08-02 22:09:49 +05:30
Zhou Peng 92b7810e12
pkg/volume/cephfs: fix doc typo, nfs -> cephfs 2018-08-02 16:11:02 +08:00
Kubernetes Submit Queue d3c09656d7
Merge pull request #66832 from msau42/udev
Automatic merge from submit-queue (batch tested with PRs 64645, 66832). 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>.

Detect if GCE PD udev link is wrong and try to correct it

**What this PR does / why we need it**:
udev can miss scsi events and not update device links properly when disks are detached and reattached to the same node in a different order.  This PR workarounds the issue by comparing the udev link name, which is the PD disk name, with the scsi disk serial number returned from scsi_id, and prevents mounting of the disk if the link is wrong.  It will also run `udevadm trigger` on the disk to try to correct the bad link.

**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
This fix prevents a GCE PD volume from being mounted if the udev device link is stale and tries to correct the link.
```
2018-08-01 17:13:03 -07:00
Kubernetes Submit Queue 22d0ef2a8e
Merge pull request #65730 from ddebroy/ebs-affinity1
Automatic merge from submit-queue (batch tested with PRs 65730, 66615, 66684, 66519, 66510). 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 DynamicProvisioningScheduling support for EBS

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

This PR adds support for the DynamicProvisioningScheduling feature in EBS. With this in place, if VolumeBindingMode: WaitForFirstConsumer is specified in a EBS storageclass and DynamicProvisioningScheduling is enabled, EBS provisioner will use the selected node's LabelZoneFailureDomain as the zone to provision the EBS volume in.

**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**:
Related to #63232

Sample `describe pv` output with NodeAffinity populated:

```
~$ kubectl describe pv pvc-f9d2138b-7e3e-11e8-a4ea-064124617820
Name:              pvc-f9d2138b-7e3e-11e8-a4ea-064124617820
Labels:            failure-domain.beta.kubernetes.io/region=us-west-2
                   failure-domain.beta.kubernetes.io/zone=us-west-2a
Annotations:       kubernetes.io/createdby=aws-ebs-dynamic-provisioner
                   pv.kubernetes.io/bound-by-controller=yes
                   pv.kubernetes.io/provisioned-by=kubernetes.io/aws-ebs
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      slow3
Status:            Bound
Claim:             default/pvc3
Reclaim Policy:    Delete
Access Modes:      RWO
Capacity:          6Gi
Node Affinity:     
  Required Terms:  
    Term 0:        failure-domain.beta.kubernetes.io/zone in [us-west-2a]
                   failure-domain.beta.kubernetes.io/region in [us-west-2]
Message:           
Source:
    Type:       AWSElasticBlockStore (a Persistent Disk resource in AWS)
    VolumeID:   aws://us-west-2a/vol-0fc1cdae7d10860f6
    FSType:     ext4
    Partition:  0
    ReadOnly:   false
Events:         <none>
```

**Release note**:
```release-note
none
```

/sig storage
/assign @msau42 @jsafrane
2018-08-01 15:52:07 -07:00
Michelle Au cf107159b4 Detect if GCE PD udev link is wrong and try to correct it 2018-08-01 10:04:06 -07:00
Deep Debroy 217a3d8902 Add DynamicProvisioningScheduling support for EBS
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-08-01 09:00:03 -07:00
Di Xu b3dfe0c652 nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08:00
Pengfei Ni 6bfd2be2ea Add documentation and unit tests 2018-07-30 13:32:57 +08:00
Pengfei Ni 74813d0d26 Add availability zone support for dynamic provisioning Azure managed disks 2018-07-30 13:31:12 +08:00
Kubernetes Submit Queue c2cbe86f7d
Merge pull request #66648 from feiskyer/azure-sdk-update
Automatic merge from submit-queue (batch tested with PRs 66225, 66648, 65799, 66630, 66619). 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 Azure Go SDK to v19.0.0 and get availability zone for VirtualMachineScaleSetVM

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

Continue of #66242. This PR updates Azure Go SDK to v19.0.0 (with compute API 2018-04-01) and gets availability zones for VirtualMachineScaleSetVM.

**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
Azure Go SDK has been upgraded to v19.0.0 and VirtualMachineScaleSetVM now supports availability zones.
```

/sig azure
/assign @brendandburns @khenidak @andyzhangx
2018-07-27 16:42:08 -07:00
Ardalan Kangarlou ee747b8649 Changed admission controller to allow volume expansion for all volume plugins
There are two motivations for this change:
(1) CSI plugins are soon going to support volume expansion. For such
plugins, admission controller doesn't know whether the plugins are
capabale of supporting volume expansion or not.
(2) Currently, admission controller rejects PVC updates for in-tree plugins
that don't support volume expansion (e.g., NFS, iSCSI). This change allows
external controllers to expand volumes similar to how external provisioners
operate.
2018-07-27 03:06:48 -04:00
jianglingxia aeef7fdca2 Add UT to RBD volume test of TestGetAccessModes and TestRequiresRemount 2018-07-26 10:00:44 +08:00
Kubernetes Submit Queue 845a55dbbd
Merge pull request #63176 from NetApp/bug/59946
Automatic merge from submit-queue (batch tested with PRs 64844, 63176). 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 discovery/deletion of iscsi block devices

This PR modifies the iSCSI attach/detatch codepaths in the following
ways:
1) After unmounting a filesystem on an iSCSI block device, always
flush the multipath device mapper entry (if it exists) and delete
all block devices so the kernel forgets about them.
2) When attaching an iSCSI block device, instead of blindly
attempting to scan for the new LUN, first determine if the target
is already logged into, and if not, do the login first. Once every
portal is logged into, the scan is done.
3) Scans are now done for specific devices, instead of the whole
bus. This avoids discovering LUNs that kubelet has no interest in.
4) Additions to the underlying utility interfaces, with new tests
for the new functionality.
5) Some existing code was shifted up or down, to make the new logic
work.
6) A typo in an existing exec call on the attach path was fixed.

Fixes #59946

```release-note
When attaching iSCSI volumes, kubelet now scans only the specific
LUNs being attached, and also deletes them after detaching. This avoids
dangling references to LUNs that no longer exist, which used to be the
cause of random I/O errors/timeouts in kernel logs, slowdowns during
block-device related operations, and very rare cases of data corruption.
```
2018-07-25 16:19:01 -07:00
Kubernetes Submit Queue 158998b8b2
Merge pull request #66612 from humblec/enable-mountoptions
Automatic merge from submit-queue (batch tested with PRs 66373, 66612). 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 `auto_unmount` mount option from pv spec annotation.

At present, `auto_unmount` option is recorded at PV annotation of glusterfs PV.
Due to the preference given in MountOptionFromSpec() for annotation mount options
over sc supplied mount options(Ref PR# https://github.com/kubernetes/kubernetes/pull/66576),
the sc supplied mount options are not honoured in glusterfs plugin
eventhough the driver returns `true` for storage class mountoptions
support at probe.

This patch removes `auto_unmount` option from annotation of the pv spec

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-07-25 14:23:03 -07:00
Kubernetes Submit Queue 4378a999e1
Merge pull request #66373 from jianglingxia/jlx-k8s-201807191640
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 UT Test to cephfs

**What this PR does / why we need it**:
Add UT Test to cephfs
**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-25 13:25:39 -07:00
Humble Chirammal d4480d4f32 Remove `auto_unmount` mount option from pv spec annotation to setup() func.
At present, `auto_unmount` option is recorded at PV annotation of glusterfs PV.
Due to the preference given in MountOptionFromSpec() for annotation mount options
over sc supplied mount options(Ref PR# https://github.com/kubernetes/kubernetes/pull/66576),
the sc supplied mount options are not honoured in glusterfs plugin
eventhough the driver returns `true` for storage class mountoptions
support at probe.

This patch removes `auto_unmount` option from annotation of the pv spec.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-07-25 22:27:40 +05:30
Pengfei Ni 5bf3b2119b Update compute API to 2018-04-01 2018-07-25 17:39:32 +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
Ben Swartzlander 6d23d8edbb Avoid deleted iSCSI LUNs in the kernel
This change ensures that iSCSI block devices are deleted after
unmounting, and implements scanning of individual LUNs rather
than scanning the whole iSCSI bus.

In cases where an iSCSI bus is in use by more than one attachment,
detaching used to leave behind phantom block devices, which could
cause I/O errors, long timeouts, or even corruption in the case
when the underlying LUN number was recycled. This change makes
sure to flush references to the block devices after unmounting.

The original iSCSI code scanned the whole target every time a LUN
was attached. On storage controllers that export multiple LUNs on
the same target IQN, this led to a situation where nodes would
see SCSI disks that they weren't supposed to -- possibly dozens or
hundreds of extra SCSI disks. This caused 3 significant problems:

1) The large number of disks wasted resources on the node and
caused a minor drag on performance.
2) The scanning of all the devices caused a huge number of uevents
from the kernel, causing udev to bog down for multiple minutes in
some cases, triggering timeouts and other transient failures.
3) Because Kubernetes was not tracking all the "extra" LUNs that
got discovered, they would not get cleaned up until the last LUN
on a particular target was detached, causing a logout. This led
to significant complications:

In the time window between when a LUN was unintentially scanned,
and when it was removed due to a logout, if it was deleted on the
backend, a phantom reference remained on the node. In the best
case, the phantom LUN would cause I/O errors and timeouts in the
udev system. In the worst case, the backend could reuse the LUN
number for a new volume, and if that new volume were to be
scheduled to a pod with a phantom reference to the old LUN by the
same number, the initiator could get confused and possibly corrupt
data on that volume.

To avoid these problems, the new implementation only scans for
the specific LUN number it expects to see. It's worth noting that
the default behavior of iscsiadm is to automatically scan the
whole bus on login. That behavior can be disabled by setting
node.session.scan = manual
in iscsid.conf, and for the reasons mentioned above, it is
strongly recommended to set that option. This change still works
regardless of the setting in iscsid.conf, and while automatic
scanning will cause some problems, this change doesn't make the
problems any worse, and can make things better in some cases.
2018-07-24 23:58:19 -04:00
jianglingxia 6a75ec264c Add UT Test to cephfs 2018-07-25 10:40:16 +08:00
Kubernetes Submit Queue 9e0c4a6095
Merge pull request #66488 from linyouchong/pr-0723-csi-labelmanager
Automatic merge from submit-queue (batch tested with PRs 66464, 66488). 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 glog instead of fmt

**What this PR does / why we need it**:
Use glog instead of fmt

**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 #
NONE
**Special notes for your reviewer**:
NONE
**Release note**:
```release-note
NONE
```

/sig storage
2018-07-24 19:03:04 -07:00
Kubernetes Submit Queue 35c3764bbb
Merge pull request #66464 from wongma7/round-overflow
Automatic merge from submit-queue (batch tested with PRs 66464, 66488). 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>.

Avoid overflowing int64 in RoundUpSize and return error if overflow int

**What this PR does / why we need it**:
There are many places in plugins (some I may have missed) that we naively convert a resource.Quantity.Value() which is an int64, to an int, which may be only 32 bits long.

Background, optional to read :): Kubernetes canonicalizes resource.Quantities, and from what I have seen testing creating PVCs, decimalSI is the default. If a quantity is in `decimalSI` format and its value in bytes would overflow an int64, e.g. `10E`, nothing happens. If it is in binarySI and its value in bytes would overflow an int64, e.g. `10Ei`, it is set down to 2^63-1 and there's no overflow of the field value. But there may be overflow later in the code which is what this PR is addressing.

* Change `RoundUpSize` implementation to avoid overflowing `int64`
* Add `RoundUp*Int` functions for use when an `int` is expected instead of an `int64`, because `int` may be 32bits and naively doing `int($INT64_VALUE)` can lead to silent overflow. These functions return an error if overflow has occurred.
* Rename `*GB` variables to `*GiB` where appropriate for maximum clarity
* Use `RoundUpToGiB` instead of `RoundUpSize` where possible

**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**: please review carefully as we don't have e2e tests for most plugins!

**Release note**:

```release-note
NONE
```
edit: remove 'we do not need to worry about...'. yes we do, i worded that badly :))
2018-07-24 19:03:01 -07:00
linyouchong f2e92776bc Use glog instead of fmt 2018-07-24 09:46:56 +08:00
Matthew Wong 093e231289 Avoid overflowing int64 in RoundUpSize and return error if overflow int 2018-07-23 13:48:45 -04:00
Kubernetes Submit Queue 53ee0c8652
Merge pull request #65660 from mtaufen/incremental-refactor-kubelet-node-status
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). 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>.

Refactor kubelet node status setters, add test coverage

This internal refactor moves the node status setters to a new package, explicitly injects dependencies to facilitate unit testing, and adds individual unit tests for the setters.

I gave each setter a distinct commit to facilitate review.

Non-goals:
- I intentionally excluded the class of setters that return a "modified" boolean, as I want to think more carefully about how to cleanly handle the behavior, and this PR is already rather large.
- I would like to clean up the status update control loops as well, but that belongs in a separate PR.

```release-note
NONE
```
2018-07-20 12:12:24 -07:00
Seungcheol Ko 43f805b7bd Fix a typo in csiPlugin comment 2018-07-19 21:01:09 +09:00
linyouchong 51e81d2585 csiAttacher: check deviceMountPath before hasStageUnstageCapability 2018-07-19 11:26:45 +08:00
Kubernetes Submit Queue 78082a6a28
Merge pull request #66174 from ddebroy/scaleio1
Automatic merge from submit-queue (batch tested with PRs 64690, 66174). 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 presence of /dev/disk/by-id before reading it in ScaleIO

**What this PR does / why we need it**:
In certain OS environments, like RHEL 7.4 using Xen PV driver `xen_blkfront` for boot and data disks, the path `/dev/disk/by-id` does not exist in the OS post boot. When trying to dynamically provision PVs from a ScaleIO storageclass in such an environment, ScaleIO fails when trying to create the PV with:
```
E0711 08:02:50.441964   25246 sio_client.go:342] scaleio: failed to ReadDir /dev/disk/by-id: open /dev/disk/by-id: no such file or directory
E0711 08:02:50.441989   25246 sio_volume.go:123] scaleio: setup of volume k8svol-282bd4fa84d:  open /dev/disk/by-id: no such file or directory
```
This PR avoids the above failure by first checking for the presence of `/dev/disk/by-id` before attempting to read from it as done in other drivers like gce_pd. 


**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
```
/sig storage
2018-07-18 03:32:59 -07:00
Deep Debroy 7392ed4ba0 Check presence of sioDiskIDPath before reading it
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-07-17 09:55:46 -07:00
Kubernetes Submit Queue 77205b90a0
Merge pull request #66172 from krunaljain/bugfix/revert_pd_size_rounding_to_GB
Automatic merge from submit-queue (batch tested with PRs 66172, 66254). 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>.

Reverting commit #56600 as GCE PD is allocated in chunks of GiB inste…

**What this PR does / why we need it:**
This PR reverts the changes made in commit https://github.com/kubernetes/kubernetes/pull/56600 which considered GCE PDs are allocated in chunks of GBs. The following set of operations demonstrate the allocation is in GiBs. 

Manually create a PD in GB, and manually attach it to a node:
```
$ gcloud compute disks create msau-test --zone=us-central1-b --size=1GB
```
Run lsblk on it, and it shows the bytes of the disk are 1GiB:
```
$ lsblk -b
sdc       8:32   0  1073741824  0 disk 
```

**Which issue(s) this PR fixes**:
[65285](https://github.com/kubernetes/kubernetes/issues/65285)
**Special notes for your reviewer**:
```release-note
none
```
2018-07-17 02:13:03 -07:00
Kubernetes Submit Queue 2a0bc7af6d
Merge pull request #65429 from WanLinghao/projected_error_return_fix
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 a return miss bug

**What this PR does / why we need it**:
This PR fix a return sentence miss bug
**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-16 13:52:54 -07:00
Krunal Jain 539b3693f4 Reverting commit #56600 as GCE PD is allocated in chunks of GiB instead of GBs
Fixing comments and importing constant from util

Importing constant from util

Fixing comment in volume_provisioning.go
2018-07-16 11:55:57 -07:00
Michael Taufen 36f7bc76bf extend FakeVolumePlugin to implement VolumePluginWithAttachLimits interface 2018-07-16 09:09:48 -07:00
Kubernetes Submit Queue 0fcc384258
Merge pull request #65767 from scf0920/branch-4
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>.

typo fix: fromat->format

**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
NONE
```
2018-07-15 06:21:45 -07:00
tanshanshan 3ed3873748 fixformat 2018-07-14 10:34:21 +08:00
Kubernetes Submit Queue 0972ce1acc
Merge pull request #65649 from rsc/fix-printf
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). 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>.

kubernetes: fix printf format errors

These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

```release-note
NONE
```
2018-07-11 14:09:08 -07:00
Kubernetes Submit Queue 82c986ecbc
Merge pull request #65978 from sngchlko/labeling-region-to-cinder-pv
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 region label to dynamic provisioned cinder PVs

**What this PR does / why we need it**:
This PR adds region label to dynamic provisioned Cinder PVs at the time of the PV creation.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-07-11 05:28:02 -07:00
Kubernetes Submit Queue 4a5f96190a
Merge pull request #65992 from liggitt/downward-sorting
Automatic merge from submit-queue (batch tested with PRs 66038, 65992, 66008). 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>.

Stop sorting downward api file lines

Fixes #65159

```release-note
fixes an issue with multi-line annotations injected via downward API files getting scrambled
```
2018-07-10 17:02:04 -07:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
Kubernetes Submit Queue d51175901a
Merge pull request #65705 from jsafrane/no-block-fstype
Automatic merge from submit-queue (batch tested with PRs 65931, 65705, 66033). 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 should have empty FSType

FSType in block PVs has no meaning and it should be empty in provisioned PVs.

**Which issue(s) this PR fixes**
Fixes #65704

**Release note**:

```release-note
NONE
```
2018-07-10 14:09:08 -07:00
Kubernetes Submit Queue 421789328f
Merge pull request #65997 from tallclair/writer
Automatic merge from submit-queue (batch tested with PRs 66030, 65997). 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 io util writer & volume host GetWriter()

Cleanup unused code.
Fixes https://github.com/kubernetes/kubernetes/issues/16971

**Release note**:
```release-note
NONE
```

/kind cleanup
/sig storage
2018-07-10 12:46:09 -07:00
Kubernetes Submit Queue 3b269e182d
Merge pull request #65499 from krunaljain/bugfix/csi_default_fs_type
Automatic merge from submit-queue (batch tested with PRs 55023, 65499). 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>.

Bugfix/csi default fs type

This PR address the issue mentioned in the following ticket https://github.com/kubernetes/kubernetes/issues/65122 
The FSType string will now not be defaulted to ext4. Removes defaulting of CSI file system type to ext4. CSI plugins that depended on this default need to be updated as the fsType would remain an empty string if not provided and would not default to ext4. CSI spec allows for an empty fstype string. This is intended for non-block plugins like nfs and gluster where filesystems are not separately created on the volume. But currently the default file system is overridden to ext4  which makes the above case redundant. This commit prevents such an overridding. 


```release-note  
ACTION REQUIRED: Removes defaulting of CSI file system type to ext4. All the production drivers listed under https://kubernetes-csi.github.io/docs/Drivers.html were tested and work as expected after this change. If you are using a driver not in that list, please test the drivers on an updated test cluster first. ```
2018-07-10 10:18:08 -07:00
Tim Allclair b1012b2543
Remove unused io util writer & volume host GetWriter() 2018-07-09 14:09:48 -07:00
Jordan Liggitt 3f09fecbe0
Stop sorting downward api file lines 2018-07-09 15:44:03 -04:00
Seungcheol Ko 1df1181b4f Add region label to dynamic provisioned cinder PVs 2018-07-09 23:24:11 +09:00
Kubernetes Submit Queue 3155ea2a18
Merge pull request #65549 from gnufied/fix-flexvolume-containers
Automatic merge from submit-queue (batch tested with PRs 65456, 65549). 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 flexvolume in containerized kubelets

Fixes flex volumes in containerized kubelets.

cc @jsafrane @chakri-nelluri @verult 

Note to reviewers : e2e tests pass in local containarized cluster. 

```release-note
Fix flexvolume in containarized kubelets
```
2018-07-09 06:24:06 -07:00
Kubernetes Submit Queue 9cb2ee0992
Merge pull request #65456 from wenlxie/upstream.master.csivolumemode
Automatic merge from submit-queue (batch tested with PRs 65456, 65549). 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 volume mode field to constructed volume spec for CSI plugin

Add volume mode filed to constructed Volume Spec for CSI plugin

```release-note
Add volume mode filed to constructed volume spec for CSI plugin
```
2018-07-09 06:24:03 -07:00
Kubernetes Submit Queue 76ce56168e
Merge pull request #64593 from WanLinghao/unused_function_clean
Automatic merge from submit-queue (batch tested with PRs 64593, 65117, 65629, 65827, 65686). 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 unused function in file pkg/volume/projected/projected.go

**What this PR does / why we need it**:
It was imported by https://github.com/kubernetes/kubernetes/pull/37237
And it is unusable at first place when it was imported
**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-04 18:52:07 -07:00
Kubernetes Submit Queue e35ecf1618
Merge pull request #65573 from CaoShuFeng/csi
Automatic merge from submit-queue (batch tested with PRs 65628, 65573). 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>.

run test TestAttacherMountDevice in temp directory

This change fix two unit test:

1. After run command `make test WHAT=k8s.io/kubernetes/pkg/volume/csi KUBE_TEST_ARGS='-run ^TestAttacherMountDevice$'`
There is a file leaked in work space:
pkg/volume/csi/vol_data.json


2. make test WHAT=k8s.io/kubernetes/pkg/volume/csi KUBE_TEST_ARGS='-run ^TestAttacherUnmountDevice$'
   This  test fails if it does not run along with TestAttacherMountDevice.

This change fix it.


**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
NONE
```
2018-07-04 03:29:05 -07:00
Hemant Kumar 8db5328c4c Implement fixes for flexvolume when kubelet is contanerized
Fix bug with nsenter root path
2018-07-03 14:04:52 -04:00
cfshang 1da598457c typo fix: fromat->format 2018-07-03 22:52:18 +08:00
Kubernetes Submit Queue f7d95e208a
Merge pull request #65691 from jsafrane/azure-managed-error
Automatic merge from submit-queue (batch tested with PRs 65348, 65599, 65635, 65688, 65691). 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>.

azure: Add validation of resourceGroup option.

ResourceGroup can be set only on `kind: Managed` disks.


**Release note**:

```release-note
NONE
```

/assign @andyzhangx
2018-07-02 16:52:18 -07:00
Kubernetes Submit Queue 92b81114f4
Merge pull request #65536 from gnufied/fix-flex-crashing-controller-manager
Automatic merge from submit-queue (batch tested with PRs 65299, 65524, 65154, 65329, 65536). 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>.

Make various fixes to flex tests and fix some crashes

* Fixes two controller-manager crashes when a flex plugin gets removed from flex directory.
* Also enables e2e tests to run in local clusters and other environments.
* Removes disruptive from flex e2e tests because flex can be installed in a running cluster and does not require kubelet or controller-manager restart anymore.

/sig storage

cc @verult @jsafrane 

```release-note
Fix controller-manager crashes when flex plugin is removed from flex plugin directory
```
2018-07-02 11:06:24 -07: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
Jan Safranek efdb29d5d5 azure: Add validation of resourceGroup option.
ResourceGroup can be set only on kind: Managed disks.
2018-07-02 09:49:40 +02:00
Kubernetes Submit Queue 55c5aaac1f
Merge pull request #65310 from wenlxie/upstream.master.fixlocalvolumevmnotfound
Automatic merge from submit-queue (batch tested with PRs 65582, 65480, 65310, 65644, 65645). 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 local volume directory can't be deleted issue

**What this PR does / why we need it**:
Need to add volume mode field to constructed pv spec.

**Special notes for your reviewer**:
I  get an issue:
1) kubelet has lots of logs with errors  related with volume mode
```
Jun 21 10:31:18  kubelet[19333]: E0621 10:31:18.422321   19333 reconciler.go:179] operationExecutor.NewVolumeHandler for UnmountVolume failed for volume "lv-e57cf589-4658-4881-b125-7b9f35c2c8eb" (UniqueName: "kubernetes.io/local-volume/4103e613-656c-11e8-8c20-74dbd180ddb4-lv-e57cf589-4658-4881-b125-7b9f35c2c8eb") pod "4103e613-656c-11e8-8c20-74dbd180ddb4" (UID: "4103e613-656c-11e8-8c20-74dbd180ddb4") : cannot get volumeMode for volume: lv-e57cf589-4658-4881-b125-7b9f35c2c8eb
Jun 21 10:31:18  kubelet[19333]: E0621 10:31:18.422351   19333 reconciler.go:179] operationExecutor.NewVolumeHandler for UnmountVolume failed for volume "lv-b1e788ac-78eb-4d26-819a-263cef5337ea" (UniqueName: "kubernetes.io/local-volume/4082c1da-656c-11e8-8c20-74dbd180ddb4-lv-b1e788ac-78eb-4d26-819a-263cef5337ea") pod "4082c1da-656c-11e8-8c20-74dbd180ddb4" (UID: "4082c1da-656c-11e8-8c20-74dbd180ddb4") : cannot get volumeMode for volume: lv-b1e788ac-78eb-4d26-819a-263cef5337ea
```
2) The pod is an orphan pod and have the volume directory left at the node

3) Because of the errors, the volume directory will never be deleted

**Release note**:
```release-note
Fix local volume directory can't be deleted because of volumeMode error
```
2018-06-29 20:14:12 -07:00
Hemant Kumar 4e7c2f638d Make various fixes to flex tests and fix some crashes
Remove disruptive from flex
2018-06-29 11:10:26 -04:00
wenlxie 0df13e7d18 add volume mode field to constructed VolumeSpec 2018-06-29 18:00:47 +08:00
wenlxie 23722fbdfa fix localvolume volume mode not found issue 2018-06-29 17:42:10 +08:00
Cao Shufeng a9525c8c0a fix unit test TestAttacherUnmountDevice
Before this test such command fails:
```
make test WHAT=k8s.io/kubernetes/pkg/volume/csi KUBE_TEST_ARGS='-run ^TestAttacherUnmountDevice$'
```
2018-06-29 10:20:45 +08:00
Krunal Jain 5dfe7b5758 Removes defaulting of CSI fsType to ext4 2018-06-28 16:48:25 -07:00
Kubernetes Submit Queue 44073e6f43
Merge pull request #64660 from figo/master
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 support for plugin directory hierarchy

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

Add hierarchy support for plugin directory, it traverses and 
watch plugin directory and its sub directory recursively.

plugin socket file only need be unique within one directory,
``` 
 plugin socket directory  
    |  
    ---->sub directory 1
    |              |  
    |              ----->  socket1,  socket2 ...
    ----->sub directory 2
                  |
                  ------> socket1, socket2 ...  
```
the design itself allow sub directory be anything,
but in practical, each plugin type could just use one sub directory.

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

**Special notes for your reviewer**:

twos bonus changes added as below

1) propose to let pluginWatcher bookkeeping registered plugins,
to make sure plugin name is unique within one plugin type.  
arguably, we could let each handler do the same work, but it requires
every handler repeat the same thing.    
 
2) extract example handler out from test, it is easier to read the code with the
seperation.  


**Release note**:

```release-note
N/A
```

/sig node
/cc @vikaschoudhary16  @jiayingz @RenaudWasTaken @vishh @derekwaynecarr  @saad-ali @vladimirvivien @dchen1107 @yujuhong @tallclair @Random-Liu @anfernee @akutz
2018-06-28 14:53:44 -07:00
Cao Shufeng 65ead1950f run test TestAttacherMountDevice in temp directory 2018-06-28 17:18:23 +08:00
Kubernetes Submit Queue 23000cfbd3
Merge pull request #65443 from jsafrane/azure-zone
Automatic merge from submit-queue (batch tested with PRs 64246, 65489, 65443). 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>.

azure: Move configuration of resource group in storage class.

**What this PR does / why we need it**:
This moves configuration of Azure resource group into storage class. Users can't configure dynamic provisioning in PVCs, because that makes the PVC not portable to other Kubernetes installations, possibly on other clouds.

/sig storage
/assign @andyzhangx 

**Release note**:

```release-note
NONE
```
2018-06-27 08:17:17 -07:00
Kubernetes Submit Queue 24ab69d358
Merge pull request #65447 from wongma7/mapvolume-symlink
Automatic merge from submit-queue (batch tested with PRs 65492, 65516, 65447). 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>.

Resolve potential devicePath symlink when MapVolume in containerized kubelet

**What this PR does / why we need it**: Ensures local block volumes will work in case kubelet is running in a 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 #65445

**Special notes for your reviewer**: Code is mostly plumbing. If there is a better way to do it, let me know :)

I assume there will be e2e tests for the non-containerized case. I will need to test the containerized case myself, which may take a while.
**Release note**:

```release-note
NONE
```
2018-06-27 02:15:12 -07:00
Kubernetes Submit Queue e55ea1608a
Merge pull request #65323 from jsafrane/fix-csi-json
Automatic merge from submit-queue (batch tested with PRs 65404, 65323, 65468). 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 cleanup of volume metadata json file.

Create the json file with metadata as the last item, when everything else is ready, so we don't need to clean up the file in all error cases in this function.

Fixes #65322

**Release note**:
```release-note
Fixed cleanup of CSI metadata files.
```

/assign @saad-ali @vladimirvivien
2018-06-26 17:33:05 -07:00
Matthew Wong b376b31ee0 Resolve potential devicePath symlink when MapVolume in containerized kubelet 2018-06-26 13:08:36 -04:00
hui luo d04f596829 Add hierarchy support for plugin directory
it traverses and watch plugin directory and its sub directory recursively,
plugin socket file only need be unique within one directory,

- plugin socket directory
-    |
-    ---->sub directory 1
-    |              |
-    |              ----->  socket1,  socket2 ...
-    ----->sub directory 2
-                  |
-                  ------> socket1, socket2 ...

the design itself allow sub directory be anything,
but in practical, each plugin type could just use one sub directory.

four bonus changes added as below

1. extract example handler out from test, it is easier to read the code
with the seperation.

2. there are two variables here: "Watcher" and "watcher".
"Watcher" is the plugin watcher, and "watcher" is the fsnotify watcher.
so rename the "watcher" to "fsWatcher" to make code easier to
understand.

3. change RegisterCallbackFn() return value order, it is
conventional to return error last, after this change,
the pkg/volume/csi is compliance with golint, so remove it
from hack/.golint_failures

4. refactor errors handling at invokeRegistrationCallbackAtHandler()
to make error message more clear.
2018-06-25 17:32:18 -07:00
Jan Safranek 291f277fe7 azure: Move configuration of resource group in storage class. 2018-06-25 17:39:59 +02:00
WanLinghao 06b1eae63c fix a return miss bug 2018-06-25 15:27:54 +08:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Kubernetes Submit Queue cbe4f48866
Merge pull request #65064 from davidz627/fix/CSIe2eAttach
Automatic merge from submit-queue (batch tested with PRs 65064, 65218, 65260, 65241, 64372). 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>.

Added attach/mount/check steps to CSI Driver E2E tests

This PR makes the CSI Volume E2E tests actually go through the entire dynamic provisioning pipeline and test attach/mount/check file etc.

Fixes #64927

```release-note
None
```
2018-06-21 21:12:09 -07:00
Kubernetes Submit Queue 02dba36128
Merge pull request #65019 from mirake/fix-typo-toto
Automatic merge from submit-queue (batch tested with PRs 65265, 64822, 65026, 65019, 65077). 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>.

Typo fix: toto -> to
2018-06-21 11:25:16 -07:00
Jan Safranek 9069efe73a Fix cleanup of volume metadata json file.
Create the json file with metadata as the last item, when everything
else is ready, so we don't need to clean up the file in all error cases
in this function.
2018-06-21 18:43:22 +02:00
Kubernetes Submit Queue f04218071f
Merge pull request #64895 from harsh-px/64894
Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). 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>.

In case storage class parameters are empty, create a new map for Portworx volume labels

Signed-off-by: Harsh Desai <harsh@portworx.com>

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

Fixes #64894

**Release note**:
```release-note
Fixes an issue where Portworx PVCs remain in pending state when created using a StorageClass with empty parameters
```
2018-06-21 04:15:04 -07:00
Kubernetes Submit Queue f9ec17d079
Merge pull request #64879 from bertinatto/cinder_block
Automatic merge from submit-queue (batch tested with PRs 65256, 64236, 64919, 64879, 57932). 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 block volume support to Cinder volume plugin

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

This PR adds block volume support to Cinder volume plugin.

**Release note**:

```release-note
Added block volume support to Cinder volume plugin.
```
2018-06-20 17:22:18 -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 92dfcfcb65
Merge pull request #64882 from jsafrane/csi-mount-json
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 UnmountDevice with deleted pod.

When a pod is deleted, kubelet can't read VolumeAttachment objects. It should cache all information in a json file.

Fixes #63827

~~Work in progress: missing (unit?) tests~~

**Release note**:

```release-note
NONE
```

@saad-ali @vladimirvivien @sbezverk 
/sig storage
2018-06-20 09:59:57 -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
Kubernetes Submit Queue 936f007cb9
Merge pull request #64588 from louyihua/fix_flexvolume_log
Automatic merge from submit-queue (batch tested with PRs 64416, 63625, 60967, 64767, 64588). 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 some log issues in flexvolume

**What this PR does / why we need it**:
This PR fixes some log errors in flexvolume's code. Currently some log statements logs the fuction call `spec.Name()` as `spec.Name`, which causes an address appeared in the log.

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


**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-20 07:12:31 -07:00
Kubernetes Submit Queue f485cb790f
Merge pull request #64416 from cofyc/remove_unnecessary_getmountrefs
Automatic merge from submit-queue (batch tested with PRs 64416, 63625, 60967, 64767, 64588). 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 mount.GetMountRefs in favor of mounter.GetMountRefs

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

Currently, there are two `GetMountRefs` functions:

- `mount.GetMountRefs`: used in various volume plugins
- `<mounter>.GetMountRefs` (previously `mount.GetMountRefsByDev` introduced in [#49988](https://github.com/kubernetes/kubernetes/pull/49988/files#diff-0c0020e71c995790a90ad9c61ede7632R154), moved to `Mounter` interface in #62903)

This is confusing, and it's better to implement `GetMountRefs` on mounter interface, because different mounters can have their own implementation (especially for nsenter).

This pr removes `mount.GetMountRefs` in favor of mounter.GetMountRefs.

More discussions: https://github.com/kubernetes/kubernetes/pull/62102#issuecomment-390081884 and https://github.com/kubernetes/kubernetes/pull/62102#issuecomment-390123022.

**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-06-20 07:12:14 -07:00
Kubernetes Submit Queue 3f581dc265
Merge pull request #64427 from andyzhangx/azuredisk-rg
Automatic merge from submit-queue (batch tested with PRs 65032, 63471, 64104, 64672, 64427). 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 external resource group support for azure disk

**What this PR does / why we need it**:
add external resource group support for azure disk, 
 - without this PR, user could only create dynamic azure disk in the same resource group as cluster
 - with this PR, user could specify external resource group in PVC:
```
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-azuredisk
  annotations:
    volume.beta.kubernetes.io/resource-group: "USER-SPECIFIED-RG"  
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: hdd
```

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

**Special notes for your reviewer**:
Pls note above config won't change resource group for azure disk forever, next time if user don't specify resource group, only default resource group will be used.

**Release note**:

```
add external resource group support for azure disk
```
/sig azure
/assign @feiskyer @karataliu 
/cc @khenidak
2018-06-20 04:23:24 -07:00
Kubernetes Submit Queue ee1224bf9f
Merge pull request #65032 from vladimirvivien/csi-block-path-fix
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 block map file path fix

**What this PR does / why we need it**:
This PR is a bug fix that addresses the way CSI communicates block volume path.  Instead of sending a directory to the external CSI driver, this PR fixes it to send path to a pre-existing file used for block mapping.

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

**Special notes for your reviewer**:
/kind bug

**Release note**:
```release-note
NONE
```
2018-06-20 04:20:57 -07:00
Yecheng Fu c542b6be5d Remove mount.GetMountRefs in favor of mounter.GetMountRefs 2018-06-20 17:01:27 +08:00
Kubernetes Submit Queue 148350d3c4
Merge pull request #64426 from cofyc/remove_unnecessary_fakemounters
Automatic merge from submit-queue (batch tested with PRs 64142, 64426, 62910, 63942, 64548). 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 up fake mounters.

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

Fixes https://github.com/kubernetes/kubernetes/issues/61502

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

list of fake mounters:

- (keep) pkg/util/mount.FakeMounter
- (removed) pkg/kubelet/cm.fakeMountInterface:
- (inherit from mount.FakeMounter) pkg/util/mount.fakeMounter
- (inherit from mount.FakeMounter) pkg/util/removeall.fakeMounter
- (removed) pkg/volume/host_path.fakeFileTypeChecker

**Release note**:

```release-note
NONE
```
2018-06-20 00:05:10 -07:00
David Zhu 77df3ff525 Added attach/mount/check steps to CSI Driver E2E tests 2018-06-19 13:43:36 -07:00
Vladimir Vivien 6553e2c849 CSI block fix for mapping path 2018-06-18 12:46:07 -04:00
ruicao 95c232ee07 Typo fix: toto -> to 2018-06-12 23:12:39 +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
Fabio Bertinatto d03b04344a Add block volume support to Cinder volume plugin 2018-06-08 15:42:45 +02:00
Harsh Desai b5234d33dd In case storage class parameters are empty, create a new map for Portworx volume labels
Fixes #64894

Signed-off-by: Harsh Desai <harsh@portworx.com>
2018-06-07 14:09:25 -07:00
Kubernetes Submit Queue 1a4d0630af
Merge pull request #64855 from gnufied/fix-configmap-cleanup-on-fail
Automatic merge from submit-queue (batch tested with PRs 63905, 64855). 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 setup of configmap/secret/projected/downwardapi

Only call setup after they are found; otherwise
we are left with orphan directories that are never
cleaned up.

Fixes https://github.com/kubernetes/kubernetes/issues/64788 and https://github.com/kubernetes/kubernetes/issues/64779

cc @aveshagarwal @saad-ali 

/sig storage

```release-note
None
```
2018-06-07 11:40:15 -07:00
Jan Safranek acad9d89fa Fix UnmountDevice with deleted pod.
When a pod is deleted, kubelet can't read VolumeAttachment objects. It
should cache all information in a json file.
2018-06-07 17:05:16 +02:00
Hemant Kumar f44d1b9b37 Fix setup of configmap/secret/projected/downwardapi
Only call setup after they are found; otherwise
we are left with orphan directories that are never
cleaned up.
2018-06-07 09:15:01 -04:00
Kubernetes Submit Queue e188271f1b
Merge pull request #64723 from vladimirvivien/csi-block-support
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 implementation of raw block volume support

**What this PR does / why we need it**:
This PR implements support for block volumes feature.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Provides API support for external CSI storage drivers to support block volumes.
```
2018-06-06 11:05:12 -07:00
andyzhangx f533e378ec specify external resource group in ResizeDisk
fix issue
2018-06-06 05:39:53 +00:00
andyzhangx e6fdcb4af3 add external resource group support for azure disk
fix naming issue

fix comments
2018-06-06 05:19:32 +00:00
Kubernetes Submit Queue ad9722c453
Merge pull request #64732 from jingxu97/June/attachVolumeLimit
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 GCE PD attachable volume limit based on machineType

This PR implements the function to return attachable volume limit based
on machineType for GCE PD. This is part of the design in kubernetes/community#2051/
2018-06-05 17:24:40 -07: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
Vladimir Vivien 5044a3d12c CSI implementation of raw block volume support 2018-06-05 16:53:56 -04:00
Jing Xu 8b31fcf3a2 Set GCE PD attachable volume limit based on machineType
This PR implements the function to return attachable volume limit based
on machineType for GCE PD. This is part of the design in kubernetes/community#2051/
2018-06-05 13:47:38 -07:00
Kubernetes Submit Queue 0b90c414c5
Merge pull request #64094 from vladimirvivien/block-MapDeviceFunc-Refactor
Automatic merge from submit-queue (batch tested with PRs 64276, 64094, 64719, 64766, 64750). 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>.

Delegate map operation to BlockVolumeMapper plugin 

**What this PR does / why we need it**:
This PR refactors the volume controller's operation generator, for block mapping, to delegate core block mounting sequence to the `volume.BlockVolumeMapper` plugin instead of living in the operation generator.  This is to ensure better customization of block volume logic for existing internal volume plugins.

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

```release-note
NONE
```
/sig storage
2018-06-05 11:35:13 -07:00
Kubernetes Submit Queue c178c7fd65
Merge pull request #62005 from mikedanese/svcacctproj
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>.

implement ServiceAccountTokenProjection

design here: https://github.com/kubernetes/community/pull/1973

part of https://github.com/kubernetes/kubernetes/pull/61858

```release-note
Add a volume projection that is able to project service account tokens.
```

part of https://github.com/kubernetes/kubernetes/issues/48408

@kubernetes/sig-auth-pr-reviews @kubernetes/sig-storage-pr-reviews
2018-06-05 09:30:56 -07:00
Kubernetes Submit Queue 3b6c2472c3
Merge pull request #64709 from gnufied/fix-node-alpha-tests
Automatic merge from submit-queue (batch tested with PRs 64344, 64709, 64717, 63631, 58647). 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 panic caused by no cloudprovider in test

We should not panic when no cloudprovider is present

Fixes https://github.com/kubernetes/kubernetes/issues/64704

Also added a test to cover the panic.

/sig storage
/sig node

```release-note
None
```
2018-06-05 02:16:08 -07:00
lichuqiang bccc8fe979 Provision interface change 2018-06-05 16:35:16 +08:00
Kubernetes Submit Queue 0647cff9ff
Merge pull request #64386 from andyzhangx/azuredisk-sizegrow
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 azuredisk PV size grow feature

**What this PR does / why we need it**:
According to kubernetes/features#284, add size grow feature for azure disk

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

**Special notes for your reviewer**:
 - This feature is ony for azure managed disk, and if that disk is already attached to a running VM, disk resize will fail as following:
```
$ kubectl describe pvc pvc-azuredisk
Events:
  Type     Reason              Age               From           Message
  ----     ------              ----              ----           -------
  Warning  VolumeResizeFailed  51s (x3 over 3m)  volume_expand  Error expanding volume "default/pvc-azuredisk" of plugin kubernetes.io/azure-disk : disk.DisksClient#CreateOrUpdate: Failure responding to request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=409 Code="OperationNotAllowed" Message="Cannot resize disk andy-mg1102-dynamic-pvc-d2d00dd9-6185-11e8-a6c3-000d3a0643a8 while it is attached to running VM /subscriptions/.../resourceGroups/.../providers/Microsoft.Compute/virtualMachines/k8s-agentpool-17607330-0."
```

**How to use this feature**
 - `kubectl edit pvc pvc-azuredisk` to change azuredisk PVC size from 6GB to 10GB
```
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
...
    volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/azure-disk
  creationTimestamp: 2018-05-27T08:13:23Z
  finalizers:
  - kubernetes.io/pvc-protection
  name: pvc-azuredisk
...
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 6Gi
  storageClassName: hdd
  volumeMode: Filesystem
  volumeName: pvc-d2d00dd9-6185-11e8-a6c3-000d3a0643a8
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 6Gi
  conditions:
  - lastProbeTime: null
    lastTransitionTime: 2018-05-27T08:14:34Z
    message: Waiting for user to (re-)start a pod to finish file system resize of
      volume on node.
    status: "True"
    type: FileSystemResizePending
  phase: Bound
```

 - After resized, `/mnt/disk` is still 6GB
```
$ kubectl exec -it nginx-azuredisk -- bash
# df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/sdf        5.8G   15M  5.5G   1% /mnt/disk
...
```

 - After user run `sudo resize2fs /dev/sdf` in agent node, `/mnt/disk` becomes 10GB now:
```
$ kubectl exec -it nginx-azuredisk -- bash
# df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/sdf        9.8G   16M  9.3G   1% /mnt/disk
...
```

**Release note**:

```
Add azuredisk size grow feature
```

/sig azure
/assign @feiskyer @karataliu @gnufied 
cc @khenidak
2018-06-05 00:02:34 -07: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
Kubernetes Submit Queue 84ec43c75b
Merge pull request #64560 from sbezverk/csi_registration
Automatic merge from submit-queue (batch tested with PRs 62266, 64351, 64366, 64235, 64560). 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 CSI driver registration with plugin watcher

Adding CSI driver registration bits.  The registration process will leverage driver-registrar side which will open the `registration` socket and will listen for pluginwatcher's GetInfo calls.
 
```release-note
Adding CSI driver registration code.
```
/sig sig-storage
2018-06-04 18:44:23 -07:00
Kubernetes Submit Queue 7d83484ec1
Merge pull request #62266 from feiskyer/win-log-stats
Automatic merge from submit-queue (batch tested with PRs 62266, 64351, 64366, 64235, 64560). 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 log and fs stats for Windows containers

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

Add log and fs stats for Windows containers.

Without this, kubelet will report errors continuously:

```
Unable to fetch container log stats for path \var\log\pods\2a70ed65-37ae-11e8-8730-000d3a14b1a0\echo: Du not supported for this build.
```

**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 #60180 #62047

**Special notes for your reviewer**:

**Release note**:

```release-note
Add log and fs stats for Windows containers
```
2018-06-04 18:44:10 -07:00
Mike Danese 91feb345aa implement service account token projection 2018-06-04 17:22:08 -07:00
Serguei Bezverkhi ea474cd99c New labelmanager package 2018-06-04 16:54:25 -04:00
Serguei Bezverkhi 1c05ca5575 Adding CSI driver registration 2018-06-04 16:47:24 -04:00
Hemant Kumar 32b69193c6 Fix panic caused by no cloudprovider in test
We should not panic when no cloudprovider is present
2018-06-04 14:50:18 -04:00
Kubernetes Submit Queue 1635393bd1
Merge pull request #63270 from andyzhangx/volume-partition-azure-fix
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 data loss issue if using existing azure disk with partitions in disk mount 

**What this PR does / why we need it**:
When use an existing azure disk(also called [static provisioning](https://github.com/andyzhangx/demo/tree/master/linux/azuredisk#static-provisioning-for-azure-disk)) in pod, if that disk has multiple partitions, the disk will be formatted in the pod mounting.

This PR removes `formatIfNotFormatted` func in `WaitForAttach` which uses `lsblk` command to check whether disk is formatted or not
b87a392b1a/pkg/volume/azure_dd/azure_common_linux.go (L213-L215)

And finally the format disk operation will happen in `MountDevice` in which it uses common k8s code(`SafeFormatAndMount.GetDiskFormat`) using `blkid` to detect disk format, `blkid` could detect multiple partitions
b87a392b1a/pkg/util/mount/mount_linux.go (L541-L543)

 - so if we use common k8s code(`SafeFormatAndMount.GetDiskFormat`), following error will be returned for mulitple partition disks, which is expected:

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

**Special notes for your reviewer**:
This PR depends on https://github.com/kubernetes/kubernetes/pull/63248

**Release note**:

```
fix data loss issue if using existing azure disk with partitions in disk mount 
```

/sig azure
/assign @khenidak
2018-06-04 00:47:26 -07:00
Vladimir Vivien 3569287993 Refactor of GenerateMapDeviceFunc to delegate Map call to volume plugin. 2018-06-03 17:25:37 -04:00
andyzhangx 880b7a3bda azuredisk size grow feature
fix comments

fix comments
2018-06-03 13:55:49 +00:00
Davanum Srinivas 5fa8a2412d API updates for Cinder Volumes to support for user specified Secrets in the future 2018-06-02 22:16:50 -04:00
Kubernetes Submit Queue e24eab03a1
Merge pull request #64532 from tallclair/gitrepo
Automatic merge from submit-queue (batch tested with PRs 64641, 64532). 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>.

Validate that GitRepoVolumeSource parameters are not flags to git

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

Validate that GitRepoVolumeSource parameters are not flags to git, as a mitigation for vulnerabilities in git. See https://groups.google.com/d/msg/kubernetes-security-announce/ayqL4LiUcV4/09HL6e11AgAJ

**Release note**:

```release-note
NONE
```
2018-06-02 09:15:08 -07:00
Kubernetes Submit Queue e5686a3668
Merge pull request #64154 from gnufied/impelemnt-volume-count
Automatic merge from submit-queue (batch tested with PRs 64613, 64596, 64573, 64154, 64639). 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>.

Implement dynamic volume limits

Implement dynamic volume limits depending on node type.

xref https://github.com/kubernetes/community/pull/2051

```release-note
Add Alpha support for dynamic volume limits based on node type
```
2018-06-02 06:30:19 -07:00
Kubernetes Submit Queue 54900d77be
Merge pull request #64519 from vladimirvivien/csi-gRPC-Conn-fix
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 for gRPC conn leak

**What this PR does / why we need it**:
This PR is a bug fix for leaky gRPC connection that never closes (see issue #64341 for detail)

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

This fix was originally started with PR https://github.com/kubernetes/kubernetes/pull/64380

```release-note
NONE
```
2018-06-02 03:58:46 -07:00
Yecheng Fu 40c3937320 Clean up fake mounters. 2018-06-02 15:55:19 +08:00
Hemant Kumar cf282203c3 Implement volume plugin changes for volume limits 2018-06-01 19:17:30 -04:00
Tim Allclair ce730d96b7
GitRepo command hardening 2018-06-01 12:42:53 -07:00
Tim Allclair d5e05ca2ce
Validate git args are not flags prior to mounting 2018-06-01 12:42:48 -07:00
Kubernetes Submit Queue 38d2dc7068
Merge pull request #64447 from jsafrane/block-provision
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). 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 block volume support to internal provisioners.

**What this PR does / why we need it**:
Internal provisioners now create filesystem PVs when block PVs are requested. This leads to unbindable PVCs.

In this PR, volume plugins that support block volumes provision block PVs when block is requested. All the other provisioners return clear error in `kubectl describe pvc`:

```
Events:
  Type     Reason              Age               From                         Message
  ----     ------              ----              ----                         -------
  Warning  ProvisioningFailed  7s (x2 over 18s)  persistentvolume-controller  Failed to provision volume with StorageClass "standard": kubernetes.io/cinder does not support block volume provisioning

```

```release-note
NONE
```

cc @kubernetes/vmware for vsphere changes
cc @andyzhangx for Azure changes

/assign @copejon @mtanino
2018-06-01 12:12:23 -07:00
Kubernetes Submit Queue d2495b8329
Merge pull request #63143 from jsafrane/containerized-subpath
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). 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>.

Containerized subpath

**What this PR does / why we need it**:
Containerized kubelet needs a different implementation of `PrepareSafeSubpath` than kubelet running directly on the host.

On the host we safely open the subpath and then bind-mount `/proc/<pidof kubelet>/fd/<descriptor of opened subpath>`.

With kubelet running in a container, `/proc/xxx/fd/yy` on the host contains path that works only inside the container, i.e. `/rootfs/path/to/subpath` and thus any bind-mount on the host fails.

Solution:
- safely open the subpath and gets its device ID and inode number
- blindly bind-mount the subpath to `/var/lib/kubelet/pods/<uid>/volume-subpaths/<name of container>/<id of mount>`. This is potentially unsafe, because user can change the subpath source to a link to a bad place (say `/run/docker.sock`) just before the bind-mount.
- get device ID and inode number of the destination. Typical users can't modify this file, as it lies on /var/lib/kubelet on the host.
- compare these device IDs and inode numbers.

**Which issue(s) this PR fixes**
Fixes #61456

**Special notes for your reviewer**:

The PR contains some refactoring of `doBindSubPath` to extract the common code. New `doNsEnterBindSubPath` is added for the nsenter related parts.

**Release note**:

```release-note
NONE
```
2018-06-01 12:12:19 -07:00
WanLinghao f7e46cf79d clean unused function in file pkg/volume/projected/projected.go 2018-06-01 11:06:03 +08:00
Vladimir Vivien d6d396215e CSI fix for gRPC conn leak, test updates 2018-05-31 23:05:41 -04:00
Lou Yihua c3c7c59407 Fix some log issues in flexvolume 2018-06-01 08:58:37 +08:00
mlmhl ca12c73323 implement kubelet side online file system resize for volume 2018-05-31 17:10:24 +08:00
Jan Safranek 08564f203e Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
Jan Safranek 8ff0fff065 Allow AWS EBS volumes to be attached as ReadOnly. 2018-05-28 16:24:19 +02:00
andyzhangx e330741d6d fix azure file size grow issue 2018-05-28 02:46:18 +00: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 be599a6248
Merge pull request #64139 from k82cn/vol_util_enhance
Automatic merge from submit-queue (batch tested with PRs 64013, 63896, 64139, 57527, 62102). 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>.

Simplify the volume util by v1helper.

Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>

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

**Release note**:
```release-note
None
```
2018-05-23 19:44:18 -07:00
Kubernetes Submit Queue eacf6f05b1
Merge pull request #63841 from andyzhangx/azuredisk-block-device
Automatic merge from submit-queue (batch tested with PRs 64102, 63303, 64150, 63841). 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 block device support for azure disk

**What this PR does / why we need it**:
add block device support for azure disk

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

**Special notes for your reviewer**:
detailed steps about how it work:
https://github.com/andyzhangx/demo/tree/master/linux/block/azuredisk

**Release note**:

```
add block device support for azure disk
```

@karataliu @feiskyer @khenidak
2018-05-23 04:53:25 -07:00
Kubernetes Submit Queue 70caf33969
Merge pull request #63303 from jsafrane/fix-csi-attach-error
Automatic merge from submit-queue (batch tested with PRs 64102, 63303, 64150, 63841). 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>.

Return attach error to A/D controller.

The plugin should not wait with errors for WaitForAttach, WaitForAttach runs on nodes, not in A/D controller.

**Which issue(s) this PR fixes**
Fixes #63300

~~Work in progress, missing testing.~~

**Release note**:

```release-note
NONE
```

/sig storage
@saad-ali @vladimirvivien
2018-05-23 04:53:17 -07:00
Jan Safranek 74ba0878a1 Enhance ExistsPath check
It should return error when the check fails (e.g. no permissions, symlink link
loop etc.)
2018-05-23 10:21:20 +02:00
Jan Safranek 97b5299cd7 Add GetMode to mounter interface.
Kubelet must not call os.Lstat on raw volume paths when it runs in a container.
Mounter knows where the file really is.
2018-05-23 10:17:59 +02: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 36b1f67617
Merge pull request #64026 from jsafrane/csi-selinux
Automatic merge from submit-queue (batch tested with PRs 63914, 63887, 64116, 64026, 62933). 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>.

Enable SELinux relabeling in CSI volumes

**What this PR does / why we need it**:
CSI volume plugin should provide correct information in `GetAttributes` call so kubelet can ask container runtime to relabel the volume. Therefore CSI volume plugin needs to check if a random volume mounted by a CSI driver supports SELinux or not by checking for "seclabel" mount or superblock option.


**Which issue(s) this PR fixes**
Fixes #63965

**Release note**:
```release-note
NONE
```

@saad-ali @vladimirvivien @davidz627 
@cofyc, FYI, I'm changing `struct mountInfo`.
2018-05-22 17:36:18 -07:00
Da K. Ma 275a4bf91f Simplify the volume util by v1helper.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-05-22 16:41:43 +08:00
andyzhangx 541edb7448 add volumeName in getVolumeSpecFromGlobalMapPath
fix test build failure
2018-05-22 06:52:24 +00:00
Pengfei Ni 66da2ddcd0 Rename Du() to DiskUsage() for more expressive 2018-05-22 10:52:06 +08:00
andyzhangx 8259dcbaa7 add block device support for azure disk
add plugin field for azure dataDisk struct

add azure_dd_block_test

fix comments

fix comments
2018-05-21 09:03:59 +00:00
Kubernetes Submit Queue 7da05eb87b
Merge pull request #63295 from jsafrane/fix-csi-detach-delete
Automatic merge from submit-queue (batch tested with PRs 63569, 63918, 63980, 63295, 63989). 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 CSI volume detach when the volume is already detached.

**What this PR does / why we need it**:
"VolumeAttachment NotFound" error should be treated as successful detach.

/sig storage
/assign @vladimirvivien @saad-ali

**Special notes for your reviewer**:
Note that the PR changes just 4 lines in attachment code, the rest is unit test refactoring to inject fake errors.

**Release note**:

```release-note
NONE
```
2018-05-18 09:54:22 -07:00
Jan Safranek 080d2dfe8f Add SELinux support to CSI 2018-05-18 14:27:13 +02:00
Jan Safranek 598ca5accc Add GetSELinuxSupport to mounter. 2018-05-17 13:36:37 +02:00
Pengfei Ni 9a7ff8dbe5 Add log stats for Windows containers 2018-05-17 14:22:16 +08: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 194e640bf1
Merge pull request #63339 from sjenning/remove-mount-success-event
Automatic merge from submit-queue (batch tested with PRs 63298, 63339). 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>.

kubelet: volume: do not create event on mount success

xref https://github.com/openshift/origin/issues/19497

There is an argument to be made that we should not emit events on volume mount successes.  Many pods have lots of volumes that generate lots of events, especially if the pods are short lived (batch, etc). This creates load on the API server and add noise in the events.

Creating events on volume mount failures is obviously a good idea.  Seems like the absence of such events or the "Started container" event implies mount success for all volumes.

/sig node
/sig storage
/release-note-none

@smarterclayton @jsafrane @saad-ali
2018-05-04 04:42:06 -07:00
Jan Safranek a884a00d30 Fix CSI volume detach when the volume is already detached.
"NotFound" error should be treated as successful detach.
2018-05-04 12:22:15 +02:00
Kubernetes Submit Queue 33d85b01fe
Merge pull request #63098 from shubheksha/fix/62916-replace-path-with-filepath-aws-azure
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>.

aws, azure: replace path with filepath

**What this PR does / why we need it**:
This PR replaces usage of `path` with `filepath` as it uses OS-specific path separators.

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

**Special notes for your reviewer**:
This PR addresses the following volume plugins:
- `pkg/volume/aws_ebs`
- `pkg/volume/azure_dd`
- `pkg/volume/azure_file`

**Release note**:

```release-note
NONE
```
2018-05-03 11:16:10 -07:00
Kubernetes Submit Queue 4299a0518c
Merge pull request #63261 from dougm/cloudprovider-notimplemented
Automatic merge from submit-queue (batch tested with PRs 61725, 63261). 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 cloudprovider.NotImplemented in AddSSHKeyToAllInstances

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

Minor cleanup: In looking at implementations of this method,
noticed a few providers created their own errors instead of using cloudprovider.NotImplemented

**Release note**:

```release-note
NONE
```
2018-05-02 22:16:06 -07: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
Kubernetes Submit Queue b5f61ac129
Merge pull request #62657 from matthyx/master
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 all script shebangs to use /usr/bin/env interpreter instead of /bin/interpreter

This is required to support systems where bash doesn't reside in /bin (such as NixOS, or the *BSD family) and allow users to specify a different interpreter version through $PATH manipulation.
https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html
```release-note
Use /usr/bin/env in all script shebangs to increase portability.
```
2018-05-02 19:44:32 -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
Seth Jennings 2ef9e3054d kubelet: volume: do not create event on mount success 2018-05-01 14:14:42 -05:00
Jan Safranek 71e4449e17 Return attach error to A/D controller.
WaitForAttach runs on nodes, not in A/D controller.
2018-04-30 17:19:12 +02:00
andyzhangx 87bd6b5335 remove format operation in WaitForAttach 2018-04-28 02:12:09 +00:00
Doug MacEachern e7cc5df3f6 Use cloudprovider.NotImplemented in AddSSHKeyToAllInstances
Minor cleanup: In looking at implementations of this method,
noticed a few providers created their own errors instead of using cloudprovider.NotImplemented
2018-04-27 13:19:06 -07: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
Shubheksha Jalan 7a14b14bf4 replace filepath with path due to pre-formatted volumeName 2018-04-27 21:22:55 +05:30
Kubernetes Submit Queue 2b5b735ec0
Merge pull request #61804 from zhangxiaoyu-zidif/fix-cephfs-fuse-bug
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 cephfs fuse mount bug when user is not admin

**What this PR does / why we need it**:
fix cephfs fuse mount bug when user is not admin

**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 https://github.com/kubernetes/kubernetes/issues/59393

**Special notes for your reviewer**:

**Release note**:

```release-note
fix cephfs fuse mount bug when user is not admin
```
2018-04-27 08:20:11 -07:00
Pengfei Ni ce325f9afe Use new clients in Azure Disk volume 2018-04-26 09:38:48 +08:00
Kubernetes Submit Queue 02e3577ab1
Merge pull request #60009 from zetaab/nodetaint
Automatic merge from submit-queue (batch tested with PRs 63129, 63066, 60009, 63136, 63086). 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 node shutdown taint

**What this PR does / why we need it**: we need node stopped taint in order to detach volumes immediately without waiting timeout. More info in issue ticket #58635 

**Which issue(s) this PR fixes** 
Fixes #58635

**Special notes for your reviewer**: this was reverted, original PR https://github.com/kubernetes/kubernetes/pull/59323 Hopefully now bugs are fixed. However, I will execute more tests manually today.

**Release note**:
```release-note
NONE
```
2018-04-25 06:29:22 -07:00
Kubernetes Submit Queue b692b7159a
Merge pull request #62590 from mlmhl/csi_test
Automatic merge from submit-queue (batch tested with PRs 62590, 62818, 63015, 62922, 63000). 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 some bugs inside CSI volume plugin unit test TestAttacherMountDevice

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

Fix two bugs inside CSI volume plugin unit test `TestAttacherMountDevice`.

**Release note**:

```release-note
None
```
2018-04-24 14:22:10 -07:00
Shubheksha Jalan 6f82f40760 replace path with filepath 2018-04-24 19:08:38 +05:30
Jesse Haka de967b717d PR #59323, fix bug and remove one api call, add node util dependency to cloud controller 2018-04-22 20:32:26 +03:00
Kubernetes Submit Queue afa68cc287
Merge pull request #62886 from msau42/fix-localssd-fsgroup
Automatic merge from submit-queue (batch tested with PRs 62780, 62886). 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>.

Only count local mounts that are from other pods

**What this PR does / why we need it**:
In GCE, we mount the same local SSD in two different paths (for backwards compatability).  This makes the fsGroup conflict check fail because it thinks the 2nd mount is from another pod.  For the fsgroup check, we only want to detect if other pods are mounting the same volume, so this PR filters the mount list to only those mounts under "/var/lib/kubelet".

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

**Release note**:

```release-note
NONE
```
2018-04-20 20:06:13 -07:00
Kubernetes Submit Queue d78ef491de
Merge pull request #62827 from linyouchong/data-reace-csi-20180418
Automatic merge from submit-queue (batch tested with PRs 62876, 62733, 62827). 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 data race in csi_attacher_test.go

**What this PR does / why we need it**:
fix csi data race in csi_attacher_test.go#TestAttacherWaitForVolumeAttachment

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

**Special notes for your reviewer**:
run `stress -p 500 ./csi.test -v 5 -alsologtostderr` , There is another failure
I think we should fix it in another PR.
```
--- FAIL: TestAttacherMountDevice (0.07s)
        csi_attacher_test.go:495: Running test case: normal
        csi_attacher_test.go:534: test should not fail, but error occurred: mkdir path2: file exists
```

**Release note**:

```release-note
NONE
```

/sig storage
2018-04-20 13:39:14 -07:00
Michelle Au 6cf8a6606c Only count mounts that are from other pods 2018-04-19 15:40:51 -07:00
Harsh Desai adc71854e2 Add support to resize Portworx volume
Closes #62305

Signed-off-by: Harsh Desai <harsh@portworx.com>

update comment and variable references to GiB

Signed-off-by: Harsh Desai <harsh@portworx.com>

explicitly check volume size after resize and fix size volume spec

Signed-off-by: Harsh Desai <harsh@portworx.com>

If Portworx volume is already greater than new size, skip resize

Signed-off-by: Harsh Desai <harsh@portworx.com>

Allow updated volume to be greater than requested size

Signed-off-by: Harsh Desai <harsh@portworx.com>
2018-04-19 12:14:43 -07:00
Kubernetes Submit Queue 3856891198
Merge pull request #62668 from zetaab/cindermetrics
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 metrics to cinder volume

**What this PR does / why we need it**: We need cinder volume metrics to be exposed

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

**Special notes for your reviewer**: This is not tested in running cluster. 

**Release note**:

```release-note
Make volume usage metrics available for Cinder
```

cc @gnufied @dims
2018-04-19 09:53:09 -07:00
Kubernetes Submit Queue 8306b692b6
Merge pull request #62787 from humblec/volumenameprefix-test
Automatic merge from submit-queue (batch tested with PRs 62803, 62787). 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 `volumenameprefix` tests for glusterfs dynamic provisioner.

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-04-19 07:08:07 -07:00
Matthias Bertschy 9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
linyouchong 0050bcfc9e fix csi data race in csi_attacher_test.go 2018-04-19 10:44:11 +08:00
Kubernetes Submit Queue efadf7b9e7
Merge pull request #61877 from mikedanese/depeid
Automatic merge from submit-queue (batch tested with PRs 62481, 62643, 61877, 62515). 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 deprecated ExternalID

This field has been deprecated since 1.1. After we remove it we can remove "self delete" from the node's permission set.

@kubernetes/api-reviewers 
@kubernetes/sig-auth-pr-reviews 

fixes https://github.com/kubernetes/kubernetes/issues/61966
part of https://github.com/kubernetes/community/pull/911

```release-note
Kubelets will no longer set `externalID` in their node spec.
```
2018-04-18 17:53:16 -07:00
Kubernetes Submit Queue b758341a04
Merge pull request #62646 from cofyc/reporteventtoapiserver
Automatic merge from submit-queue (batch tested with PRs 62694, 62569, 62646, 61633, 62433). 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>.

Report events to apiserver in local volume plugin.

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

See https://github.com/kubernetes/kubernetes/pull/62102#discussion_r179238429.

Report events to apiserver in local volume plugin.

- Add VolumeHost.GetEventRecorder() method
- Add related e2e tests

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

**Special notes for your reviewer**:

Example output of `kubectl describe pods`:

```
Events:
  Type     Reason                 Age   From                Message
  ----     ------                 ----  ----                -------
  Normal   Scheduled              7s    default-scheduler   Successfully assigned e2e-tests-persistent-local-volumes-test-x4h5x/security-context-670da435-4174-11e8-9098-000c29bb0377 to 127.0.0.1
  Warning  AlreadyMountedVolume   7s    kubelet, 127.0.0.1  The requested fsGroup is 4321, but the volume local-pvfbb76 has GID 1234. The volume may not be shareable.
  Normal   SuccessfulMountVolume  7s    kubelet, 127.0.0.1  MountVolume.SetUp succeeded for volume "default-token-996xr"
  Normal   SuccessfulMountVolume  7s    kubelet, 127.0.0.1  MountVolume.SetUp succeeded for volume "local-pvfbb76"
  Normal   Pulled                 6s    kubelet, 127.0.0.1  Container image "k8s.gcr.io/busybox:1.24" already present on machine
  Normal   Created                6s    kubelet, 127.0.0.1  Created container
  Normal   Started                6s    kubelet, 127.0.0.1  Started container
```

**Release note**:

```release-note
NONE
```
2018-04-18 14:44:17 -07:00
Kubernetes Submit Queue 4d405a8348
Merge pull request #62694 from feiskyer/clean-filepath
Automatic merge from submit-queue (batch tested with PRs 62694, 62569, 62646, 61633, 62433). 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 filepath.Clean() instead of path.Clean()

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

Use filepath.Clean() instead of path.Clean() across `pkg/volume`. This could fix potential issues for windows containers.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @msau42
2018-04-18 14:44:10 -07:00
Mike Danese f427531179 boring 2018-04-18 09:55:57 -07:00
Humble Chirammal cecc3390ae Add volumenameprefix tests for glusterfs dynamic provisioner.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-04-18 19:10:10 +05:30
Kubernetes Submit Queue 47ed092635
Merge pull request #62378 from humblec/snap-option
Automatic merge from submit-queue (batch tested with PRs 62378, 62734). 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 `snapfactor` storageclass parameter for GlusterFS provisioner.

This patch add a new parameter called `snapfactor` to glusterfs
    storageclass. This is an optional parameter and value should
    fall into the range of 1-100. When set the thin pool calculation
    respect this snapfactor and create a thinpool accordingly.
    


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-04-18 04:24:08 -07:00
Humble Chirammal f7957e848b This patch add a new parameter called `snapfactor` to glusterfs
storageclass. This is an optional parameter and value should
fall into the range of 1-100. When set the thin pool calculation
respect this snapfactor and create a thinpool accordingly.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-04-18 11:16:46 +05:30
Jesse Haka 441dc15b53 add metrics to cinder
cd -> r

fix
2018-04-18 08:42:34 +03:00
Yecheng Fu 55ef18ad42 Report events to apiserver in local volume plugin.
- Add VolumeHost.GetEventRecorder() method
- Add related e2e tests
2018-04-18 11:19:36 +08:00
Kubernetes Submit Queue bf3cda66c3
Merge pull request #62612 from andyzhangx/azure-devicepath-fix
Automatic merge from submit-queue (batch tested with PRs 62676, 62612). 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 WaitForAttach failure issue for azure disk

**What this PR does / why we need it**:
From v1.10, `devicePath` will be updated due to following code change:
568afb4ecc/pkg/volume/util/operationexecutor/operation_generator.go (L517-L518)

So in v1.10.0, MountVolume.WaitForAttach will fail in the azure disk remount, error logs would be like following:
```
MountVolume.WaitForAttach failed for volume "pvc-f1562ecb-3e5f-11e8-ab6b-000d3af9f967" : azureDisk - Wait for attach expect device path as a lun number, instead got: /dev/disk/azure/scsi1/lun1 (strconv.Atoi: parsing "/dev/disk/azure/scsi1/lun1": invalid syntax)
  Warning  FailedMount             1m (x10 over 21m)   kubelet, k8s-agentpool-66825246-0  Unable to mount volumes for pod  
```

This PR does not use `devicePath` anymore since it could be changed, instead, it use `diskController.GetDiskLun(diskName, volumeSource.DataDiskURI, nodeName)` to get disk LUN, this ARM api call would cost about 0.12s

The GCE disk won't have this issue since `devicePath` is not used in [WaitForAttach func](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/gce_pd/attacher.go#L133), while aws disk is also using `devicePath`  in [WaitForAttach func](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/aws_ebs/attacher.go#L145), I think there is potentical issue for aws_ebs

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

**Special notes for your reviewer**:
should cherry-pick to v1.10

**Release note**:

```
fix WaitForAttach failure issue for azure disk
```
/assign @feiskyer 
/sig azure

FYI @khenidak
2018-04-16 21:56:10 -07:00
Pengfei Ni dca0128966 Use filepath.Clean() instead of path.Clean() 2018-04-17 10:44:30 +08:00
Kubernetes Submit Queue 6fb3d3a79c
Merge pull request #62375 from feiskyer/visible-files
Automatic merge from submit-queue (batch tested with PRs 62650, 62303, 62545, 62375). 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 user visible files creation for windows

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

Fix user visible files creation for windows. Without this, [createUserVisibleFiles](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/util/atomic_writer.go#L415:24) will get linkname with subpath included, and then symlink will fail. This is because "/" is used in pod spec (e.g. `"new/path/data-1"`) while "\" is used on Windows to get linkname. 


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

**Special notes for your reviewer**:

Should also be cherry-picked to old releases.

**Release note**:

```release-note
Fix user visible files creation for windows
```
2018-04-16 13:56:13 -07:00
Kubernetes Submit Queue e36fa85ec2
Merge pull request #62556 from msau42/fix-node-selector-term
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 volume node affinity to OR node selector terms

**What this PR does / why we need it**:
Fixes node selector terms to be ORed, to be consistent with documentation and Pod.NodeAffinity.  Also handles the "node selector term nil or empty matches nothing" behavior.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixes issue where PersistentVolume.NodeAffinity.NodeSelectorTerms were ANDed instead of ORed.
```
2018-04-16 01:57:04 -07:00
andyzhangx 3a0fb103c2 fix devicePath update issue in Azure WaitForAttach func
add WaitForAttach logging
2018-04-16 05:52:16 +00:00
Pengfei Ni f12b8eb497 Fix use visible files creation for windows 2018-04-16 11:12:17 +08:00
mlmhl 123ba1b429 fix some bugs inside csi unit test TestAttacherMountDevice 2018-04-15 10:35:27 +08:00
Joel Smith 917356f8e0 Prevent virtual infinite loop in volume controller
In WatchPod(), if one of the two channels being watched (pod updates and
events) is closed, the for/select loop turns into a tight infinite loop because
the select immediately falls through due to the channel being closed. Watch
them independently instead.
2018-04-13 21:19:45 -06:00
Kubernetes Submit Queue 6b6d1ea1ab
Merge pull request #62486 from vladimirvivien/csi-fsGroup-fix
Automatic merge from submit-queue (batch tested with PRs 62486, 62471, 62183). 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 - Update to apply fsGroup volume ownership

**What this PR does / why we need it**:
This PR correctly fixes the CSI internal driver to apply fsGroup volume ownership value during mount.

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

```release-note
NONE
```
2018-04-13 16:01:06 -07:00
Kubernetes Submit Queue 3e4268f580
Merge pull request #62394 from jsafrane/revert-git-changes
Automatic merge from submit-queue (batch tested with PRs 60476, 62462, 61391, 62535, 62394). 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>.

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

This reverts commit c578542ad7 (PR #51098). The PR added support for containerized git, on the other hand it required git 1.8.5. This breaks git volumes on older distros (CentOS 7, Ubuntu 14.04) that have old git.

Git volumes are getting deprecated (https://github.com/kubernetes/kubernetes/issues/60999) so we should restore it to the last working state and not touch it any longer.

**Release note**:

```release-note
gitRepo volumes in pods no longer require git 1.8.5 or newer, older git versions are supported too now.
```

I'd like to cherry-pick it into 1.10.

/sig storage
2018-04-13 11:20:23 -07:00
Michelle Au d2ab5f2973 Fix volume node affinity to OR node selector terms 2018-04-13 10:46:07 -07:00
Kubernetes Submit Queue 028550f451
Merge pull request #61392 from jianglingxia/csi-mounter20180320
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>.

The err has checked in TearDownAt func/kind bug

**What this PR does / why we need it**:
The err has checked in TearDownAt func/kind bug
**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-13 06:10:03 -07:00
Vladimir Vivien e207e0b324 CSI - Apply fsGroup volume ownership when pv not readOnly 2018-04-13 08:55:27 -04:00
Kubernetes Submit Queue 2f394a4168
Merge pull request #61914 from ianchakeres/mount-unsupported-err
Automatic merge from submit-queue (batch tested with PRs 62324, 61459, 62475, 62476, 61914). 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>.

Return error in mount_unsupported for unsupported platforms

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

Presently, `util/mount_unsupported.go` does not return any errors. For unsupported platforms, this hides failures. This PR returns errors, thereby properly informing users attempting to run on an unsupported platform.

**Which issue(s) this PR fixes** :
Fixes https://github.com/kubernetes/kubernetes/issues/61919

**Special notes for your reviewer**:

There are a few methods that simply call through to other methods. I did not return errors from those methods.

I've also updated an error check and message in `volume/fc/fc_test.go`, since it was ignoring an error on unsupported platforms.

**Release note**:
```release-note
NONE
```
2018-04-12 13:18:18 -07:00
Jan Safranek d7615282d9 Revert "git: Use VolumeHost.GetExec() to execute stuff in volume plugins"
This reverts commit c578542ad7.

Older distros (centos 7, ubuntu 14.04) use older git than required by
the reverted patch.
2018-04-11 14:44:20 +02:00
Kubernetes Submit Queue 05c88cc831
Merge pull request #61549 from jingxu97/Mar/aswVolumeSpec
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 volume spec to mountedPod in actual state of world

Add volume spec into mountedPod data struct in the actual state of the
world.
Fixes issue #61248
2018-04-10 17:43:38 -07:00
Kubernetes Submit Queue 865d3cf409
Merge pull request #62018 from andyzhangx/local-windows-path-fix
Automatic merge from submit-queue (batch tested with PRs 61147, 62236, 62018). 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 local volume absolute path issue on Windows

**What this PR does / why we need it**:
remove IsAbs validation on local volume since it does not work on windows cluster, Windows absolute path `D:` is not allowed in local volume, the [validation](https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/validation/validation.go#L1386) happens on both master and agent node, while for windows cluster, the master is Linux and agent is Windows, so `path.IsAbs()` func will not work all in both nodes. 
**Instead**, this PR use `MakeAbsolutePath` func to convert `local.path` value in kubelet, it supports both linux and windows styple. 

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

**Special notes for your reviewer**:

**Release note**:

```
fix local volume absolute path issue on Windows
```
/sig storage
/sig windows
2018-04-10 05:31:20 -07:00
Kubernetes Submit Queue 89d8884fba
Merge pull request #61147 from mlmhl/csi
Automatic merge from submit-queue (batch tested with PRs 61147, 62236, 62018). 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>.

Return NodeStageVolume/NodePublishVolume error if operation failed for CSI

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

Currently in CSI volume plugin, if `NodeStageVolume`/`NodePublishVolume` operation failed, we will try to remove according target dir(global mount path or pod volume path) first. If this clear operation failed, according error will be returned, and finally displayed in `Pod`'s event. However, compared to this clear error, the user is more concerned about `NodeStageVolume`/`NodePublishVolume` error, so I suggest that just log the clear error and still return the `NodeStageVolume`/`NodePublishVolume` error.

**Release note**:

```release-note
NONE
```

/sig storage
2018-04-10 05:31:13 -07:00
Kubernetes Submit Queue 436f1cd748
Merge pull request #59035 from YuxiJin-tobeyjin/fix-format-error-for-sioUtil-ut
Automatic merge from submit-queue (batch tested with PRs 59035, 61933). 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 format error for sioUtil-UT

**What this PR does / why we need it**:
1、Use t.Fatalf instead of t.Fatal when format is needed;
2、Before my change, when open file failed you will get such return "failed to open conf file: %!(EXTRA os.file=&{***})". After my change, when open file failed you will get such return "Failed to open conf file: /dir/filename",which is more human readable .

**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-09 06:56:05 -07:00
andyzhangx fddf3efc4d remove default fsypte in azure disk 2018-04-08 08:11:37 +00:00
andyzhangx f06c01fc83 fix comments 2018-04-08 03:06:06 +00:00
Kubernetes Submit Queue f239270ec7
Merge pull request #61447 from jianglingxia/csiattacher-2018032109
Automatic merge from submit-queue (batch tested with PRs 56045, 61447, 62189). 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 Test to TestAttacherUnmountDevice

**What this PR does / why we need it**:
Add UT Test to TestAttacherUnmountDevice if no volumeID scenero
**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-06 09:14:04 -07:00
andyzhangx 520b8d49fc remove IsAbs validation on local volume
use MakeAbsolutePath to convert path in Windows

fix test error: allow relative path for local volume

fix comments

fix comments and add windows unit tests
2018-04-06 13:26:14 +00:00
Lukasz Piatkowski 645d0d8e81 fix typo that redefines variable and breaks code 2018-04-05 13:49:02 +00:00
Kubernetes Submit Queue f167e16914
Merge pull request #62012 from andyzhangx/local-windows-fix
Automatic merge from submit-queue (batch tested with PRs 60983, 62012, 61892, 62051, 62067). 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 local volume issue on Windows

**What this PR does / why we need it**:
Actually local volume does not work on Windows up to now, with this PR, local volume would work on Windows. Here is a [local volume example on Windows](https://github.com/andyzhangx/demo/tree/master/windows/local) 

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

**Special notes for your reviewer**:
This PR would not `MkdirAll(dir, 0750)` on windows node, the MkdirAll process would happen on https://github.com/kubernetes/kubernetes/blob/master/pkg/util/mount/mount_windows.go#L59-L62

**Release note**:

```
fix local volume issue on Windows
```

/sig windows
/sig storage
2018-04-03 11:33:13 -07:00
Kubernetes Submit Queue fc19fc9908
Merge pull request #58519 from linyouchong/lyc-probe
Automatic merge from submit-queue (batch tested with PRs 60073, 58519, 61860). 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>.

flexvolume prober: trigger plugin init only for the relevant plugin

**What this PR does / why we need it**:
The automatic discovery trigger init only to the specific plugin directory that was updated, and not to all the plugins in the flexvolume plugin directory.

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

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

```
NONE
```
2018-04-02 17:07:01 -07:00
Kubernetes Submit Queue c079d1e6af
Merge pull request #61096 from mlmhl/csi_secret
Automatic merge from submit-queue (batch tested with PRs 61096, 61955, 61542, 60597). 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>.

Return error if get NodeStageSecret and NodePublishSecret failed

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

Currently, if got NodeStageSecret  or NodePublishSecret failed, we just log the error and assume that there is no credential. I think we should report the error as if user specified these secret, they expect to apply some credentials.

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

**Release note**:

```release-note
NONE
```

/sig storage
2018-04-02 15:35:02 -07:00