Commit Graph

51 Commits (160ed26c20e8114579dd15e0a7f8bf51b916aa12)

Author SHA1 Message Date
Hemant Kumar d2b6e30143 Fix bug with volume getting marked as not in-use with pending op
Add test for verifying volume detach
2018-11-20 11:58:47 -05: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
knight 5ed6da9d9e
remove unnecessary time type
remove unnecessary time type, improve volume_manager.go
2018-10-11 21:06:46 +08:00
Fabio Bertinatto 376a94e039 Add more metrics for Volume Manager
Specifically:

* Number of volumes in ActualStateofWorld and DesiredStateofWorld
* Number of times ReconstructVolume Spec on kubelet failed
2018-08-13 17:36:36 +02:00
Seth Jennings 0413850d14 kubelet: volumemanager: poll immediate when waiting for volume attachment 2018-08-02 16:41:15 -05:00
Michelle Au 91c557f504 Use inner volume name instead of outer volume name for subpath directory 2018-03-21 17:13:38 -07:00
Kubernetes Submit Queue 907329e2eb
Merge pull request #55584 from zhangxiaoyu-zidif/move-check-pod-forward
Automatic merge from submit-queue (batch tested with PRs 60376, 55584, 60358, 54631, 60291). 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>.

move pod-check forward

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-28 03:37:25 -08:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Jan Safranek c232a0165a Fix DownwardAPI refresh race.
WaitForAttachAndMount should mark only pod in DesiredStateOfWorldPopulator (DSWP)
and DSWP should mark the volume to be remounted only when the new pod has been
processed.

Otherwise DSWP and reconciler race who gets the new pod first. If it's reconciler,
then DownwardAPI and Projected volumes of the pod are not refreshed with new
content and they are updated after the next periodic sync (60-90 seconds).
2018-02-14 16:54:25 +01:00
Cao Shufeng 4e7398b67b remove duplicated import 2018-01-17 09:34:59 +08:00
David Zhu fffd152e0d Fixed kubelet error message to be more descriptive. Added Attach success event for help in debugging. 2017-12-15 15:36:59 -08: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
zhangxiaoyu-zidif 6e50240ce1 move pod-check forward 2017-11-13 15:46:23 +08:00
Di Xu ef2403f80e send volumesInUse sorted in node status updates 2017-07-30 21:57:18 +08:00
Jacob Simpson 29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Kubernetes Submit Queue dd126ae19c Merge pull request #38431 from NickrenREN/newVolumeMgr-return
Automatic merge from submit-queue

Modify NewVolumeManager() function return value
2017-06-22 16:43:29 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
NickrenREN 312cd1bbe6 Modify NewVolumeManager() function return value
Since function NewVolumeManager() will always return vm and nil, we do not need the second return value, it will always be nil.
2017-06-17 23:33:12 +08:00
Di Xu bc93e7bcde remove redundant carriage return for readable 2017-05-27 14:49:16 +08:00
Kubernetes Submit Queue aacc9729f1 Merge pull request #44781 from wongma7/outervolumespec
Automatic merge from submit-queue (batch tested with PRs 45382, 45384, 44781, 45333, 45543)

Ensure desired state of world populator runs before volume reconstructor

If the kubelet's volumemanager reconstructor for actual state of world runs before the desired state of world has been populated, the pods in the actual state of world will have some incorrect volume information: namely outerVolumeSpecName, which if incorrect leads to part of the issue here https://github.com/kubernetes/kubernetes/issues/43515, because WaitForVolumeAttachAndMount searches the actual state of world with the correct outerVolumeSpecName and won't find it so reports 'timeout waiting....', etc. forever for existing pods. The comments acknowledge that this is a known issue

The all sources ready check doesn't work because the sources being ready doesn't necessarily mean the desired state of world populator added pods from the sources. So instead let's put the all sources ready check in the *populator*, and when the sources are ready, it will be able to populate the desired state of world and make "HasAddedPods()" return true. THEN, the reconstructor may run.

@jingxu97 PTAL, you wrote all of the reconstruction stuff

```release-note
NONE
```
2017-05-10 17:47:43 -07:00
Matthew Wong bbe82a2688 Ensure desired state of world populator runs before volume reconstructor 2017-05-09 18:25:59 -04:00
Jamie Hannaford 9440a68744 Use dedicated Unix User and Group ID types 2017-05-05 14:07:38 +02:00
Clayton Coleman 49209b3394
Make timeouts in the Kubelet slightly offset to aid debugging
Several of these loops overlap, and when they are the reason a failure
is happening it is difficult to sort them out. Slighly misalign these
loops to make their impact obvious.
2017-04-28 12:00:28 -04:00
NickrenREN a451daca0d cleanup: remove TODO(resolved) and var(unused) 2017-03-21 15:40:32 +08:00
David Ashpole 1d38818326 Revert "Merge pull request #41202 from dashpole/revert-41095-deletion_pod_lifecycle"
This reverts commit ff87d13b2c, reversing
changes made to 46becf2c81.
2017-02-15 08:44:03 -08:00
David Ashpole b224f83c37 Revert "[Kubelet] Delay deletion of pod from the API server until volumes are deleted" 2017-02-09 08:45:18 -08:00
David Ashpole 67cb2704c5 delete volumes before pod deletion 2017-02-08 07:34:49 -08:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
Kubernetes Submit Queue 564016bd9f Merge pull request #38443 from NickrenREN/vol-mgr-getVolumeInUse
Automatic merge from submit-queue (batch tested with PRs 38443, 40145, 40701, 40682)

