Commit Graph

1298 Commits (cd25bbee468fe00c2bc6ea7eefc7de7e6846e526)

Author SHA1 Message Date
Vladimir Vivien fda99bd78e ScaleIO Volume Plugin - volume attribute updates
This commit introduces the following updates and fixes:
- Enable scaleIO volume multip-mapping based on accessMode
- No longer uses "default" as default values for storagepool & protection domain
- validates capacity when capacity is zero
- Better naming for PV and volume
- make mount ro when accessModes contains ROM
2017-07-31 16:51:45 -04:00
mtanino ed46466b95 FC volume plugin: remove block device at DetachDisk
After a volume is unmounted from pod and worker node,
cluster admin or external-provisioner might delete
the disk from storage, therefore block device on
the node should be cleaned up beforehand.

The photon volume plugin already has same functionality.

Fixes #49392
2017-07-31 15:36:39 -04:00
jianglingxia acc2062db5 amend the message 2017-07-31 16:00:59 +08:00
Kubernetes Submit Queue 4a73f19aed Merge pull request #49744 from dims/volunteer-as-cinder-approver
Automatic merge from submit-queue

Volunteer to review Cinder related code

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

Since i am currently helping with the OpenStack cloud provider, happy
to do the same with cinder package as well as they are related.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-28 08:15:29 -07:00
Kubernetes Submit Queue 97f74e81aa Merge pull request #49670 from mtanino/issue/49669
Automatic merge from submit-queue (batch tested with PRs 49712, 49694, 49714, 49670, 49717)

FC volume plugin: remove unmount of global mount

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

The unmount operation for global mount should be done by reconciler.go instead of executing inside the FC Plugin since attacher/detacher for FC plugin was merged recently.

**Which issue this PR fixes** : fixes #49669

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-07-28 08:15:06 -07:00
Kubernetes Submit Queue ee632be5b0 Merge pull request #49598 from sbezverk/local_vol_metrics
Automatic merge from submit-queue (batch tested with PRs 49619, 49598, 47267, 49597, 49638)

Adding metrics support to local volume

Adding metrics support to local volume plugin.
Fixes #49601
2017-07-28 05:08:03 -07:00
Kubernetes Submit Queue ea89d62710 Merge pull request #48486 from cofyc/rbd_metrics
Automatic merge from submit-queue (batch tested with PRs 49081, 49318, 49219, 48989, 48486)

Use MetricsStatsFs to expose RBD volume plugin metrics.

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

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

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

**Special notes for your reviewer**:

cc @rootfs

**Release note**:

```release-note
NONE
```
2017-07-28 04:03:44 -07:00
jianglingxia dee9470152 squash the commits into one 2017-07-28 10:11:31 +08:00
Harsh Desai c692710876 Add comment for parameter parsing logic in Portworx volume create 2017-07-27 16:12:26 -07:00
Harsh Desai 33221ee2b6 Supply Portworx StorageClass paramters in volume spec labels for server-side processing 2017-07-27 16:07:32 -07:00
Davanum Srinivas ad98f109ef Volunteer to review Cinder related code
Since i am currently helping with the OpenStack cloud provider, happy
to do the same with cinder package as well as they are related.
2017-07-27 16:01:12 -04:00
Kubernetes Submit Queue 3a0d8f8fea Merge pull request #45532 from jsafrane/cinder-approver
Automatic merge from submit-queue

Tune Cinder approvers

I don't want to be single approver for cinder PRs, @anguslees is OpenStack maintainer and should be able to help with Cinder.

Any other volunteers from @kubernetes/sig-storage-pr-reviews or @k8s-sig-openstack-pr-reviews?

Note: @justinsb **is** still reviewer, he was just listed twice.

```release-note
NONE
```
2017-07-27 03:14:42 -07:00
Yecheng Fu 777595ef6e Use MetricsStatsFs to expose RBD volume plugin metrics. 2017-07-27 08:13:55 +00:00
mtanino 0c262ba9de FC volume plugin: remove unmount of global mount 2017-07-26 19:45:15 -04:00
Jing Xu c18ecb0825 Check volumespec is nil in FindPluginBySpec
This PR fixes issue #49513
2017-07-26 13:45:32 -07:00
Kubernetes Submit Queue 74b3d47392 Merge pull request #49271 from dixudx/fix_rbd_deleter_adminid
Automatic merge from submit-queue (batch tested with PRs 47357, 49514, 49271, 49572, 49476)

set default adminid for rbd deleter if unset

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

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

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

**Release note**:

```release-note
set default adminid for rbd deleter if unset 
```
2017-07-26 12:03:47 -07:00
Serguei Bezverkhi fb67f1189b Adding metrics support to local volume
Adding metrics support to local volume plugin
2017-07-26 12:24:23 -04:00
jianglingxia 0710d86291 remove redundant comment 2017-07-26 15:34:11 +08:00
Andrei Vagin ad0ec2388f flexvol: remove a mount directory in a error case
flexVolumeMounter.SetUpAt creates a directory, where a volume has to be
mounted, and we have to remove this directory in error cases. Otherwise
we will see errors like this:

Orphaned pod 673b66d9-70f7-11e7-a5fa-525400307392 found, but volume paths are still present on disk

https://github.com/kubernetes/kubernetes/issues/49383
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-25 10:38:39 -07:00
deads2k 94e9993900 remove deads2k from volume reviewer 2017-07-25 08:52:25 -04:00
Kubernetes Submit Queue 8d1b090d6e Merge pull request #49496 from rootfs/iscsi-fc-reviewer
Automatic merge from submit-queue (batch tested with PRs 49479, 49496)

tune iscsi and fc volume owner

**What this PR does / why we need it**:
add @mtanino to iscsi and fc volume reviewer

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

**Special notes for your reviewer**:
@kubernetes/sig-storage-misc 
**Release note**:

```release-note
NONE
```
2017-07-25 01:41:31 -07:00
Di Xu 6addd4c9dd set default adminid for rbd deleter 2017-07-25 12:51:10 +08:00
Kubernetes Submit Queue ee7eb4a241 Merge pull request #49274 from dixudx/add_const_for_rbd
Automatic merge from submit-queue (batch tested with PRs 48911, 49475, 49438, 49362, 49274)

