k3s/pkg/volume
Kubernetes Submit Queue 0647cff9ff
Merge pull request #64386 from andyzhangx/azuredisk-sizegrow
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add azuredisk PV size grow feature

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

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

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

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

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

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

**Release note**:

```
Add azuredisk size grow feature
```

/sig azure
/assign @feiskyer @karataliu @gnufied 
cc @khenidak
2018-06-05 00:02:34 -07:00
..
aws_ebs Implement volume plugin changes for volume limits 2018-06-01 19:17:30 -04:00
azure_dd Merge pull request #64386 from andyzhangx/azuredisk-sizegrow 2018-06-05 00:02:34 -07:00
azure_file Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
cephfs fix cephfs fuse mount bug when use is not admin 2018-03-28 09:20:32 +08:00
cinder API updates for Cinder Volumes to support for user specified Secrets in the future 2018-06-02 22:16:50 -04:00
configmap Fix nested volume mounts for read-only API data volumes 2018-02-27 07:41:39 -07:00
csi New labelmanager package 2018-06-04 16:54:25 -04:00
downwardapi Use filepath.Clean() instead of path.Clean() 2018-04-17 10:44:30 +08:00
empty_dir Use consts defined in api instead of defining another ones. 2018-02-28 00:40:58 +08:00
fc Return error in mount_unsupported for unsupported platforms 2018-03-29 14:17:07 -07:00
flexvolume Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
flocker Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
gce_pd Implement volume plugin changes for volume limits 2018-06-01 19:17:30 -04:00
git_repo GitRepo command hardening 2018-06-01 12:42:53 -07:00
glusterfs Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
host_path Merge pull request #64447 from jsafrane/block-provision 2018-06-01 12:12:23 -07:00
iscsi Fix iSCSI and RBD UnmountDevice with mount containers. 2018-05-09 09:52:37 +02:00
local Merge pull request #62903 from cofyc/fixfsgroupcheckinlocal 2018-05-02 20:13:11 -07:00
nfs pkg/volume/nfs/nfs.go: correct error messages. 2018-03-05 12:12:51 +01:00
photon_pd Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
portworx Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
projected Fix nested volume mounts for read-only API data volumes 2018-02-27 07:41:39 -07:00
quobyte Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
rbd Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
scaleio Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
secret Fix nested volume mounts for read-only API data volumes 2018-02-27 07:41:39 -07:00
storageos Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
testing implement kubelet side online file system resize for volume 2018-05-31 17:10:24 +08:00
util Merge pull request #62266 from feiskyer/win-log-stats 2018-06-04 18:44:10 -07:00
validation Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
vsphere_volume Add block volume support to internal provisioners. 2018-05-29 12:02:40 +02:00
BUILD Report events to apiserver in local volume plugin. 2018-04-18 11:19:36 +08:00
OWNERS
doc.go
metrics_cached.go
metrics_du.go Rename Du() to DiskUsage() for more expressive 2018-05-22 10:52:06 +08:00
metrics_du_test.go
metrics_errors.go
metrics_nil.go
metrics_nil_test.go
metrics_statfs.go update import 2018-02-27 20:23:35 +08:00
metrics_statfs_test.go
plugins.go Implement volume plugin changes for volume limits 2018-06-01 19:17:30 -04:00
plugins_test.go correct the expected value in plugintest 2018-02-25 15:14:55 +08:00
volume.go Add GetSELinuxSupport to mounter. 2018-05-17 13:36:37 +02:00
volume_linux.go Add more volume types in e2e and fix part of them. 2018-05-02 10:31:42 +08:00
volume_unsupported.go Add more volume types in e2e and fix part of them. 2018-05-02 10:31:42 +08:00