Commit Graph

90 Commits (37f0138278809ec3245de8e7b861b7bf9d323b45)

Author SHA1 Message Date
Kubernetes Prow Robot ca1336957e
Merge pull request #73404 from tsmetana/fix-kubelet-volume-test
Kubelet: Fix volumemanager test race
2019-02-04 06:21:11 -08:00
danielqsj cf1fb8a1cd fix format issue 2019-01-31 22:01:13 +08:00
Daniel (Shijun) Qian e72b32558c
Merge branch 'master' into keymutex 2019-01-31 20:50:57 +08:00
danielqsj 657a1a1a34 change import alias of utils/strings 2019-01-30 10:44:09 +08:00
danielqsj 093328e57f migrate to k8s.io/utils/strings 2019-01-30 10:24:00 +08:00
Andrew Kim 84191eb99b replace pkg/util/file with k8s.io/utils/path 2019-01-29 15:20:13 -05:00
Tomas Smetana 45464f0349 Kubelet: Fix volumemanager test race 2019-01-28 15:05:26 +01:00
gaorong 545aca3d18 fix some typos 2019-01-08 12:46:05 +08:00
Kubernetes Prow Robot cd02e752bf
Merge pull request #71509 from cofyc/fix71438
Fix device mountable volume names in DSW
2018-12-19 00:51:52 -08:00
Yecheng Fu 5ada29ac16 Rename GetUniqueVolumeNameForNonAttachableVolume to GetUniqueVolumeNameFromSpecWithPod 2018-12-01 12:25:32 +08:00
Jordan Liggitt 2498ca7606 drop VerifyFeatureGatesUnchanged 2018-11-21 11:51:33 -05:00
k8s-ci-robot ec2e767e59
Merge pull request #71167 from msau42/block-beta
Promote raw block volume support to beta
2018-11-16 20:28:03 -08:00
k8s-ci-robot f877b2257a
Merge pull request #71074 from jsafrane/volume-manager-races
Fix race between MountVolume and UnmountDevice
2018-11-16 18:22:14 -08:00
Matthew Wong dd517c9ff2 Update all tests to account for BlockVolume enabled by default 2018-11-16 13:38:59 -05:00
Jordan Liggitt 248d661327 Add tests to ensure storage feature gate changes don't escape packages 2018-11-16 10:52:53 -05:00
Michelle Au fd64c08240 Fix storage feature gate test setting 2018-11-16 10:49:40 -05:00
Jan Safranek 5283537401 Fixed clearing of devicePath after UnmountDevice
UnmountDevice must not clear devicepath, because such devicePath
may come from node.status (e.g. on AWS) and subsequent MountDevice
operation (that may be already enqueued) needs it.
2018-11-16 13:24:42 +01:00
Davanum Srinivas 954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Vladimir Vivien 3569287993 Refactor of GenerateMapDeviceFunc to delegate Map call to volume plugin. 2018-06-03 17:25:37 -04:00
Hemant Kumar 179e5d7006 Rename online resizine feature gate 2018-05-31 17:28:12 -04:00
mlmhl ca12c73323 implement kubelet side online file system resize for volume 2018-05-31 17:10:24 +08:00
Mike Danese f427531179 boring 2018-04-18 09:55:57 -07:00
Jing Xu 264e4ed38c Add volume spec to mountedPod in actual state of world
Add volume spec into mountedPod data struct in the actual state of the
world.
2018-03-30 12:07:52 -07:00
Kubernetes Submit Queue 9fe565aba5
Merge pull request #61071 from jingxu97/Mar/podvolumerace
Automatic merge from submit-queue (batch tested with PRs 61203, 61071). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix issue with race condition during pod deletion

This PR fixes two issues
1. When desired_state_populator removes podvolume state, it should check
whether the actual state already has the volume before deleting it to
make sure actual state has a chance to add the volume into the state
2. When checking podVolume still exists, it not only checks the actual
state, but also the volume disk directory because actual state might not
reflect the real world when kubelet starts.

fixes issue #60645
2018-03-15 17:23:04 -07:00
Jing Xu 9bd006de40 Fix issue with race condition during pod deletion
This PR fixes two issues
1. When desired_state_populator removes podvolume state, it should check
whether the actual state already has the volume before deleting it to
make sure actual state has a chance to add the volume into the state
2. When checking podVolume still exists, it not only checks the actual
state, but also the volume disk directory because actual state might not
reflect the real world when kubelet starts.
2018-03-15 15:35:37 -07:00
Kubernetes Submit Queue 78e58025d0
Merge pull request #60888 from jsafrane/fix-asw-reconstruct-inuse
Automatic merge from submit-queue (batch tested with PRs 60888, 61225). 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>.

Mark reconstructed volumes as reported InUse

When a newly started kubelet finds a directory where a volume should be,
it can be fairly confident that the volume was mounted by previous kubelet
and therefore the volume must have been in node.status.volumesInUse.

Therefore we can mark reconstructed volumes as already reported so
subsequent reconcile() can fix the directory and put the mounted volume
into actual state of world.

Fixes: #60645

**Release note**:

```release-note
NONE
```

/sig storage
/sig node
cc: @gnufied @jingxu97
2018-03-15 15:01:58 -07:00
Jan Safranek c51e843f3c Mark reconstructed volumes as reported InUse
When a newly started kubelet finds a directory where a volume should be,
it can be fairly confident that the volume was mounted by previous kubelet
and therefore the volume must have been in node.status.volumesInUse.