fix GetVolumeInUse() function

Since we just want to get volume name info, each volume name just need to added once.  desiredStateOfWorld.GetVolumesToMount() will return volume and pod binding info,
if one volume is mounted to several pods, the volume name will be return several times. That is not what we want in this function.
We can add a new function to only get the volume name info  or judge whether the volume name is added to the desiredVolumesMap array.
2017-01-30 20:59:38 -08:00
Seth Jennings e2750a305a reclaim terminated pod volumes 2017-01-20 11:08:35 -06:00
NickrenREN a12dea14e0 fix redundant alias clientset 2017-01-12 10:21:05 +08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
NickrenREN 3bb75064fb fix GetVolumeInUse() function
Since we just want to get volume name info, each volume name just need to added once. desiredStateOfWorld.GetVolumesToMount() will return volume and pod binding info,
if one volume is mounted to several pods, the volume name will be return several times. That is not what we want in this function.
We can add a new function to only get the volume name info or judge whether the volume name is added to the desiredVolumesMap array.
2017-01-03 14:04:15 +08:00
rkouj d5f7610b82 Refactor operation_executor to make it unit testable 2016-12-27 15:12:16 -08:00
Kubernetes Submit Queue 1abb8498aa Merge pull request #36888 from linki/patch-1
Automatic merge from submit-queue (batch tested with PRs 36888, 38180, 38855, 38590)

wrong pod reference in error message for volume attach timeout

**What this PR does / why we need it**:
when a disk mount times out you get the following error:

```
Warning		FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "nginx"/"default". list of unattached/unmounted volumes=[data]
```

where the pod is referenced by "podname"/"namespace", but should be "namespace"/"podname".

**Which issue this PR fixes**
no issue number

**Special notes for your reviewer**:
untested :(
2016-12-20 20:33:52 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Martin Linkhorst 001e75ba8c
fix(kubelet): reference pod by namespace/name 2016-12-01 11:22:55 +01:00
Kubernetes Submit Queue ef079a316e Merge pull request #37535 from yarntime/fix_typo_in_volume_manager
Automatic merge from submit-queue

fix typo in volume_manager

fix typo in volume_manager.
2016-11-30 01:26:36 -08:00
yarntime 8447b9f940 fix typo in volumeme_manager 2016-11-28 11:46:22 +08:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
Rajat Ramesh Koujalagi d81e216fc6 Better messaging for missing volume components on host to perform mount 2016-11-09 15:16:11 -08:00
Jing Xu b02481708a Fix volume states out of sync problem after kubelet restarts
When kubelet restarts, all the information about the volumes will be
gone from actual/desired states. When update node status with mounted
volumes, the volume list might be empty although there are still volumes
are mounted and in turn causing master to detach those volumes since
they are not in the mounted volumes list. This fix is to make sure only
update mounted volumes list after reconciler starts sync states process.
This sync state process will scan the existing volume directories and
reconstruct actual states if they are missing.

This PR also fixes the problem during orphaned pods' directories. In
case of the pod directory is unmounted but has not yet deleted (e.g.,
interrupted with kubelet restarts), clean up routine will delete the
directory so that the pod directoriy could be cleaned up (it is safe to
delete directory since it is no longer mounted)

The third issue this PR fixes is that during reconstruct volume in
actual state, mounter could not be nil since it is required for creating
container.VolumeMap. If it is nil, it might cause nil pointer exception
in kubelet.

Details are in proposal PR #33203
2016-10-25 12:29:12 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Scott Creeley 782d7d9815 Add Events for operation_executor to show status of mounts, failed or successful 2016-08-17 09:53:47 -04:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
Matthew Wong cbdd121d2d Remove pod mutation for PVs with supplemental GIDs 2016-07-22 17:41:44 -04:00
Cindy Wang e13c678e3b Make volume unmount more robust using exclusive mount w/ O_EXCL 2016-07-18 16:20:08 -07:00
Daniel Smith 360f2eb927 Revert "Remove pod mutation for PVs with supplemental GIDs" 2016-07-14 17:47:46 -07:00
Matthew Wong 58f973d8e7 Remove pod mutation for PVs with supplemental GIDs 2016-07-13 13:51:17 -04:00