set RBD default values as constant vars

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

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
set RBD default values as constant vars
```
2017-07-24 20:39:22 -07:00
Kubernetes Submit Queue 159dcbfbe4 Merge pull request #49475 from jsafrane/fix-gluster-make
Automatic merge from submit-queue (batch tested with PRs 48911, 49475, 49438, 49362, 49274)

Fixed glusterfs mount options

Capacity of a slice is the third argument, not the second one.
We use append() to fill the slice, so it should be empty at the beginning
and with the right capacity.

```release-note
NONE
```
2017-07-24 20:39:13 -07:00
Kubernetes Submit Queue 1feb0fa6aa Merge pull request #49118 from adelton/flex-bind-mount
Automatic merge from submit-queue (batch tested with PRs 49444, 47864, 48584, 49395, 49118)

Allow unmounting bind-mounted directories.

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

For files, we cannot use `path/..`;
we could use `filepath.Dir` but for bind-mounted, `isNotMounted` which calls `IsLikelyNotMountPoint` would not work anyway.
Let's just have the driver do the work.

Addressing
```
Error: UnmountVolume.TearDown failed for volume "..." (volume.spec.Name: "...") pod "..." (UID: "...") with: lstat /path/.../test-flex/..: not a directory
```

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

N/A

**Special notes for your reviewer**:

N/A

**Release note**:

```release-note
It is now posible to use flexVolumes to bind mount directories and files.
```
2017-07-24 13:52:42 -07:00
Kubernetes Submit Queue d286f56221 Merge pull request #45345 from codablock/storageclass_fstype
Automatic merge from submit-queue (batch tested with PRs 45345, 49470, 49407, 49448, 49486)

Support "fstype" parameter in dynamically provisioned PVs

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

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

**ORIGINAL PR DESCRIPTION**

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

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

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

**Release note**:

```release-note
Support specifying of FSType in StorageClass
```
2017-07-24 07:40:47 -07:00
Huamin Chen 3b91bdc261 tune iscsi and fc volume owner
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-07-24 13:59:06 +00:00
Jan Pazdziora 6b7d4b7922 Allow unmounting bind-mounted directories.
For bind-mounted directories, the isNotMounted which calls
IsLikelyNotMountPoint fails because the filesystem of the mounted
location and the parent directory are the same.

Addressing:
unmounter.go:59] Warning: Path: /path/.../test-dir already unmounted
2017-07-24 13:33:10 +02:00
Jan Safranek f6a8436504 Fixed glusterfs mount options
Capacity of a slice is the third argument, not the second one.
We use append() to fill the slice, so it should be empty at the beginning
and with the right capacity.
2017-07-24 10:20:39 +02:00
Hemant Kumar 0b1d61db00 Fix controller crash because of nil volume spec
For volumes that don't support bulk volume verifiction, a nil
volume spec can cause crash of controller.
2017-07-21 18:42:11 -04:00
Tobias Klauser 4a69005fa1 switch from package syscall to x/sys/unix
The syscall package is locked down and the comment in [1] advises to
switch code to use the corresponding package from golang.org/x/sys. Do
so and replace usage of package syscall with package
golang.org/x/sys/unix where applicable.

  [1] https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24

This will also allow to get updates and fixes for syscall wrappers
without having to use a new go version.

Errno, Signal and SysProcAttr aren't changed as they haven't been
implemented in /x/sys/. Stat_t from syscall is used if standard library
packages (e.g. os) require it. syscall.SIGTERM is used for
cross-platform files.
2017-07-21 12:14:42 +02:00
Kubernetes Submit Queue 010858262f Merge pull request #49127 from humblec/backupvol-count
Automatic merge from submit-queue (batch tested with PRs 49328, 49285, 49307, 49127, 49163)

Make definite mount timeout for glusterfs volume mount.

The `backup-volfile-servers` mount option allows to specify more than 
one server to be contacted in single mount command. With this option in place,
it is not required to iterate over all the servers in the addrlist.
A mount attempt with this option  will fetch all the servers mentioned in
the list, Reference # https://access.redhat.com/documentation/en-US/Red_Hat_Storage/3/html/Administration_Guide/sect-Native_Client.html

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-07-21 03:00:21 -07:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Humble Chirammal 413380e557 The `backup-volfile-servers` mount option allows to specify more than
one server to be contacted in single mount command. With this option in place,
it is not required to iterate over all the servers in the addrlist.
A mount attempt with this option  will fetch all the servers mentioned in
the list, Reference # https://access.redhat.com/documentation/en-US/Red_Hat_Storage/3/html/Administration_Guide/sect-Native_Client.html

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-07-20 23:17:32 +05:30
Kubernetes Submit Queue 67ec254ef3 Merge pull request #49203 from adelton/flexvolume-TestCanSupport-init-fail
Automatic merge from submit-queue (batch tested with PRs 49212, 49203, 49255)

If the init fails for whatever reason, plugin is nil and cannot be used.

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

Addressing
```
=== RUN   TestCanSupport
E0719 13:48:19.829849    2289 driver-call.go:232] init command failed, status: Successx, reason:
--- FAIL: TestCanSupport (0.00s)
	flexvolume_test.go:180: Can't find the plugin by name
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x11fc5b5]
```

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

N/A

**Special notes for your reviewer**:

N/A

**Release note**:

```release-note
NONE
```
2017-07-20 02:35:13 -07:00
Di Xu 50bfe02fea make default values as const vars 2017-07-20 16:13:17 +08:00
Kubernetes Submit Queue db1956b876 Merge pull request #48460 from cosmincojocar/azure_file_cloud_environment
Automatic merge from submit-queue (batch tested with PRs 49218, 48253, 48967, 48460, 49230)

Fix the Azure file to work within different cloud environments

**What this PR does / why we need it**:
Fix the Azure file plugin to work within different cloud environments.

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

cc @rootfs @brendandburns
2017-07-19 20:05:37 -07:00
Kubernetes Submit Queue 25d3523359 Merge pull request #48940 from rootfs/fc-fencing
Automatic merge from submit-queue (batch tested with PRs 48377, 48940, 49144, 49062, 49148)

support fc volume attach and detach

**What this PR does / why we need it**:
Support FC volume attach and detach to enforce RWO access

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-19 19:10:12 -07:00
Kubernetes Submit Queue 7eb53ce85c Merge pull request #48171 from sdkfzv/master
Automatic merge from submit-queue

Improve the warning message if the rbd command is not found.

**What this PR does / why we need it**:
The previous warning msg is not correct if there is no rbd cmd.

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


**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-07-19 07:14:19 -07:00
Jan Pazdziora 1ebd51aa70 If the init fails for whatever reason, plugin is nil and cannot be used.
Addressing
=== RUN   TestCanSupport
E0719 13:48:19.829849    2289 driver-call.go:232] init command failed, status: Successx, reason:
--- FAIL: TestCanSupport (0.00s)
	flexvolume_test.go:180: Can't find the plugin by name
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x11fc5b5]
2017-07-19 16:08:45 +02:00
Alexander Block 8057056d1c Support "fstype" parameter in dynamically provisioned PVs 2017-07-19 10:34:13 +02:00
Cosmin Cojocar 95cf81f833 Remove clientset from azure file test build 2017-07-19 10:18:51 +02:00
Cosmin Cojocar 7ae381207e Remove unused import after rebase 2017-07-19 08:59:32 +02:00
Cosmin Cojocar 6c3a853149 Add the fake cloud provider to azure file build 2017-07-19 08:56:12 +02:00
Cosmin Cojocar 5c4290d4f2 Add tests for other cloud providers 2017-07-19 08:56:12 +02:00
Cosmin Cojocar 4378c7ae8e Restrict the dir and file permissions of the mounted volume 2017-07-19 08:56:12 +02:00
Cosmin Cojocar 44210092c1 Fix comment to conform to golint 2017-07-19 08:56:12 +02:00
Cosmin Cojocar a3506c8e16 Fall back on Azure public cloud endpoint when no Azure cloud provider is found 2017-07-19 08:56:12 +02:00
Cosmin Cojocar 599ab98f86 Add the azure cloud provider dependency to azure file plugin 2017-07-19 08:56:12 +02:00
Cosmin Cojocar b79a7a12c8 Fix the Azure file to work within different cloud environments 2017-07-19 08:55:24 +02:00
Kubernetes Submit Queue fc1d2b3be7 Merge pull request #48256 from xiangpengzhao/move-pkg-util
Automatic merge from submit-queue (batch tested with PRs 48481, 48256)

Refactor: pkg/util into sub-pkgs

**What this PR does / why we need it**:
- move code in pkg/util into sub-pkgs
- delete some unused funcs

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

**Special notes for your reviewer**:
This is the final work of #15634. It will close that issue.
/cc @thockin 

**Release note**:

```release-note
NONE
```
2017-07-18 18:19:19 -07:00
Humble Chirammal b432854f17 This patch add new storage class parameter called
`volumeoptions` which can be used to set various volume options.
for eg# if you want to enable encryption on volumes,
the values like `client.ssl on`, `server.ssl on`..etc can be passed
to `volumeoptions` parameter in storageclass.

Issue # https://github.com/kubernetes/kubernetes/issues/28454

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-07-18 19:45:38 +05:30
xiangpengzhao 01daf707c5 Refactor: pkg/util into sub-pkgs 2017-07-18 14:34:08 +08:00
sdkfzv cb388d0c7e Merge branch 'master' into master 2017-07-18 09:37:29 +08:00
zhangningmin 01b6fc78cd Improve the warning message if the rbd command is not found. 2017-07-18 09:33:24 +08:00
Jacob Simpson 2c70e5df35 Manual changes. 2017-07-17 15:05:37 -07:00
Jacob Simpson 29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Kubernetes Submit Queue 2c1c33d416 Merge pull request #48898 from portworx/fix-px-volume-calls
Automatic merge from submit-queue (batch tested with PRs 48997, 48595, 48898, 48711, 48972)

Use local PX endpoint for mount, unmount, detach and attach calls

**What this PR does / why we need it**:
This PR fixes an issue with Setup and TearDown of Portworx volumes which has side-effects such a Pod using a Portworx volume not being able to start on the minion.

**Which issue this PR fixes**: fixes #49034 
This PR addresses an issue that fails to mount, attach, unmount or detach a volume when Kubernetes sends these requests to Portworx when it's API server on that particular minion is down. 

Portworx mount, unmount, attach and detach requests need to be received on the minion where the pod is running. So these calls need to talk to the Portworx API server running locally on that node (and NOT to the Portworx k8s service since it may route the request to any node in the cluster). This PR explicitly makes such requests local only.

**Release note**:
```release-note
NONE
```
2017-07-17 13:23:52 -07:00
Kubernetes Submit Queue 1cbb7b1405 Merge pull request #47417 from xilabao/print-non-existent-key
Automatic merge from submit-queue (batch tested with PRs 47417, 47638, 46930)

print non-existent key in configmap

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

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

**Special notes for your reviewer**:
carry from #41574
**Release note**:

```release-note
NONE
```
2017-07-16 16:33:01 -07:00
Kubernetes Submit Queue 86a42b8796 Merge pull request #46973 from php-coder/improve_flex_logging
Automatic merge from submit-queue (batch tested with PRs 46973, 48556)

Improve error reporting when flex driver has failed to initialize

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

This PR improves error reporting for the case when flex driver is failing to initialize. There are 2 improvements:

1) show only the plugin name instead of a full struct. This makes a message shorter and removes useless and internal information.

Before:
>E0605 16:44:59.330215   26786 plugins.go:359] Failed to load volume plugin &{k8s/nfs /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s~nfs %!s(*kubelet.kubeletVolumeHost=&{0xc431ea5800 {{1 0} map[kubernetes.io/downward-api:0xc431ee3f20 kubernetes.io/aws-ebs:0xc431ee3eb0 kubernetes.io/git-repo:0xc431ee3ef0 kubernetes.io/host-path:0xc430e985f0 kubernetes.io/rbd:0xc42bfab840 kubernetes.io/quobyte:0xc431ee3f00 kubernetes.io/fc:0xc42bfab980 kubernetes.io/empty-dir:0xc431ee3ed0 kubernetes.io/nfs:0xc430e98640 kubernetes.io/iscsi:0xc42bfab720 kubernetes.io/glusterfs:0xc430faaba0 kubernetes.io/cinder:0xc42bfab8c0 kubernetes.io/gce-pd:0xc431ee3ee0 kubernetes.io/secret:0xc42bfab6a0 kubernetes.io/flocker:0xc431ee3f30 kubernetes.io/cephfs:0xc431ee3f10]} 0xc42698cf40}) %!s(*exec.executor=&{}) {%!s(int32=0) %!s(uint32=0)} []}, error: unexpected end of JSON input

After:
>E0605 16:59:45.520185   29041 plugins.go:359] Failed to load volume plugin k8s/nfs, error: unexpected end of JSON input

2) quote script output. In case the output was empty, messages look a bit better:

Before:
> E0605 16:44:59.330077   26786 driver-call.go:212] Failed to unmarshal output for command: init, **output: **, error: unexpected end of JSON input
> W0605 16:44:59.330170   26786 driver-call.go:140] FlexVolume: driver call failed: executable: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs, args: [init], error: fork/exec /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs: permission denied, **output: **

After:
>E0605 16:59:45.519906   29041 driver-call.go:212] Failed to unmarshal output for command: init, **output: ""**, error: unexpected end of JSON input
>W0605 16:59:45.520109   29041 driver-call.go:140] FlexVolume: driver call failed: executable: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs, args: [init], error: fork/exec /usr/libexec/kubernetes/kubelet-plugins/volume/exec/k8s\~nfs/nfs: permission denied, **output: ""**
2017-07-15 18:02:36 -07:00
Kubernetes Submit Queue c3e8bd04a9 Merge pull request #48949 from php-coder/minor_cleanup
Automatic merge from submit-queue

Fix comments and typo in the error message

**What this PR does / why we need it**:
This PR fixes outdated comments and typo in the error message.

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

CC @simo5
2017-07-15 16:04:21 -07:00
Kubernetes Submit Queue f736f3121f Merge pull request #48326 from karataliu/afd.dev
Automatic merge from submit-queue

Fix share name generation in azure file provisioner.

**What this PR does / why we need it**:
Azure file share name has a length limit of 63, but currently the code is using data volume's limit 75.

**Which issue this PR fixes**
With current implementation, when the cluster name is long, the resulting file share name could have a length of 75.

Also function `GenerateVolumeName` would produce double '-' when clusterName containing '-' is to be truncated.

In both cases, service would reject the creating file share request.

**Special notes for your reviewer**:
Please refer to:
https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata#share-names

- Share names must be from 3 through 63 characters long.
- The name cannot contain two consecutive hyphens.

@rootfs @colemickens 

**Release note**:
2017-07-14 19:50:14 -07:00
Huamin Chen b887776880 add fc volume attacher
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-07-14 16:34:53 -04:00
Harsh Desai 90919e3e4e Add more detailed comment for localOnly flag in getPortworxDriver function 2017-07-14 13:20:16 -07:00
Harsh Desai 7268e2e2e8 Fix logging levels in Portworx volume driver and add doc for getPortworxDriver function 2017-07-14 13:20:06 -07:00
Harsh Desai 8d0dec7078 Use local PX endpoint for mount, unmount, detach and attach calls 2017-07-14 13:20:06 -07:00
Kubernetes Submit Queue 8532cdfd69 Merge pull request #48886 from mikedanese/cleanup
Automatic merge from submit-queue

remove some people from OWNERS so they don't get reviews anymore

These are googlers who don't work on the project anymore but are still
getting reviews assigned to them:
- @bprashanth
- @rjnagal
- @vmarmol
2017-07-14 11:46:10 -07:00
Slava Semushin ae147a737c Fix comments and typo in the error message. 2017-07-14 19:17:12 +02:00
Khaled Henidak & Andy Zhang 677e593d86 Add Azure managed disk support 2017-07-14 14:09:44 +08:00
Mike Danese c201553f27 remove some people from OWNERS so they don't get reviews anymore
These are googlers who don't work on the project anymore but are still
getting reviews assigned to them:
- bprashanth
- rjnagal
- vmarmol
2017-07-13 10:02:21 -07:00
Kubernetes Submit Queue 494ffa4650 Merge pull request #48457 from cofyc/rbd_error
Automatic merge from submit-queue (batch tested with PRs 48425, 41680, 48457, 48619, 48635)

"rbd: image xxx is locked by other nodes" is misleading

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

For RWO PV, RBD plugin tries to fence it first, but there are many situations which may cause lock to fail, e.g.

- userSecret is incorrect
- monitor addresses are incorrect or node cannot access ceph cluster temporarily
- image is locked by other nodes
- maybe more...

So, original "image xxx is locked by other nodes" is incorrect in some cases and misleading in diagnosis.

This PR change the error to be correct and not misleading first. We may add detail error descriptions later.

**Special notes for your reviewer**:

New FailedMount event example if RBD plugin cannot lock image:

```
...		FailedMount		MountVolume.SetUp failed for volume "pvc-ee37a9c8-608e-11e7-b3a7-000c291fbe71" : rbd: failed to lock image kubernetes-dynamic-pvc-ee3b9911-608e-11e7-97b6-000c291fbe71 (maybe locked by other nodes), error exit status 22
```

**Release note**:

```release-note
NONE
```
2017-07-12 10:57:17 -07:00
Kubernetes Submit Queue f5f9894efc Merge pull request #48709 from jsafrane/gluster-autumount
Automatic merge from submit-queue (batch tested with PRs 48672, 47140, 48709, 48786, 48757)

glusterfs: retry without auto_unmount only when it's not supported

GlusterFS volume plugin should not blindly retry all failed mounts without
auto_unmount, it should retry them only when we are sure that auto_unmount
was the reason the first attempt failed.

@kubernetes/sig-storage-pr-reviews 
/assign @humblec 

```release-note
NONE
```
2017-07-12 09:02:55 -07:00
Kubernetes Submit Queue 65b48aaec1 Merge pull request #48672 from dixudx/resolve_hard_coded_path_sep_atomic
Automatic merge from submit-queue (batch tested with PRs 48672, 47140, 48709, 48786, 48757)

use built-in path separator instead of hard coded

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

We should use built-in path separator to avoid hard coded strings.

**Which issue this PR fixes** :

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-07-12 09:02:51 -07:00
Kubernetes Submit Queue 03360d7b65 Merge pull request #48402 from ianchakeres/local-storage-teardown-fix
Automatic merge from submit-queue

Local storage teardown fix

**What this PR does / why we need it**: Local storage uses bindmounts and the method IsLikelyNotMountPoint does not detect these as mountpoints. Therefore, local PVs are not properly unmounted when they are deleted.

**Which issue this PR fixes**: fixes #48331

**Special notes for your reviewer**:

You can use these e2e tests to reproduce the issue and validate the fix works appropriately https://github.com/kubernetes/kubernetes/pull/47999

The existing method IsLikelyNotMountPoint purposely does not check mountpoints reliability (4c5b22d4c6/pkg/util/mount/mount_linux.go (L161)), since the number of mountpoints can be large. 4c5b22d4c6/pkg/util/mount/mount.go (L46)

This implementation changes the behavior for local storage to detect mountpoints reliably, and avoids changing the behavior for any other callers to a UnmountPath.

**Release note**:

```
Fixes bind-mount teardown failure with non-mount point Local volumes (issue https://github.com/kubernetes/kubernetes/issues/48331).
```
2017-07-11 20:35:29 -07:00
Ian Chakeres 2b18d3b6f7 Fixes bind-mount teardown failure with non-mount point Local volumes
Added IsNotMountPoint method to mount utils (pkg/util/mount/mount.go)
Added UnmountMountPoint method to volume utils (pkg/volume/util/util.go)
Call UnmountMountPoint method from local storage (pkg/volume/local/local.go)
IsLikelyNotMountPoint behavior was not modified, so the logic/behavior for UnmountPath is not modified
2017-07-11 17:19:58 -04:00
Jan Safranek c20b4f7e4e glusterfs: retry without auto_unmount only when it's not supported
GlusterFS volume plugin should not blindly retry all failed mounts without
auto_unmount, it should retry them only when we are sure that auto_unmount
was the reason the first attempt failed.
2017-07-10 14:33:56 +02:00
Di Xu a76ccf5a5a use built-in path separator instead of hard coded 2017-07-09 23:24:34 +08:00
Yecheng Fu 29030d2b42 "rbd: image xxx is locked by other nodes" is misleading 2017-07-04 07:54:31 +00:00
Kubernetes Submit Queue d026286d39 Merge pull request #48055 from yiqinguo/yiqinguo_remove_err_ignored
Automatic merge from submit-queue

Add err judgment

I do not think that the error can be ignored here.

**Release note**:
```release-note
NONE
```
2017-07-02 20:05:39 -07:00
Kubernetes Submit Queue 4fe05d8191 Merge pull request #48264 from johscheuer/set-quota-for-volumes
Automatic merge from submit-queue (batch tested with PRs 48264, 48324, 48125, 47944, 47489)

Set quota for volumes

**What this PR does / why we need it**:
This PR allows users of the Quobyte Storage class to specify if automatically a Quota for the volume should be created. With a Quota a Quobyte volume can only grow in the specified size.

**Special notes for your reviewer**:
Update the Quobyte API version for the needed functionality.
2017-06-30 20:58:24 -07:00
Dong Liu ba3e49b56d Fix share name generation in azure file provisioner. 2017-06-30 15:42:40 +08:00
Kubernetes Submit Queue ad077c4ccb Merge pull request #47619 from mtanino/iscsi-remove-redundant-nil-check
Automatic merge from submit-queue (batch tested with PRs 47619, 47951, 46260, 48277)

iSCSi plugin: Remove redundant nil check

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

This patch is for cleanup of redundant nil check in iSCSI plugin.
This was mentioned at the code review on origin github thread.

https://github.com/openshift/origin/pull/14565

**Which issue this PR fixes** 

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-06-29 14:05:24 -07:00
Johannes Scheuermann e631550ef3 Make the Quota creation optional 2017-06-29 13:12:24 +02:00
Johannes Scheuermann 6a88a03d59 Set a Quobyte quota for newly created volumes 2017-06-29 09:21:58 +02:00
Kubernetes Submit Queue 4fd040afc7 Merge pull request #47647 from humblec/glusterfs-unused-var
Automatic merge from submit-queue (batch tested with PRs 48074, 47971, 48044, 47514, 47647)

Use more meaningful and consistent variable names in glusterfs plugin.
2017-06-26 11:41:01 -07:00
Jan Safranek c2dc5b5bf1 Move LoadPodFromFile to volume utils
SavePodToFile is not used anywhere and LoadPodFromFile is used only by PV
recycler.
2017-06-26 16:02:43 +02:00
yiqinguo b664a0db3d Add err judgment 2017-06-26 19:04:10 +08:00
Kubernetes Submit Queue e554dd6d3d Merge pull request #45805 from weiwei04/ceph-imageformat-2
Automatic merge from submit-queue

storageclass ceph add imageformat parameter

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

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

**Release note**:
```release-note
Allow StorageClass Ceph RBD to specify image format and image features.
```
2017-06-23 16:43:37 -07:00
Humble Chirammal 5f91b02a61 detach getClusterNodes() func from provisioner method.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-06-23 21:18:07 +05:30
Humble Chirammal a41e1c52ef Add annotation constants to glusterfs plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-06-23 19:03:07 +05:30
Kubernetes Submit Queue 62b801ef91 Merge pull request #47241 from NickrenREN/cephfs-loglevel
Automatic merge from submit-queue (batch tested with PRs 47922, 47195, 47241, 47095, 47401)

Change cephfs secret related logs level

Fixes: #45387
**Release note**:

```release-note
NONE
```

/cc @rootfs
2017-06-22 21:33:29 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu cde4772928 run ./root-rewrite-all-other-apis.sh, then run make all, pkg/... compiles 2017-06-22 11:30:52 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Kubernetes Submit Queue d021db8204 Merge pull request #47503 from chakri-nelluri/flexcap
Automatic merge from submit-queue (batch tested with PRs 47878, 47503, 47857)

Remove controller node plugin driver dependency for non-attachable fl…

…ex volume drivers (Ex: NFS).

**What this PR does / why we need it**:
Removes requirement to install flex volume drivers on master node for non-attachable drivers likes NFS.

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


```release-note
Fixes issue w/Flex volume, introduced in 1.6.0, where drivers without an attacher would fail (node indefinitely waiting for attach). Drivers that don't implement attach should return `attach: false` on `init`.
```
2017-06-21 21:12:15 -07:00
Kubernetes Submit Queue 03014f486c Merge pull request #47824 from mbohlool/revert2
Automatic merge from submit-queue (batch tested with PRs 47851, 47824, 47858, 46099)

Revert 44714 manually

#44714 broke backward compatibility for old swagger spec that kubectl still uses. The decision on #47448 was to revert this change but the change was not automatically revertible. Here I semi-manually remove all references to UnixUserID and UnixGroupID and updated generated files accordingly.

Please wait for tests to pass then review that as there may still be tests that are failing.

Fixes #47448

Adding release note just because the original PR has a release note. If possible, we should remove both release notes as they cancel each other.

**Release note**: (removed by caesarxuchao)

UnixUserID and UnixGroupID is reverted back as int64 to keep backward compatibility.
2017-06-21 15:21:14 -07:00
Kubernetes Submit Queue 1184ce869a Merge pull request #47236 from dixudx/not_allow_backsteps_in_local_volume
Automatic merge from submit-queue (batch tested with PRs 34515, 47236, 46694, 47819, 47792)

not allow backsteps in local volume plugin

**Which issue this PR fixes** : fixes #47207

**Special notes for your reviewer**:
cc @msau42 @ddysher
Just follow @liggitt [commented](https://github.com/kubernetes/kubernetes/issues/47107#issuecomment-306831175).

**Release note**:
```release-note
NONE
```
2017-06-21 13:30:09 -07:00
Kubernetes Submit Queue 0a6d307700 Merge pull request #34515 from jimengliu/master
Automatic merge from submit-queue (batch tested with PRs 34515, 47236, 46694, 47819, 47792)

remove unused constant

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

In flexvolume constant definitions, fix typo StatusFailure string to "Failure", not "Failed" at 

b359034817/pkg/volume/flexvolume/flexvolume_util.go (L45)

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

**Special notes for your reviewer**:
Simple string literal change, but hopefully will prevent future confusion for developers.
2017-06-21 13:30:04 -07:00
mbohlool c91a12d205 Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00
Humble Chirammal 8cb70cd0e6 Use more meaningful and consistent variable names in glusterfs plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-06-20 11:12:47 +05:30
Huamin Chen 14c94fad2b manually revert #45528
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-06-19 17:57:37 +00:00
Chakravarthy Nelluri 894b9b2add Remove controller node plugin driver dependency for non-attachable flex volume drivers (Ex: NFS). 2017-06-17 14:12:43 -04:00
Di Xu aa23ed53c2 not allow backsteps in local volume plugin 2017-06-17 14:37:34 +08:00
Kubernetes Submit Queue 098e1df3b6 Merge pull request #47290 from jhorwit2/jah/hostpath-psp-backstep-check
Automatic merge from submit-queue (batch tested with PRs 47626, 47674, 47683, 47290, 47688)

validate host paths on the kubelet for backsteps

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

This PR adds validation on the kubelet to ensure the host path does not contain backsteps that could allow the volume to escape the PSP's allowed host paths. Currently, there is validation done at in API server; however, that does not account for mismatch of OS's on the kubelet vs api server. 

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

**Special notes for your reviewer**:

cc @liggitt

**Release note**:


```release-note
Paths containing backsteps (for example, "../bar") are no longer allowed in hostPath volume paths, or in volumeMount subpaths
```
2017-06-16 19:57:01 -07:00
Kubernetes Submit Queue fdc6746818 Merge pull request #46382 from verult/FlexVolumeMinorPatches
Automatic merge from submit-queue (batch tested with PRs 38751, 44282, 46382, 47603, 47606)

Adding 'flexvolume' prefix to FlexVolume plugin names.

**What this PR does / why we need it**: Adds a prefix to FlexVolume plugin names in order to more easily identify plugins as FlexVolume. Improves debugging.

**Special notes for your reviewer**: Unfortunately the delimiter after 'flexvolume' is restricted to either '-' or '.' . This makes the prefix seem like it's part of the vendor name. Not sure if this could cause issues later on.

**Release note**:

```release-note
NONE
```
2017-06-16 18:05:51 -07:00
Josh Horwitz 48b3fb84ab do not allow backsteps in host volume plugin
Fixes #47107
2017-06-16 16:48:24 -04:00
Yecheng Fu 4e5e9ca0cd Only `layering` RBD image format 2 feature should be supported for now. 2017-06-16 18:07:03 +00:00
Yecheng Fu 0c7cdf773b Add `imageFeatures` parameter for RBD volume plugin, which is used to
customize RBD image format 2 features.
Update RBD docs in examples/persistent-volume-provisioning/README.md.
2017-06-16 18:07:03 +00:00
Wei Wei 2632bdd5e0 storageclass ceph add imageformat parameter 2017-06-16 18:07:03 +00:00
Mitsuhiro Tanino 285ac8935f iSCSi plugin: Remove redundant nil check 2017-06-15 18:00:29 -04:00
xilabao 6abed5883f print non-existent key in configmap 2017-06-15 10:57:19 +08:00
Kubernetes Submit Queue eb26aa5553 Merge pull request #47400 from chakri-nelluri/fixgetvolumename
Automatic merge from submit-queue (batch tested with PRs 47204, 46808, 47432, 47400, 47099)

Remove broken getvolumename and pass PV or volume name to attach call

Cherry-picking https://github.com/kubernetes/kubernetes/pull/46249 to master

What this PR does / why we need it:
Flex getvolumename is broken in 1.6. It needs to be fixed comprehensively in 1.7 release. Removing the api in 1.6. Also pass PV or volume name to the driver during attach call. Detach uses PV or volume name, so plugin can use that information to map to PV.
Which issue this PR fixes (optional, in fixes #(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
Fixes - #44737
2017-06-14 17:14:06 -07:00
Kubernetes Submit Queue 03c5fd4b2a Merge pull request #46016 from kokhang/rbd-modprobe
Automatic merge from submit-queue (batch tested with PRs 47084, 46016, 46372)

Warn, instead of failing, if 'modprobe rbd' fails

Modprobe is a kernel operation that should only be done once to load the
RBD module. The admin could've done this on the Kubernetes nodes. The
RBD plugin can still try to load the module but it shouldnt fail the
workflow if it doesnt succeed.

Partially addresses #45190
2017-06-13 16:53:41 -07:00
Kubernetes Submit Queue 38837b018b Merge pull request #47274 from wongma7/accessmodes-provision
Automatic merge from submit-queue (batch tested with PRs 46929, 47391, 47399, 47428, 47274)

Don't provision for PVCs with AccessModes unsupported by plugin

Fail early in case the user actually expects e.g. RWM from AWS when in reality that isn't possible.
@eparis @gnufied 

edit: this needs release note because it's a breaking bugfix; will write one.

https://github.com/kubernetes/kubernetes/issues/46540
```release-note
Fix dynamic provisioning of PVs with inaccurate AccessModes by refusing to provision when PVCs ask for AccessModes that can't be satisfied by the PVs' underlying volume plugin
```
2017-06-13 10:52:17 -07:00
Kubernetes Submit Queue 0b0ec9b581 Merge pull request #46342 from vaibhavsood/master
Automatic merge from submit-queue (batch tested with PRs 47075, 46342)

Remove hardcode for blocksize, use stat(), fixes test failure on SLES

**What this PR does / why we need it**:
Removes hardcoding for blocksize, fixes test failure on SLES
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #44022

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-06-12 23:50:03 -07:00
Chakravarthy Nelluri 7885aaf689 Remove broken getvolumename and pass PV or volume name to attach call 2017-06-13 00:32:38 -04:00
Cheng Xing 8b2e1b55e0 Adding 'flexvolume' prefix to FlexVolume plugin names. 2017-06-12 18:03:40 -07:00
Matthew Wong 5e788a6a67 Don't provision for PVCs with AccessModes unsupported by plugin 2017-06-12 12:56:41 -04:00
mtanino b1f06aaed5 iSCSI plugin: Update devicepath with filepath.Glob result
If iscsiTransport is not tcp, iSCSI plugin tries to
find devicepath using filepath.Glob but never updates
devicepath with the filepath.Glob result.

This patch fixes the problem.

Fixes #47253
2017-06-09 22:54:25 -04:00
NickrenREN 7dc9f9196e Change cephfs secret related logs level 2017-06-09 20:20:00 +08:00
Simon Croome 5e2503e71f Add StorageOS volume plugin 2017-06-09 13:19:27 +01:00
Kubernetes Submit Queue a1ed965cc6 Merge pull request #47018 from FengyunPan/fix-attach
Automatic merge from submit-queue (batch tested with PRs 46977, 47005, 47018, 47061, 46809)

Waiting attach operation to be finished rather than returning nil

Fixes #46882
2017-06-07 08:10:43 -07:00
Kubernetes Submit Queue 5c9b9ae0cb Merge pull request #47021 from liggitt/projected-err
Automatic merge from submit-queue (batch tested with PRs 46997, 47021)

Block on projected volume data fetch failure

Fixes #47020
2017-06-06 20:12:18 -07:00
FengyunPan 1f47323187 Waiting attach operation to be finished rather than returning nil 2017-06-06 22:58:44 +08:00
Jordan Liggitt 3fd4e16eb0
Block on projected volume data fetch failure 2017-06-06 00:34:24 -04:00
Slava Semushin ec12e6cc9d Improve error reporting when flex driver has failed to initialize. 2017-06-05 17:07:33 +02:00
mtanino 82ce37d973 bkpPortal should be initialized beforehand
This patch is a follow up patch for the PR#46239.
The bkpPortal in DetachDisk() path should be initialized
before using it.
2017-06-05 10:22:57 -04:00
Kubernetes Submit Queue 974606544d Merge pull request #43852 from ailusazh/AddSuccessfulMountVolumeMsgToEvent
Automatic merge from submit-queue

Add SuccessfulMountVolume message to the events of pod

**What this PR does / why we need it:**
When creating a pod with volume, the volume mount may failed at first, but eventually succeed after retry several times. kubectl describe pod can only see the failed messages, so i think it will be better to add the SuccessfulMountVolume message to the pod events too.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Fixes #42867
2017-06-05 01:46:36 -07:00
Kubernetes Submit Queue 348bf1e032 Merge pull request #46627 from deads2k/api-12-labels
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

move labels to components which own the APIs

During the apimachinery split in 1.6, we accidentally moved several label APIs into apimachinery.  They don't belong there, since the individual APIs are not general machinery concerns, but instead are the concern of particular components: most commonly the kubelet.  This pull moves the labels into their owning components and out of API machinery.

@kubernetes/sig-api-machinery-misc @kubernetes/api-reviewers @kubernetes/api-approvers 
@derekwaynecarr  since most of these are related to the kubelet
2017-06-02 23:37:38 -07:00
Kubernetes Submit Queue fcf183dcaa Merge pull request #46239 from mtanino/issue/45394
Automatic merge from submit-queue

Log out from multiple target portals when using iscsi storage plugin

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

When using iscsi storage with multiple target portal (TP) addresses
and multipathing the volume manager logs on to the IQN for all
portal addresses, but when a pod gets destroyed the volume manager
only logs out for the primary TP and sessions for another TPs are
always remained.

This patch adds mount points for all TPs, and then log out from all
TPs when a pod is destroyed. If a TP is referred from another pods,
the connection will be remained as usual.



**Which issue this PR fixes** 
fixes #45394

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-06-02 23:27:14 -07:00
ailusazh f57224c0d2 Add SuccessfulMountVolume message to the events of pod 2017-06-01 17:56:47 +08:00
Kubernetes Submit Queue c13d8917c2 Merge pull request #46470 from shyamjvs/configmap-interface
Automatic merge from submit-queue

Migrate kubelet to ConfigMapManager interface and use TTL-based caching manager

Fixes #41379
Sometime ago we moved to a secret manager interface for kubelet to manage secrets.
This PR's first commit moves config map management also to a similar interface.
The second commit adds TTL-based CachingConfigMapManager (similar to CachingSecretManager) and makes kubelet use it.

/cc @kubernetes/sig-node-pr-reviews @kubernetes/sig-scalability-misc @wojtek-t @dchen1107
2017-06-01 01:53:34 -07:00
mtanino aebaee39d5 Log out from multiple portals with iscsi storage plugin
When using iscsi storage with multiple target portal (TP)
addresses and multipathing the volume manager logs on to
the IQN for all portal addresses, but when a pod gets
destroyed the volume manager only logs out for the primary
TP and sessions for another TPs are always remained.

This patch adds methods to store and load iscsi disk
configrations, then uses the stored config at DetachDisk
path.

Fix #45394
2017-05-31 16:53:47 -04:00
deads2k 954eb3ceb9 move labels to components which own the APIs 2017-05-31 10:32:06 -04:00
vaibhavsood a4809bc3c9 Update metrics_du_test.go 2017-05-31 17:21:46 +05:30
Kubernetes Submit Queue f0962765a7 Merge pull request #46182 from FengyunPan/check_detach
Automatic merge from submit-queue

Check volume's status before detaching volume

When volume's status is 'detaching', controllermanager will detach
it again and return err. It is necessary to check volume's status
before detaching volume.

same issue: #44536
2017-05-31 02:40:45 -07:00
Shyam Jeedigunta 4425864707 Migrate kubelet configmap management logic to an interface 2017-05-31 10:39:36 +02:00
Kubernetes Submit Queue 50c6a38c1e Merge pull request #46562 from dixudx/volume_manager_function_format
Automatic merge from submit-queue (batch tested with PRs 46661, 46562, 46657, 46655, 46640)

remove redundant carriage return for readable

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

remove redundant carriage to make it more readable.
2017-05-31 01:08:01 -07:00
Kubernetes Submit Queue 0aad9d30e3 Merge pull request #44897 from msau42/local-storage-plugin
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Local storage plugin

**What this PR does / why we need it**:
Volume plugin implementation for local persistent volumes.  Scheduler predicate will direct already-bound PVCs to the node that the local PV is at.  PVC binding still happens independently.

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

**Release note**:

```
Alpha feature: Local volume plugin allows local directories to be created and consumed as a Persistent Volume.  These volumes have node affinity and pods will only be scheduled to the node that the volume is at.
```
2017-05-30 23:20:02 -07:00
FengyunPan 300f531389 Wait for detach operation to complete
When volume's status is 'detaching', controllermanager will detach
it again and return err. It is necessary to wait for detach
operation to complete within the alloted time.
2017-05-31 07:52:15 +08:00
Humble Chirammal 357cff5f11 Remove glusterfs fuse client mount library version check
for `auto_unmount` mount option.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-30 14:13:25 +05:30
Di Xu caeb584230 remove redundant carriage return (cont'd) 2017-05-30 16:29:21 +08:00
Kubernetes Submit Queue ef1febf789 Merge pull request #46367 from bobveznat/master
Automatic merge from submit-queue (batch tested with PRs 46450, 46272, 46453, 46019, 46367)

Move MountVolume.SetUp succeeded to debug level

This message is verbose and repeated over and over again in log files
creating a lot of noise. Leave the message in, but require a -v in
order to actually log it.

**What this PR does / why we need it**: Moves a verbose log message to actually be verbose.

**Which issue this PR fixes** fixes #46364
Fixes #29059
2017-05-26 18:49:04 -07:00
Kubernetes Submit Queue c34b359bd7 Merge pull request #45923 from verult/cxing/NodeStatusUpdaterFix
Automatic merge from submit-queue (batch tested with PRs 46383, 45645, 45923, 44884, 46294)

Node status updater now deletes the node entry in attach updates...

… when node is missing in NodeInformer cache.

- Added RemoveNodeFromAttachUpdates as part of node status updater operations.



**What this PR does / why we need it**: Fixes issue of unnecessary node status updates when node is deleted.

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

**Special notes for your reviewer**: Unit tested added, but a more comprehensive test involving the attach detach controller requires certain testing functionality that is currently absent, and will require larger effort. Will be added at a later time.

There is an edge case caused by the following steps:
1) A node is deleted and restarted. The node exists, but is not yet recognized by Kubernetes.
2) A pod requiring a volume attach with nodeName specifically set to this node.

This would make the pod stuck in ContainerCreating state. This is low-pri since it's a specific edge case that can be avoided.

**Release note**:

```release-note
NONE
```
2017-05-26 12:58:02 -07:00
Michelle Au f385dfcb3b Address review comments 2017-05-26 11:48:31 -07:00
Bob Van Zant aca05c922c Move MountVolume.SetUp succeeded to debug level
This message is verbose and repeated over and over again in log files
creating a lot of noise. Leave the messsage in, but require a -v in
order to actually log it.

Fixes #29059
2017-05-26 10:54:34 -07:00
NickrenREN a02d6cd5d8 Add createdby annotation for rbd and quobyte and make dynamical createdby key const
make dynamical createdby key const
2017-05-26 16:55:11 +08:00
Kubernetes Submit Queue 07038c9417 Merge pull request #46395 from mindprince/issue-46204-45803-kubelet-volumes-test-flake
Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

Implement FakeVolumePlugin's ConstructVolumeSpec method according to interface expectation.

This fixes #45803 and #46204.

**Release note**:
```release-note
NONE
```
2017-05-25 22:42:06 -07:00
Kubernetes Submit Queue b017a7a392 Merge pull request #45518 from portworx/px-remote
Automatic merge from submit-queue (batch tested with PRs 45518, 46127, 46146, 45932, 45003)

Remove requirement to run the Portworx volume driver on master node

**What this PR does / why we need it**:
This change removes requirement to run the Portworx volume driver on Kubernetes master node.

**Special notes for your reviewer**:
Before this pull request, in order to use a Portworx volume, users had to run the Portworx container on the master node. Since it isn't ideal (and impossible on GKE) to schedule any pods on the master node, this PR removes that requirement.
2017-05-25 11:45:59 -07:00
Kubernetes Submit Queue 079020f559 Merge pull request #46160 from NickrenREN/fix-UX
Automatic merge from submit-queue

fix regression in UX experience for double attach volume

send event when volume is not allowed to multi-attach

Fixes #46012

**Release note**:
```release-note
NONE
```
2017-05-25 08:50:12 -07:00
Cheng Xing f9dc2d5ca3 Node status updater now deletes the node entry in attach updates when node is missing in NodeInformer cache. Fixes #42438.
- Added RemoveNodeFromAttachUpdates as part of node status updater operations.
2017-05-24 18:31:47 -07:00
NickrenREN add091b1fb fix regression in UX experience for double attach volume
send event when volume is not allowed to multi-attach
2017-05-25 09:27:24 +08:00
Rohit Agarwal 0f5cc4027f Implement FakeVolumePlugin's ConstructVolumeSpec method according to interface expectation.
This fixes #45803 and #46204.
2017-05-24 17:26:34 -07:00
Harsh Desai ad4f21f26c Dedup common code for fetching portworx driver 2017-05-24 14:52:04 -07:00
Harsh Desai bbfda9cdfe Remove call to common unmount routine as Portworx takes care of all umount workflow 2017-05-24 14:52:03 -07:00
Harsh Desai 779455aa32 fix bazel build 2017-05-24 14:52:03 -07:00
Harsh Desai e860da4bd2 Use Portworx service as api endpoint for volume operations 2017-05-24 14:52:03 -07:00
Harsh Desai 244a0b7b7e Add support for Portworx plugin to query remote API servers 2017-05-24 14:52:03 -07:00
Humble Chirammal 55808add37 Dont exit if 'mount.glusterfs -V' resulted in an error.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-24 21:07:58 +05:30
Kubernetes Submit Queue 70dd10cc50 Merge pull request #41785 from jamiehannaford/cinder-performance
Automatic merge from submit-queue (batch tested with PRs 38505, 41785, 46315)

Only retrieve relevant volumes

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

Improves performance for Cinder volume attach/detach calls. 

Currently when Cinder volumes are attached or detached, functions try to retrieve details about the volume from the Nova API. Because some only have the volume name not its UUID, they use the list function in gophercloud to iterate over all volumes to find a match. This incurs severe performance problems on OpenStack projects with lots of volumes (sometimes thousands) since it needs to send a new request when the current page does not contain a match. A better way of doing this is use the `?name=XXX` query parameter to refine the results.

**Which issue this PR fixes**:

https://github.com/kubernetes/kubernetes/issues/26404

**Special notes for your reviewer**:

There were 2 ways of addressing this problem:

1. Use the `name` query parameter
2. Instead of using the list function, switch to using volume UUIDs and use the GET function instead. You'd need to change the signature of a few functions though, such as [`DeleteVolume`](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/cinder/cinder.go#L49), so I'm not sure how backwards compatible that is.

Since #1 does effectively the same as #2, I went with it because it ensures BC.

One assumption that is made is that the `volumeName` being retrieved matches exactly the name of the volume in Cinder. I'm not sure how accurate that is, but I see no reason why cloud providers would want to append/prefix things arbitrarily. 

**Release note**:
```release-note
Improves performance of Cinder volume attach/detach operations
```
2017-05-24 06:46:59 -07:00
Jamie Hannaford 4bd71a3b77 Refactor to use Volume IDs and remove ambiguity 2017-05-24 12:59:16 +02:00
Vaibhav Sood 5324dcb37b Remove hardcode for blocksize, use stat(), fixes test failure on SLES 2017-05-24 16:20:38 +05:30
pospispa 9eb912e62f Admin Can Specify in Which AWS Availability Zone(s) a PV Shall Be Created
An admin wants to specify in which AWS availability zone(s) users may create persistent volumes using dynamic provisioning.

That's why the admin can now configure in StorageClass object a comma separated list of zones. Dynamically created PVs for PVCs that use the StorageClass are created in one of the configured zones.
2017-05-24 10:48:11 +02:00
pospispa d73c0d649d Admin Can Specify in Which GCE Availability Zone(s) a PV Shall Be Created
An admin wants to specify in which GCE availability zone(s) users may create persistent volumes using dynamic provisioning.

That's why the admin can now configure in StorageClass object a comma separated list of zones. Dynamically created PVs for PVCs that use the StorageClass are created in one of the configured zones.
2017-05-24 10:48:10 +02:00
pospispa dd17d620d7 Added func ValidateZone
The zone parameter provided in a Storage Class may erroneously be an empty string or contain only spaces and tab characters. Such situation shall be detected and reported as an error.

That's why the func ValidateZone was added.
2017-05-24 10:48:10 +02:00
pospispa 0f3a9cfc5f Added func ZonesToSet
An admin shall be able to configure a comma separated list of zones for a StorageClass.

That's why the func ZonesToSet (string) (set.String, error) is added. The func ZonesToSet converts a string containing a comma separated list of zones to a set. In case the list contains an empty zone an error is returned.
2017-05-24 10:48:10 +02:00
Kubernetes Submit Queue 286bcc6f5c Merge pull request #45995 from humblec/glusterfs-mount-3
Automatic merge from submit-queue

Add `auto_unmount` mount option for glusterfs fuse mount.

libfuse has an auto_unmount option which, if enabled, ensures that
the file system is unmounted at FUSE server termination by running a
separate monitor process that performs the unmount when that occurs.
(This feature would probably better be called "robust auto-unmount",
as FUSE servers usually do try to unmount their file systems upon
termination, it's just this mechanism is not crash resilient.)
This change implements that option and behavior for glusterfs.

This option will be only supported for clients with version >3.11.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-23 00:29:41 -07:00
Balu Dontu eb3cf509e5 SPBM policy ID support in vsphere cloud provider 2017-05-22 19:45:17 -07:00
Michelle Au dd46c7f88e Local volume plugin 2017-05-22 14:44:51 -07:00
Michelle Au 06f25b03eb Check volume node affinity before mount 2017-05-22 14:44:06 -07:00
Michelle Au 6ade5461ad Add GetNodeLabels to VolumeHost interface 2017-05-22 14:44:06 -07:00
Humble Chirammal 04bf95a5d1 Add `auto_unmount` mount option for glusterfs fuse mount.
libfuse has an auto_unmount option which, if enabled, ensures that
the file system is unmounted at FUSE server termination by running a
separate monitor process that performs the unmount when that occurs.
(This feature would probably better be called "robust auto-unmount",
as FUSE servers usually do try to unmount their file systems upon
termination, it's just this mechanism is not crash resilient.)
This change implements that option and behavior for glusterfs.

This option will be only supported for clients with version >3.11.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-22 23:50:54 +05:30
FengyunPan ae7bf3e649 Fix missing close file 2017-05-22 22:02:55 +08:00
Steve Leon ab77633c95 Warn, instead of failing, if 'modprobe rbd' fails
Modprobe is a kernel operation that should only be done once to load the
RBD module. The admin could've done this on the Kubernetes nodes. The
RBD plugin can still try to load the module but it shouldnt fail the
workflow if it doesnt succeed.

Partially addresses #45190
2017-05-17 22:53:21 -07:00
Jordan Liggitt b22ff25638
Pass pod metadata to flex plugin 2017-05-18 00:49:18 -04:00
Kubernetes Submit Queue 2cf0169092 Merge pull request #45895 from humblec/glusterfs-defacto
Automatic merge from submit-queue

Make interface references consistent across the gluster plugin code.
2017-05-17 09:42:40 -07:00
Humble Chirammal 19ecd5bd62 Make interface references consistent across the plugin code.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-17 10:19:56 +05:30
Kubernetes Submit Queue f171683242 Merge pull request #44537 from FengyunPan/fix-volume-bug
Automatic merge from submit-queue (batch tested with PRs 45374, 44537, 45739, 44474, 45888)

Fix attach volume to instance repeatedly

1.When volume's status is 'attaching', controllermanager will attach
    it again and return err. So it is necessary to check volume's
    status before attach/detach volume.

   2. When volume's status is 'attaching', its attachments will be None,
    controllermanager can't get device path and make some failed event.
    But it is normal, so don't return err when attachments is None

Fix bug: #44536
2017-05-16 18:10:55 -07:00
Kubernetes Submit Queue 11a6f190be Merge pull request #45528 from humblec/glusterfs-code-refactor
Automatic merge from submit-queue (batch tested with PRs 45408, 45355, 45528)

Make createEndpointService() and deleteEndpointService() plugin interface methods.

Why this change?

In some setups, after creation of dynamic PVs and before mounting/using these  PVs in a pod, the endpoint/service got mistakenly deleted by the user/developer. By making these methods 'plugin' specific, we can call it from mounter if there are scenarios where the endpoint and service got wiped in between accidentally.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-16 09:12:00 -07:00
Humble Chirammal 936c81ddfb Recreate endpoint/service if it lost in between.
In some setups, after creation of dynamic PVs and before mounting/using
these PVs in a pod, the endpoint/service got mistakenly deleted by the
user/developer. By making these methods 'plugin' specific, we can call
it from mounter if there are scenarios where the endpoint and service
got wiped in between accidentally.

Signed-off-by: Humble Chirammal hchiramm@redhat.com
2017-05-16 19:51:21 +05:30
FengyunPan d86bf8a0b8 Fix reconciler test of attaching volume
The Attach() of FakeVolume should return device path
2017-05-13 15:19:34 +08:00
FengyunPan 4a6e1f2a1d Don't return err when volume's status is 'attaching'
When volume's status is 'attaching', its attachments will be None,
controllermanager can't get device path and make some failed event.
But it is normal, let's fix it.
2017-05-12 19:53:50 +08:00
Hemant Kumar 951a36aac7 Add Keepterminatedpodvolumes as a annotation on node
and lets make sure that controller respects it
and doesn't detaches mounted volumes.
2017-05-11 22:31:14 -04:00
divyenpatel 9f89b57b74 fix implementation of VolumesAreAttached function 2017-05-10 10:16:13 -07:00
Kubernetes Submit Queue fc28762671 Merge pull request #45448 from zhangxiaoyu-zidif/cleancode-nfs-return-err
Automatic merge from submit-queue (batch tested with PRs 44798, 45537, 45448, 45432)

nfs.go: cleancode err

**What this PR does / why we need it**:
The modification makes  code clean, simple, and easy to inspect. 

**Release note**:

```release-note
NONE
```
2017-05-09 08:29:37 -07:00
Kubernetes Submit Queue 49626c975b Merge pull request #44798 from zetaab/master
Automatic merge from submit-queue

Statefulsets for cinder: allow multi-AZ deployments, spread pods across zones

**What this PR does / why we need it**: Currently if we do not specify availability zone in cinder storageclass, the cinder is provisioned to zone called nova. However, like mentioned in issue, we have situation that we want spread statefulset across 3 different zones. Currently this is not possible with statefulsets and cinder storageclass. In this new solution, if we leave it empty the algorithm will choose the zone for the cinder drive similar style like in aws and gce storageclass solutions. 

**Which issue this PR fixes** fixes #44735

**Special notes for your reviewer**:

example:

```
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: all
provisioner: kubernetes.io/cinder
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
  name: galera
  labels:
    app: mysql
spec:
  ports:
  - port: 3306
    name: mysql
  clusterIP: None
  selector:
    app: mysql
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: mysql
spec:
  serviceName: "galera"
  replicas: 3
  template:
    metadata:
      labels:
        app: mysql
      annotations:
        pod.alpha.kubernetes.io/initialized: "true"
    spec:
      containers:
      - name: mysql
        image: adfinissygroup/k8s-mariadb-galera-centos:v002
        imagePullPolicy: Always
        ports:
        - containerPort: 3306
          name: mysql
        - containerPort: 4444
          name: sst
        - containerPort: 4567
          name: replication
        - containerPort: 4568
          name: ist
        volumeMounts:
        - name: storage
          mountPath: /data
        readinessProbe:
          exec:
            command:
            - /usr/share/container-scripts/mysql/readiness-probe.sh
          initialDelaySeconds: 15
          timeoutSeconds: 5
        env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
  volumeClaimTemplates:
  - metadata:
      name: storage
      annotations:
        volume.beta.kubernetes.io/storage-class: all
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 12Gi
```

If this example is deployed it will automatically create one replica per AZ. This helps us a lot making HA databases.

Current storageclass for cinder is not perfect in case of statefulsets. Lets assume that cinder storageclass is defined to be in zone called nova, but because labels are not added to pv - pods can be started in any zone. The problem is that at least in our openstack it is not possible to use cinder drive located in zone x from zone y. However, should we have possibility to choose between cross-zone cinder mounts or not? Imo it is not good way of doing things that they mount volume from another zone where the pod is located(means more network traffic between zones)? What you think? Current new solution does not allow that anymore (should we have possibility to allow it? it means removing the labels from pv).

There might be some things that needs to be fixed still in this release and I need help for that. Some parts of the code is not perfect.

Issues what i am thinking about (I need some help for these):
1) Can everybody see in openstack what AZ their servers are? Can there be like access policy that do not show that? If AZ is not found from server specs, I have no idea how the code behaves. 
2) In GetAllZones() function, is it really needed to make new serviceclient using openstack.NewComputeV2 or could I somehow use existing one
3) This fetches all servers from some openstack tenant(project). However, in some cases kubernetes is maybe deployed only to specific zone. If kube servers are located for instance in zone 1, and then there are another servers in same tenant in zone 2. There might be usecase that cinder drive is provisioned to zone-2 but it cannot start pod, because kubernetes does not have any nodes in zone-2. Could we have better way to fetch kubernetes nodes zones? Currently that information is not added to kubernetes node labels automatically in openstack (which should I think). I have added those labels manually to nodes. If that zone information is not added to nodes, the new solution does not start stateful pods at all, because it cannot target pods.


cc @rootfs @anguslees @jsafrane 

```release-note
Default behaviour in cinder storageclass is changed. If availability is not specified, the zone is chosen by algorithm. It makes possible to spread stateful pods across many zones.
```
2017-05-09 08:10:44 -07:00
Kubernetes Submit Queue d602ea69dc Merge pull request #45295 from rootfs/vol-owner
Automatic merge from submit-queue

add rootfs gnufied and childsb to volume approver

**What this PR does / why we need it**:
add me and @gnufied @childsb to volume approver 
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-09 04:13:00 -07:00
Jan Safranek 016c34ff40 Tune Cinder approvers 2017-05-09 12:59:35 +02:00
Kubernetes Submit Queue 95d8fbb599 Merge pull request #45409 from humblec/glusterfs-code-cleanup
Automatic merge from submit-queue (batch tested with PRs 44727, 45409, 44968, 45122, 45493)

More go friendly variable names.

clusterId -> clusterID
volumeId  -> volumeID

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-08 14:54:37 -07:00
Kubernetes Submit Queue e2924880df Merge pull request #41799 from johscheuer/fix-quobyte-example
Automatic merge from submit-queue

Remove unnecessary constants and add type to secret

**What this PR does / why we need it**:
Adds the type field to the secret for the `persistent-volume-provisioning` example of Quobyte. Also remove unnecessary constants in Quobyte Code base.

FYI
@rootfs @saad-ali @quolix
2017-05-08 13:25:22 -07:00
zhangxiaoyu-zidif aec46961e9 nfs.go: cleancode err 2017-05-06 19:06:27 +08:00
Kubernetes Submit Queue 5b3d0bbe66 Merge pull request #44714 from jamiehannaford/unix_user_type
Automatic merge from submit-queue (batch tested with PRs 44590, 44969, 45325, 45208, 44714)

Use dedicated UnixUserID and UnixGroupID types

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

DRYs up type definitions by using the dedicated types in apimachinery 

**Which issue this PR fixes**

#38120

**Release note**:
```release-note
UIDs and GIDs now use apimachinery types
```
2017-05-05 14:08:17 -07:00
Kubernetes Submit Queue ec3448deac Merge pull request #44969 from ianchakeres/ianchakeres/mount-err-cleanup
Automatic merge from submit-queue (batch tested with PRs 44590, 44969, 45325, 45208, 44714)

Refactor volume operation log and error messages

What this PR does / why we need it:
Adds wrappers for volume-specific error and log messages. Each message has a simple version that can be displayed to the user and a detailed version that can be used in logs. The messages that are used for events was also cleaned up. @msau42 

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

Special notes for your reviewer:
pkg/kubelet/volumemanager/reconciler/reconciler.go can be refactored. I can do that refactoring after this one.

Release note:

NONE
2017-05-05 14:08:10 -07:00
Jamie Hannaford 9440a68744 Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
Humble Chirammal 16badd361f More go friendly variable names.
clusterId -> clusterID
volumeId  -> volumeID

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-05 16:17:20 +05:30
Ian Chakeres bbc8859176 Refactor volume operation log and error messages 2017-05-04 13:29:01 -07:00
Kubernetes Submit Queue ca520e34a3 Merge pull request #44669 from humblec/gluster-metadata-pv
Automatic merge from submit-queue (batch tested with PRs 45081, 44669)

Add more metadata about dynamically provisioned PVs using PV annotation

This patch add below fields to Gluster dynamic pvs.

"Description: "Gluster: dynamically provisioned PVs"
"Creator": "heketi-dynamic"
"Type": "file"

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-04 10:05:56 -07:00
Humble Chirammal 1d17c0ccef Add more metadata about dynamically provisioned PVs using
PV annotation:

This patch add below fields to Gluster dynamic pvs:

   "Description: "Gluster: dynamically provisioned PV"
   "Creator": "heketi-dynamic"
   "Type": "file"

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-04 20:17:53 +05:30
Kubernetes Submit Queue fcd9b7f7ba Merge pull request #44295 from rootfs/azure-devicepath-nil
Automatic merge from submit-queue (batch tested with PRs 45283, 45289, 45248, 44295)

Azure disk: dealing with missing disk probe

**What this PR does / why we need it**:
While Azure disks are expected to attach to SCSI host 3 and above on general purpose instances, on certain Azure instances disks are under SCSI host 2. 

This fix searches all LUNs but excludes those used by Azure sys disks, based on udev rules [here](https://raw.githubusercontent.com/Azure/WALinuxAgent/master/config/66-azure-storage.rules)

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-03 12:08:00 -07:00
Huamin Chen 9a90626ff6 add rootfs gnufied and childsb to volume approver
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-05-03 17:45:18 +00:00
Huamin Chen f14a0744e6 Azure disk: dealing with missing disk probe
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-05-03 17:33:17 +00:00
Jesse Haka 66e49eecca add possibility to leave AZ empty, and it will automatically generate zone for it
update bazel

fix gofmt

make getzones function lowercase

add az to log
2017-05-03 16:37:20 +03:00
saadali eacc48373b Remove rkouj from owners files. 2017-04-28 17:14:38 -07:00
Kubernetes Submit Queue 19795ea7c3 Merge pull request #45042 from wongma7/attaching-log
Automatic merge from submit-queue

Log node name when error attaching volume

Helps with debugging to know immediately which node the volume failed to atach to. Went through all plugins, added this to 3. @gnufied
```release-note
NONE
```
2017-04-27 23:04:05 -07:00
Matthew Wong c8278a8ac5 Log node name when error attaching volume 2017-04-27 13:58:38 -04:00
Chao Xu 958903509c bazel 2017-04-27 09:41:53 -07:00
Chao Xu 3fa7b7824a easy changes 2017-04-27 09:41:53 -07:00
Kubernetes Submit Queue f4eed2477d Merge pull request #44491 from NickrenREN/volume-MountOptionAnnotation
Automatic merge from submit-queue (batch tested with PRs 44601, 44842, 44893, 44491, 44588)

Define const annotation variable once

We do not need to define the const annotation var twice in pkg/volume and pkg/volume/validation


**Release note**:
```release-note
NONE
```
2017-04-25 12:51:39 -07:00
Jan Safranek 9d0c47f1db Use storage.v1 instead of v1beta1
storage.v1beta1 was used to work around GKE which does not expose v1. Now that
GKE is updated, we can switch everything to v1.
2017-04-25 10:13:38 +02:00
NickrenREN e443277d58 Define const annotation variable once
Move annotation to package imported by both pkg/volume and pkg/volume/validation
2017-04-24 11:54:21 +08:00
Rodrigo Campos 2eb1583e4b Remove unused chmod/chown abstractions
These abstractions have not been used since I first hacked into
kubernetes, so let's just remove them and add them back if it's needed
later.
2017-04-23 20:25:23 -03:00
Humble Chirammal dddd4783a4 Replace variable name to be more go friendly.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-04-21 12:38:13 +05:30
Tomas Smetana 852c44ae59 Fix issue #34242: Attach/detach should recover from a crash
When the attach/detach controller crashes and a pod with attached PV is deleted
afterwards the controller will never detach the pod's attached volumes. To
prevent this the controller should try to recover the state from the nodes
status.
2017-04-20 13:04:50 +02:00
NickrenREN 5cafb9042b find and add active pods for dswp
loops through the list of active pods and ensures that each one exists in the desired state of the world cache
2017-04-18 11:21:37 +08:00
Kubernetes Submit Queue a1684fea80 Merge pull request #42085 from cblecker/gofmt-fix
Automatic merge from submit-queue (batch tested with PRs 40055, 42085, 44509, 44568, 43956)

Fix gofmt errors

**What this PR does / why we need it**:
There were some gofmt errors on master. Ran the following to fix:
```
hack/verify-gofmt.sh | grep ^diff | awk '{ print $2 }' | xargs gofmt -w -s
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-17 15:39:07 -07:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
Chao Xu d4850b6c2b move pkg/api/v1/helpers.go to subpackage 2017-04-14 14:25:11 -07:00
Kubernetes Submit Queue 55042b0ba9 Merge pull request #43673 from harryge00/refactor_test
Automatic merge from submit-queue (batch tested with PRs 40777, 43673)

remove an unnecassary variable assignment in glusterfs_test

**What this PR does / why we need it**:
`path` is exactly the same variable as `volumePath`, which is defined in line 122 . So no needs to assign it.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-04-14 13:34:01 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Kubernetes Submit Queue c6bfa43c58 Merge pull request #43878 from msau42/emptydir-rename
Automatic merge from submit-queue (batch tested with PRs 44362, 44421, 44468, 43878, 44480)

Delete EmptyDir volume directly instead of renaming the directory.

**What this PR does / why we need it**:
The volume operation executor can handle duplicate requests on the same volume now, so it is not necessary to rename the directory anymore.  This change can cause pod deletion to take longer for large emptydir volumes because now the pod waits for the volume to be deleted until it continues pod cleanup.  But this is actually required for local disk scheduling so that we don't schedule new pods that need emptydir volumes on the node if the previous emptydir has not be fully reclaimed yet.

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

**Special notes for your reviewer**:

**Release note**:

NONE

cc @kubernetes/sig-storage-pr-reviews
2017-04-14 01:46:05 -07:00
Kubernetes Submit Queue 5962b849f1 Merge pull request #43866 from kerneltime/patch-1
Automatic merge from submit-queue

Update owners to include kerneltime

**What this PR does / why we need it**: Update owners to include kerneltime to help with PRs
2017-04-10 13:40:35 -07:00
Kubernetes Submit Queue 97857e8390 Merge pull request #41687 from aliscott/fix_overwriting_err
Automatic merge from submit-queue

Fix original error being overwritten before returned
2017-04-09 23:16:32 -07:00
Kubernetes Submit Queue c8f90171e4 Merge pull request #39678 from resouer/extract-resource
Automatic merge from submit-queue (batch tested with PRs 41775, 39678, 42629, 42524, 43028)

Extract resources functions belongs to api/util

Address: extract kubelet resources functions belongs to `pkg/api/v1/resource_helpers.go`
2017-04-07 17:44:14 -07:00
Kubernetes Submit Queue 854441643f Merge pull request #38801 from nak3/nfs-mkdir
Automatic merge from submit-queue

Catch error when failed to make directory in NFS volume plugin

NFS: Catch error when failed to make directory

Currently, NFS volume plugin doesn't catch the error from
os.MkdirAll. That makes it difficult to debug why failed to make the
directory. This patch adds error catch to os.MkdirAll.
2017-04-07 16:48:46 -07:00
Kubernetes Submit Queue 6198c469cd Merge pull request #39476 from rootfs/azure-logging
Automatic merge from submit-queue

azure disk: add logging on disk attach

**What this PR does / why we need it**:
While we were debugging a failed azure disk attach, we were missing logging information to identify the root cause. This fix logs information at each stage of attach to help identify where problem is once it happens again.

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

**Special notes for your reviewer**:

**Release note**:

NONE
2017-04-07 16:03:44 -07:00
Kubernetes Submit Queue 98a4c6ba7f Merge pull request #43396 from rootfs/iscsi-chap
Automatic merge from submit-queue (batch tested with PRs 44119, 42538, 43802, 42336, 43396)

iSCSI CHAP support

**What this PR does / why we need it**:
To support CHAP authentication in a multi-tenant setup
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Support iSCSI CHAP authentication
```
2017-04-07 14:09:42 -07:00
Huamin Chen 8eb6d6cfa7 update iSCSI README with CHAP instruction
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-04-07 16:38:29 +00:00
Huamin Chen 9298217126 Add iSCSI CHAP authentication
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-04-07 16:38:29 +00:00
Kubernetes Submit Queue 176eb0e509 Merge pull request #43861 from rootfs/fc-doc
Automatic merge from submit-queue

relocate FC multipath readme to examples from pkg/volume

Signed-off-by: rootfs <hchen@redhat.com>



**What this PR does / why we need it**:
`pkg/volume/README.md` is not a good place for Fiber Channel specific doc. Move the block into FC README.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-05 08:50:27 -07:00
Kubernetes Submit Queue 5ef8148b5e Merge pull request #41929 from abrarshivani/fstype_in_storage_class
Automatic merge from submit-queue (batch tested with PRs 44008, 41929)

vSphere Cloud Provider: Fstype in storage class

This PR does following,

1. Adds fstype support in storage class for vSphere Cloud Provider.
2. Modify examples to include fstype in storage class.
3. Adds fstype support in storage class for Photon Controller Cloud Provider (@luomiao)

Internally reviewed [here](https://github.com/vmware/kubernetes/pull/88).

cc @pdhamdhere @tusharnt @kerneltime @BaluDontu @divyenpatel @luomiao
2017-04-04 16:50:20 -07:00
Miao Luo 72a27daa3c Adds fstype support in storage class for Photon Cloud Provider. 2017-04-04 12:17:52 -07:00
Abrar Shivani 50c9cca487 Add support for fstype in Storage Class for vSphere Cloud Provider 2017-04-03 16:13:00 -07:00
Kubernetes Submit Queue 538c5c74b1 Merge pull request #42973 from gnufied/fix-vsphere-selinux
Automatic merge from submit-queue

Fix vsphere selinux support

Managed flag must be true for SELinux relabelling to work
for vsphere.

Fixes #42972
2017-04-03 13:59:56 -07:00
Jan Safranek 3fbf9cb451 Fix deletion of Gluster volumes
GetClassForVolume should check pv.spec.storageClassName together
with beta annotation.
2017-04-03 15:33:56 +02:00
Kubernetes Submit Queue 46343f37dd Merge pull request #42038 from humblec/glusterfs-backup-vol1
Automatic merge from submit-queue (batch tested with PRs 42038, 42083)

 Add backup-volfile-servers to mount option. 

This feature ensures the `backup servers` in the trusted pool is contacted if there is a failure in the connected server.
Mount option becomes:
mount -t glusterfs -o log-level=ERROR,log-file=/var/lib/kubelet/plugins/kubernetes.io/glusterfs/glustermount/glusterpod-glusterfs.log,backup-volfile-servers=192.168.100.0:192.168.200.0:192.168.43.149 ..

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-04-03 04:07:19 -07:00
Harry Zhang efb10b1821 Move extract resources to its pkg
Move ExtractContainerResourceValue
2017-04-03 13:06:48 +08:00
Kubernetes Submit Queue b625085230 Merge pull request #42325 from tsmetana/remove-unused-method-from-og
Automatic merge from submit-queue

Remove unused method from operation_generator

This is only a removal of the GerifyVolumeIsSafeToDetach [sic] method from operation_executor. The method is not called from anywhere, moreover there is a private method named verifyVolumeIsSafeToDetach (which is being used). This looks like a cut&paste mistake that deserves to be cleaned.
```release-note
NONE
```
2017-03-31 10:56:40 -07:00
Kubernetes Submit Queue 7543bac563 Merge pull request #41952 from justinsb/curate_volumes_aws_ebs
Automatic merge from submit-queue

Curate owners for pkg/volume/aws_ebs

The previous list was algorithmically generated; applying some curation.

```release-note
NONE
```
2017-03-30 16:57:30 -07:00
Michelle Au d223c4be37 Delete EmptyDir volume directly instead of renaming the directory.
The volume operation executor can handle duplicate requests on the same
volume now.
2017-03-30 15:07:29 -07:00
Ritesh H Shukla 1052432f4a Update owners to include kerneltime 2017-03-30 11:01:27 -07:00
rootfs cb6a7c946d relocate FC multipath readme to examples from pkg/volume
Signed-off-by: rootfs <hchen@redhat.com>
2017-03-30 11:15:25 -04:00
Christoph Blecker 6681835b0c
Fix gofmt errors 2017-03-28 17:12:04 -07:00
wlan0 a68c783dc8 Use ProviderID to address nodes in the cloudprovider
The cloudprovider is being refactored out of kubernetes core. This is being
done by moving all the cloud-specific calls from kube-apiserver, kubelet and
kube-controller-manager into a separately maintained binary(by vendors) called
cloud-controller-manager. The Kubelet relies on the cloudprovider to detect information
about the node that it is running on. Some of the cloudproviders worked by
querying local information to obtain this information. In the new world of things,
local information cannot be relied on, since cloud-controller-manager will not
run on every node. Only one active instance of it will be run in the cluster.

Today, all calls to the cloudprovider are based on the nodename. Nodenames are
unqiue within the kubernetes cluster, but generally not unique within the cloud.
This model of addressing nodes by nodename will not work in the future because
local services cannot be queried to uniquely identify a node in the cloud. Therefore,
I propose that we perform all cloudprovider calls based on ProviderID. This ID is
a unique identifier for identifying a node on an external database (such as
the instanceID in aws cloud).
2017-03-27 23:13:13 -07:00
Kubernetes Submit Queue 3843108081 Merge pull request #42974 from vmware/VSANPolicyProvisioningForKubernetesOnKubernetesRepo
Automatic merge from submit-queue (batch tested with PRs 42835, 42974)

VSAN policy support for storage volume provisioning inside kubernetes

The vsphere users will have the ability to specify custom Virtual SAN Storage Capabilities during dynamic volume provisioning. You can now define storage requirements, such as performance and availability, in the form of storage capabilities during dynamic volume provisioning. The storage capability requirements are converted into a Virtual SAN policy which are then pushed down to the Virtual SAN layer when a storage volume (virtual disk) is being created. The virtual disk is distributed across the Virtual SAN datastore to meet the requirements.

For example, User creates a storage class with VSAN storage capabilities:

> kind: StorageClass
> apiVersion: storage.k8s.io/v1beta1
> metadata:
>   name: slow
> provisioner: kubernetes.io/vsphere-volume
> parameters:
>   hostFailuresToTolerate: "2"
>   diskStripes: "1"
>   cacheReservation: "20"
>   datastore: VSANDatastore

The vSphere Cloud provider provisions a virtual disk (VMDK) on VSAN with the policy configured to the disk.

When you know storage requirements of your application that is being deployed on a container, you can specify these storage capabilities when you create a storage class inside Kubernetes.

@pdhamdhere @tthole @abrarshivani @divyenpatel 

**Release note**:

```release-note
None
```
2017-03-27 17:00:23 -07:00
Balu Dontu dbe94833eb VSAN policy support for storage volume provisioning inside kubernetes 2017-03-27 12:43:01 -07:00
Alistair Scott fc62687b2c Fix original error being overwritten before returned 2017-03-27 13:29:59 +01:00
haoyuan cb7cb3486f remove an unnecassary variable assignment in glusterfs_test 2017-03-26 22:44:16 +08:00
Kubernetes Submit Queue 3fcb7cb377 Merge pull request #42170 from rootfs/azure-file-prv
Automatic merge from submit-queue (batch tested with PRs 43642, 43170, 41813, 42170, 41581)

Enable storage class support in Azure File volume

**What this PR does / why we need it**:
Support StorageClass in Azure file volume

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Support StorageClass in Azure file volume

```
2017-03-24 19:04:28 -07:00
Kubernetes Submit Queue 803369b9cc Merge pull request #42006 from screeley44/error-events3
Automatic merge from submit-queue (batch tested with PRs 42522, 42545, 42556, 42006, 42631)

Fixes MountVolume.NewMounter errors not displayed to users via describe events

Fixes #42004 

This fixes the problem of mount errors being eaten and not displayed to users again.  Specifically erros caught in MountVolume.NewMounter (like missing endpoints, etc...)

Current behavior for any mount failure:

```
Events:
  FirstSeen    LastSeen    Count    From            SubObjectPath    Type        Reason        Message
  ---------    --------    -----    ----            -------------    --------    ------        -------
  12m        12m        1    default-scheduler            Normal        Scheduled    Successfully assigned glusterfs-bb-pod1 to 127.0.0.1
  10m        1m        5    kubelet, 127.0.0.1            Warning        FailedMount    Unable to mount volumes for pod "glusterfs-bb-pod1_default(67c9dfa7-f9f5-11e6-aee2-5254003a59cf)": timeout expired waiting for volumes to attach/mount for pod "default"/"glusterfs-bb-pod1". list of unattached/unmounted volumes=[glusterfsvol]
  10m        1m        5    kubelet, 127.0.0.1            Warning        FailedSync    Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "default"/"glusterfs-bb-pod1". list of unattached/unmounted volumes=[glusterfsvol]
```

New Behavior:

For example on glusterfs - deliberately didn't create endpoints, now correct message is displayed:
```
Events:
  FirstSeen	LastSeen	Count	From			SubObjectPath	Type		Reason		Message
  ---------	--------	-----	----			-------------	--------	------		-------
  2m		2m		1	default-scheduler			Normal		Scheduled	Successfully assigned glusterfs-bb-pod1 to 127.0.0.1
  54s		54s		1	kubelet, 127.0.0.1			Warning		FailedMount	Unable to mount volumes for pod "glusterfs-bb-pod1_default(8edd2c25-fa09-11e6-92ae-5254003a59cf)": timeout expired waiting for volumes to attach/mount for pod "default"/"glusterfs-bb-pod1". With error timed out waiting for the condition. list of unattached/unmounted volumes=[glusterfsvol]
  54s		54s		1	kubelet, 127.0.0.1			Warning		FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "default"/"glusterfs-bb-pod1". With error timed out waiting for the condition. list of unattached/unmounted volumes=[glusterfsvol]
  2m		6s		814	kubelet, 127.0.0.1			Warning		FailedMount	MountVolume.NewMounter failed for volume "kubernetes.io/glusterfs/8edd2c25-fa09-11e6-92ae-5254003a59cf-glusterfsvol" (spec.Name: "glusterfsvol") pod "8edd2c25-fa09-11e6-92ae-5254003a59cf" (UID: "8edd2c25-fa09-11e6-92ae-5254003a59cf") with: endpoints "glusterfs-cluster" not found
```
2017-03-24 15:10:33 -07:00