Therefore we can mark reconstructed volumes as already reported so
subsequent reconcile() can fix the directory and put the mounted volume
into actual state of world.
2018-03-07 17:39:24 +01:00
Jan Safranek 5110db5087 Lock subPath volumes
Users must not be allowed to step outside the volume with subPath.
Therefore the final subPath directory must be "locked" somehow
and checked if it's inside volume.

On Windows, we lock the directories. On Linux, we bind-mount the final
subPath into /var/lib/kubelet/pods/<uid>/volume-subpaths/<container name>/<subPathName>,
it can't be changed to symlink user once it's bind-mounted.
2018-03-05 09:14:44 +01:00
Kubernetes Submit Queue 47b1d72d47
Merge pull request #60505 from jsafrane/fix-logf
Automatic merge from submit-queue (batch tested with PRs 60342, 60505, 59218, 52900, 60486). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixed log calls in VolumeManager

Use glog.Infof() instead of glog.Info()

**Release note**:

```release-note
NONE
```


/sig storage
/sig node
2018-02-28 06:07:24 -08:00
Kubernetes Submit Queue b1ef631e59
Merge pull request #57408 from zouyee/kubelet-1
Automatic merge from submit-queue (batch tested with PRs 60236, 60332, 57375, 60451, 57408). 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>.

improve code comment

**What this PR does / why we need it**:
improve code comment
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```NONE

```
2018-02-28 01:12:36 -08:00
Jan Safranek e8a85fc0d3 Fixed log calls in VolumeManager
Use glog.Infof() instead of glog.Info()
2018-02-27 15:48:16 +01:00
wackxu b3ba80b223 update bazel 2018-02-27 20:23:36 +08:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Kubernetes Submit Queue 2966cdaa12
Merge pull request #58559 from mlmhl/volumemanager_cleanup
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>.

use GetUniqueVolumeNameFromSpec instead of implementing it manually for kubelet volume manager

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

`volumeName` is only used for attachable plugin, so we should resolve it inside the `if` statement. Besides, we can use the already exist `GetUniqueVolumeNameFromSpec` mthod instead of invoking `GetVolumeName` and `GetUniqueVolumeName` manually.

**Release note**:

```release-note
NONE
```

/sig storage
/kind cleanup
2018-02-26 19:34:22 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Jan Safranek e260096392 Rework volume manager log levels
- all normal logs to go to level 4
- too frequent / duplicate logs go to level 5 (e.g. when something else logged similar message not too far away).
2018-02-15 16:33:17 +01:00
Kubernetes Submit Queue 4afdc33c57
Merge pull request #56454 from mtanino/volumehandler-refactor
Automatic merge from submit-queue (batch tested with PRs 59767, 56454, 59237, 59730, 55479). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Block Volume: Refactor volumehandler in operationexecutor

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

Based on discussion with @saad-ali at #51494, we need refactor volumehandler in operationexecutor
for Block Volume feature. We don't need to add volumehandler as separated object.

```
VolumeHandler does not need to be a separate object that is constructed inline like this. 
You can create a new operation, e.g. UnmountOperation to which you pass the spec,
and it can return either a UnmountVolume or UnmapVolume.
```

**Which issue(s) this PR fixes** : no related issue.

**Special notes for your reviewer**:

@saad-ali @msau42 

**Release note**:

```release-note
NONE
```
2018-02-12 15:44:33 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
mtanino 973583e781 Refactor volumehandler in operationexecutor 2018-02-09 15:39:55 -05:00
Jing Xu 9588d2098a Redesign and implement volume reconstruction work
This PR is the first part of redesign of volume reconstruction work. The
changes include
1. Remove dependency on volume spec stored in actual state for volume
cleanup process (UnmountVolume and UnmountDevice)

Modify AttachedVolume struct to add DeviceMountPath so that volume
unmount operation can use this information instead of constructing from
volume spec

2. Modify reconciler's volume reconstruction process (syncState). Currently workflow
is when kubelet restarts, syncState() is only called once before
reconciler starts its loop.
a. If volume plugin supports reconstruction, it will use the
reconstructed volume spec information to update actual state as before.
b. If volume plugin cannot support reconstruction, it will use the
scanned mount path information to clean up the mounts.

In this PR, all the plugins still support reconstruction (except
glusterfs), so reconstruction of some plugins will still have issues.
The next PR will modify those plugins that cannot support reconstruction
well.

This PR addresses issue #52683, #54108 (This PR includes the changes to
update devicePath after local attach finishes)
2018-02-05 13:14:09 -08:00
mlmhl 56189cf893 use GetUniqueVolumeNameFromSpec instead of implementing it manually 2018-01-19 17:46:04 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
zouyee 88e4f1be4b improve code comment 2017-12-19 23:08:35 +08:00
Mitsuhiro Tanino 9329dd5b91 generated code for Volumemanager change 2017-11-20 14:10:34 -05:00
mtanino 8903e8cd85 BlockVolumesSupport: CRI, VolumeManager and OperationExecutor changes
This patch contains following changes.
- container runtime changes for adding block devices
- volumemanager changes
- operationexecutor changes
2017-11-20 14:10:26 -05:00
Kevin 4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Davanum Srinivas 2a2b0cbffa Remove cmd/kubelet dependency from pkg/kubelet/volumemanager 2017-10-13 07:06:21 -04:00
Chakravarthy Nelluri b8d1c3bcd8 Fix volume remount on reboot 2017-09-18 16:28:21 -04:00