Commit Graph

427 Commits

Author SHA1 Message Date
Patrick Ohly
a8c930ef46 generic ephemeral volume: graduation to GA
The feature gate gets locked to "true", with the goal to remove it in two
releases.

All code now can assume that the feature is enabled. Tests for "feature
disabled" are no longer needed and get removed.

Some code wasn't using the new helper functions yet. That gets changed while
touching those lines.
2021-10-11 20:54:20 +02:00
Kubernetes Prow Robot
fa1d682bd7
Merge pull request #103353 from njuptlzf/fix_datarace
fix data race for Test_Run_Positive_VolumeMountControllerAttachEnabledRace
2021-08-04 19:00:23 -07:00
Kubernetes Prow Robot
a674fb496c
Merge pull request #103261 from markusthoemmes/kubelet-volume-logs
Add pod context to volume lifecycle logs
2021-08-04 19:00:15 -07:00
Markus Thömmes
c820824711 Add pod context to volume lifecycle logs 2021-08-03 13:12:22 +02:00
njuptlzf
1555877cc5 fix data race for Test_Run_Positive_VolumeMountControllerAttachEnabledRace 2021-07-26 17:17:16 +08:00
Kubernetes Prow Robot
6aa160f3ba
Merge pull request #103181 from 249043822/bugfix-volumemanager
Add sync reconstructed volume from desired state of world for volumemanager
2021-07-19 15:04:52 -07:00
Kubernetes Prow Robot
2da4d48e6d
Merge pull request #100567 from jingxu97/mar/mark
Mark volume mount as uncertain in case of volume expansion fails
2021-07-13 22:20:26 -07:00
KeZhang
65618bfd69 Add sync reconstructed volume from desired state of world for volumemanager 2021-07-13 12:51:37 +08:00
Jing Xu
0fa01c371c Mark volume mount as uncertain in case of volume expansion fails
should mark volume mount in actual state even if volume expansion fails so that
reconciler can tear down the volume when needed. To avoid pods start
using it, mark volume as uncertain instead of mounted.

Will add unit test after the logic is reviewed.

Change-Id: I5aebfa11ec93235a87af8f17bea7f7b1570b603d
2021-07-08 16:00:34 -07:00
Clayton Coleman
3eadd1a9ea
Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
Chris Henzie
2b98f8edc7 Enforce ReadWriteOncePod access mode during mount 2021-06-28 21:25:37 -07:00
Jan Safranek
d3dfe124da Update mounter interface in volume manager
Update mounter interface in volume manager's ActualStateOfWorld every time.
Otherwise kubelet uses the first mounter it gets, which may not have the
latest information.

This fixes set up of CSI volumes, which store information about SELinux
support in their `mounter` interface implementation. With each MountVolume()
retry, a new mounter is instantiated and only the final mounter that succeeds
has the right info if the volume supports SELinux or not and can later
return the right attributes on GetAttributes() call.
2021-06-24 14:11:31 +02:00
Jan Safranek
d5da73032f Add unit test for DSWP with uncertain volume
desiredStateOfWorldPopulator.findAndRemoveDeletedPods() should remove
volumes from DSW when a pod is deleted on the API server and the volume is
uncertain in ASW.
2021-06-16 18:41:44 +02:00
Jan Safranek
f795b02f4f Refactor dswp unit tests
Change existing desiredStateOfWorldPopulator.findAndAddNewPods tests to use
a common initialization function.
2021-06-16 18:41:43 +02:00
Jan Safranek
2fcb5e9cf7 Add PodRemovedFromVolume
To know when a volume has been fully unmounted (incl. uncertain mounts).
2021-06-16 18:41:41 +02:00
Jan Safranek
ca934b8f5c Add GetPossiblyMountedVolumesForPod to let kubelet know all volumes were unmounted
podVolumesExist() should consider also uncertain volumes (where kubelet
does not know if a volume was fully unmounted) when checking for pod's
volumes. Added GetPossiblyMountedVolumesForPod for that.

Adding uncertain mounts to GetMountedVolumesForPod would potentially break
other callers (e.g. `verifyVolumesMountedFunc`).
2021-06-16 18:39:12 +02:00
sanwishe
9e257ec194 Optimization logging format for pkg/kubelet
Signed-off-by: sanwishe <jiang.mingzhi35@zte.com.cn>
2021-05-25 08:52:08 +08:00
andyzhangx
e10d3948f5 fix: azure file namespace issue in csi translation
fix build failure

fix comments
2021-04-20 07:23:09 +00:00
Kubernetes Prow Robot
bacce2eca6
Merge pull request #100215 from pacoxu/fix/data-race
fix a data race in volume reconciler ut #99815
2021-03-24 20:01:29 -07:00
Chris Henzie
f756bd5189 Fix nil ptr dereference in log line 2021-03-22 16:06:51 -07:00
Kubernetes Prow Robot
b5c6434f6b
Merge pull request #98850 from yangjunmyfm192085/run-test14
Structured Logging migration: modify volume and container part logs o…
2021-03-17 11:45:19 -07:00
JunYang
01a4e4face Structured Logging migration: modify volume and container part logs of kubelet.
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-03-17 08:59:03 +08:00
pacoxu
0bb911f90a fix two data race in volume reconciler ut 99815 2021-03-14 13:20:34 +08:00
Kubernetes Prow Robot
410d092d8a
Merge pull request #99643 from pohly/generic-ephemeral-volume-beta
generic ephemeral volume beta
2021-03-09 17:39:26 -08:00
Kubernetes Prow Robot
c3bed939ff
Merge pull request #97659 from chenyw1990/fixedPodTerminatingWithSubpathNotEmpty
don't delete pod from desiredStateOfWorld when pod's sandbox is running
2021-03-09 16:07:26 -08:00
Kubernetes Prow Robot
a56fa34d6b
Merge pull request #99942 from jsafrane/refactor-migration-featuregates
Refactor CSI migration plugin manager to get featureGates as a parameter
2021-03-09 04:27:46 -08:00
Patrick Ohly
555d4a12bf generic ephemeral volumes: drop ReadOnly field
As discussed during the alpha review, the ReadOnly field is not really
needed because volume mounts can also be read-only. It's a historical
oddity that can be avoided for generic ephemeral volumes as part
of the promotion to beta.
2021-03-09 08:22:48 +01:00
Kubernetes Prow Robot
f34b63acee
Merge pull request #99620 from jingxu97/mar/owner
Add jingxu97 to volumemanager owner
2021-03-08 22:53:31 -08:00
Jan Safranek
219cbc818a Refactor CSI migration plugin manager to get featureGates as a parameter
This allows caller to provide fake ones for testing of various corner cases
(migration on A/D controller disabled while enabled on kubelet).
2021-03-08 13:50:01 +01:00
Krzysztof Gibuła
e46b280f96 Replace klog with with testing.T logging in pkg/kubelet tests 2021-03-07 23:10:02 +01:00
chenyw1990
289990db65 don't delete pod from desired state of world when pod's sandbox is running, because volume is the resource of pod. 2021-03-05 11:33:04 +08:00
Patrick Ohly
68370c8aa6 kubelet: more tests for generic ephemeral volumes
This simulates various error scenarios (PVC not created for pod,
feature disabled) and switching between feature disabled and enabled.
2021-03-03 10:13:05 +01:00
Patrick Ohly
edb9a8584c kubelet: better error when generic ephemeral volume is disabled
Silently ignoring the unsupported volume type leads to:

  Warning  FailedMount       8s    kubelet            Unable to attach or mount volumes: unmounted volumes=[my-csi-volume default-token-bsnbz], unattached volumes=[my-csi-volume default-token-bsnbz]: failed to get Plugin from volumeSpec for volume "my-csi-volume" err=no volume plugin matched

The new message is easier to understand:
  Warning  FailedMount       6s (x5 over 49s)  kubelet            Unable to attach or mount volumes: unmounted volumes=[my-csi-volume], unattached volumes=[my-csi-volume default-token-rwlpp]: volume my-csi-volume is a generic ephemeral volume, but that feature is disabled in kubelet
2021-03-03 10:13:05 +01:00
Jing Xu
763c951238 Add jingxu97 to volumemanager owner
add myself as volumemanager owner

Change-Id: I6e6746d6efdfd3374aef6967c1c9b4cd4637cebc
2021-03-01 20:47:40 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Hemant Kumar
6f9a3374b1 Allow uncertain mount tests to run parallely 2021-02-18 09:37:43 -05:00
Chris Henzie
9d8f994d4e Separate test Kubelet and AttachDetach VolumeHost types
fakeVolumeHost previously implemented both the KubeletVolumeHost and
AttachDetachVolumeHost interfaces. This design makes it difficult to test the
CSIAttacher since it behaves differently depending on what type of
VolumeHost is supplied.
2020-12-17 15:17:04 -08:00
Shihang Zhang
d2859cd89b plumb service account token down to csi driver 2020-11-12 09:26:43 -08:00
Kubernetes Prow Robot
a9e9cabbea
Merge pull request #94676 from JornShen/fix_Test_Run_Positive_VolumeMountControllerAttachEnabledRace_data_trace
Fix flaky unit test Test_Run_Positive_VolumeMountControllerAttachEnabledRace data race
2020-10-27 23:31:56 -07:00
jornshen
b6b462beba Fix flaky unit test Test_Run_Positive_VolumeMountControllerAttachEnabledRace data race
ref: https://github.com/kubernetes/kubernetes/issues/94568
2020-10-19 16:29:15 +08:00
Kubernetes Prow Robot
6ac2930ef0
Merge pull request #94574 from auxten/pkg-kubelet-staticchecks
Fix pkg/kubelet static checks
2020-09-21 21:22:47 -07:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07:00
auxten
a9c1acc044 Fix staticchecks ST1005,S1002,S1008,S1039 in pkg/kubelet 2020-09-07 10:53:43 +08:00
Jiawei Wang
a6d8e6c5c2 Detect change of volume attachability in the middle of attaching
- Add Unit tests for both volumemanager and attach/detach controller
- Add E2E test
2020-08-24 17:15:11 -07:00
Hemant Kumar
b8c0435bc2 Handle volume-in-use error 2020-07-11 09:02:58 -04:00
Patrick Ohly
ff3e5e06a7 GenericEphemeralVolume: initial implementation
The implementation consists of
- identifying all places where VolumeSource.PersistentVolumeClaim has
  a special meaning and then ensuring that the same code path is taken
  for an ephemeral volume, with the ownership check
- adding a controller that produces the PVCs for each embedded
  VolumeSource.EphemeralVolume
- relaxing the PVC protection controller such that it removes
  the finalizer already before the pod is deleted (only
  if the GenericEphemeralVolume feature is enabled): this is
  needed to break a cycle where foreground deletion of the pod
  blocks on removing the PVC, which waits for deletion of the pod

The controller was derived from the endpointslices controller.
2020-07-09 23:29:24 +02:00
Kubernetes Prow Robot
1e3eeba9fa
Merge pull request #91577 from knabben/kubelet-bootstrap
kubelet: remove the --bootstrap-checkpoint-path feature
2020-07-09 00:03:41 -07:00
Amim Knabben
0ed41c3f10 Deprecating --bootstrap-checkpoint-path flag 2020-06-09 15:27:01 -04:00
liuxu
2367569f13 fix if don't set ephemeral-storage limit emptyDir's sizeLimit doesn't work 2020-05-23 13:36:56 +08:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Kubernetes Prow Robot
ef672c1c2d
Merge pull request #88678 from verult/slow-rxm-attach
Parallelize attach operations across different nodes for volumes that allow multi-attach
2020-03-06 13:17:21 -08:00
Cheng Xing
ef3d66b98b Parallelize attach operations across different nodes for volumes that allow multi-attach 2020-03-05 22:22:05 -08:00
Ted Yu
723761aa88 Don't try to create VolumeSpec immediately after underlying PVC is being deleted
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-03-05 16:45:50 -08:00
Kubernetes Prow Robot
9d0cbb7503
Merge pull request #88673 from jsafrane/block-feature-ga
Promote block volumes to GA
2020-03-03 12:17:12 -08:00
Jan Safranek
3af671011a Generated API 2020-03-02 22:21:42 +01:00
Jan Safranek
8536787133 Add unit tests 2020-03-02 12:54:02 +01:00
Jan Safranek
2c1b743766 Promote block volume features to GA 2020-02-28 20:48:38 +01:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Jordan Liggitt
cd1059e3c4 Revert "Merge pull request #87258 from verult/slow-rxm-attach"
This reverts commit 15c3f1b119, reversing
changes made to 52d7614a8c.
2020-01-29 14:58:32 -05:00
Cheng Xing
c6a03fa5be Parallelize attach operations across different nodes for volumes that allow multi-attach 2020-01-27 15:02:25 -08:00
Hemant Kumar
ca532c6fb2 Ensure that error is returned on NodePublish 2019-12-11 22:10:09 -05:00
Hemant Kumar
309c6f863a Handle the case of remounts correctly 2019-12-02 12:09:38 -05:00
Hemant Kumar
5feea93163 Rename MarkVolumeMountedOpts to MarkVolumeOpts
Also remove VolumeNotMounted state
2019-12-02 12:09:38 -05:00
Hemant Kumar
cdbd3ba5c2 Change interface of SetUp function 2019-12-02 12:09:38 -05:00
Hemant Kumar
0c52b6606e Refactor NodeStage function
Timeout operations should result in
Fix unit tests for uncertainDeviceGlobalMounts
2019-12-02 12:09:38 -05:00
Hemant Kumar
50dbcb3e00 Make sure PodExistsInVolume does not uses uncertain volumes 2019-12-02 12:01:40 -05:00
Hemant Kumar
34a6007dfe Add code to mark volume as uncertain
Update bazel files
Add tests for volume mounts in uncertain state
2019-12-02 12:01:40 -05:00
Hemant Kumar
a795f3de88 Add code for introducing uncertain state of mounts
Add a comment about volumestate
2019-12-02 11:57:40 -05:00
David Zhu
21f7060c8f Plumb test state through to fake volume host creation for error handling 2019-11-18 14:45:01 -08:00
Travis Rhoden
0c5c3d8bb9
Remove pkg/util/mount (moved out of tree)
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.
2019-11-15 08:29:12 -07:00
Kubernetes Prow Robot
372ebd24f5
Merge pull request #83098 from ddebroy/disable-intree
CSI Migration phase 2: disable probing of in-tree plugins
2019-11-14 20:51:42 -08:00
Deep Debroy
129f15328b Disable in-tree plugins migrated to CSI
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-11-14 17:28:21 -08:00
Masaki Kimura
f363a03f0b Refactor BlockVolumeMapper and BlockVolumeUnmapper interface
- Rename MapDevice to MapPodDevice in BlockVolumeMapper
- Add UnmapPodDevice in BlockVolumeUnmapper (This will be used by csi driver later)
- Add CustomBlockVolumeMapper and CustomBlockVolumeUnmapper interface
- Move SetUpDevice and MapPodDevice to CustomBlockVolumeMapper
- Move TearDownDevice and UnmapPodDevice to CustomBlockVolumeUnmapper
- Implement CustomBlockVolumeMapper only in local and csi plugin
- Implement CustomBlockVolumeUnmapper only in fc, iscsi, rbd, and csi plugin
- Change MapPodDevice to return path and SetUpDevice not to return path
2019-11-14 22:01:11 +00:00
Kubernetes Prow Robot
b3dde20411
Merge pull request #84907 from RainbowMango/pr_migrate_custom_collector_kubelet
migrate kubelet custom metrics to stability framework part 1
2019-11-10 19:43:56 -08:00
Travis Rhoden
1fd8921546
Move mount/fake.go to mount/fake_mount.go
This patch moves fake.go to mount_fake.go, and follows to principle of
always returning a discrete type rather than an Interface. All callers
of "FakeMounter" are changed to instead use "NewFakeMounter()". The
FakeMounter "Log" struct member is changed to not be exported, and
instead only access through a new "GetLog()" method.
2019-11-08 08:07:41 -07:00
RainbowMango
e4a128a4f7 Deal with auto-generated files.
Update bazel by hack/update-bazel.sh
2019-11-08 09:16:57 +08:00
RainbowMango
ee4394a306 Migrate custom collector for kubelet 2019-11-08 09:16:57 +08:00
Yecheng Fu
36a54399a6 support local volume with block source reconstruction 2019-10-28 10:34:57 +08:00
Kubernetes Prow Robot
24ae4d6718
Merge pull request #84173 from cofyc/fix83693
Support local volume block mode reconstruction
2019-10-25 19:23:23 -07:00
Kubernetes Prow Robot
cbf1e2d360
Merge pull request #82794 from ingvagabund/fake-clientset-enforce-exact-much-for-get
Require exact match when calling Get method within fake clientset
2019-10-25 09:53:39 -07:00
Jan Chaloupka
d32c76fc03 Require exact match when calling Get method within fake clientset
`Get` method within the fake clientset returns an object that would not be normally returned when using the real clientset. Reproducer:

```go
package main

import (
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes/fake"
)

func main () {
	cm := &v1.ConfigMap{
		ObjectMeta: metav1.ObjectMeta{Namespace: metav1.NamespaceSystem, Name: "cm"},
		}

	client := fake.NewSimpleClientset(cm)
	obj, err := client.CoreV1().ConfigMaps("").Get("", metav1.GetOptions{})
	if err != nil {
		panic(err)
	}
	fmt.Printf("obj: %#v\n", obj)
}
```

stored under `test.go` of `github.com/kubernetes/kubernetes` (master HEAD) root directory and ran:

```sh
$ go run test.go
obj: &v1.ConfigMap{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"cm", GenerateName:"", Namespace:"kube-system", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, Data:map[string]string(nil), BinaryData:map[string][]uint8(nil)}
```

As you can see fake clientset with a "test" configmap is created. When getting the object through the clientset back, I intentionally set the object name to an empty string. I would expect to get an error saying config map "" was not found. However, I get "test" configmap instead.

Reason for that is inside implementation of `filterByNamespaceAndName` private function:
```go
func filterByNamespaceAndName(objs []runtime.Object, ns, name string) ([]runtime.Object, error) {
	var res []runtime.Object

	for _, obj := range objs {
		acc, err := meta.Accessor(obj)
		if err != nil {
			return nil, err
		}
		if ns != "" && acc.GetNamespace() != ns {
			continue
		}
		if name != "" && acc.GetName() != name {
			continue
		}
		res = append(res, obj)
	}

	return res, nil
}
```

When `name` is empty, `name != "" && acc.GetName() != name` condition is false and thus `obj` is consider as a fit.

[1] https://github.com/kubernetes/client-go/blob/master/testing/fixture.go#L481-L493
2019-10-24 14:41:48 +02:00
Yecheng Fu
46b1e264dc support local volume block mode reconstruction 2019-10-23 19:32:15 +08:00
Jan Safranek
c9fc26d85e Fix volumeMode retrieval when BlockVolume feature is off
API served does not need to default volumeMode to Filesystem.
2019-10-22 10:17:14 +02:00
Jan Safranek
acf129443c Check PV volumeMode in kubelet even when block feature is off 2019-10-17 15:26:48 +02:00
Kubernetes Prow Robot
4b002b3baa
Merge pull request #82123 from xiaoanyunfei/cleanup/take-effect-stateofworld-hashmap
replace iteration with hashmap in *state_of_world
2019-10-09 02:17:50 -07:00
Jan Safranek
44a006e0d0 Fix volume map path during reconstruction 2019-10-04 15:49:49 +02:00
Kubernetes Prow Robot
349143ec35
Merge pull request #81530 from tedyu/dsow-pop-pod-vol
Fixing contradictory log messages when AddPodToVolume encounters error
2019-09-10 22:11:22 -07:00
Ted Yu
253797acab Avoid conflicting log message when AddPodToVolume encounters error 2019-09-05 09:38:56 +08:00
Travis Rhoden
935c23f2ad
Move HostUtil to pkg/volume/util/hostutil
This patch moves the HostUtil functionality from the util/mount package
to the volume/util/hostutil package.

All `*NewHostUtil*` calls are changed to return concrete types instead
of interfaces.

All callers are changed to use the `*NewHostUtil*` methods instead of
directly instantiating the concrete types.
2019-08-30 10:14:42 -06:00
sunxiaofei03
45d41ed9e5 replace iteration with hashmap in *state_of_world 2019-08-29 19:22:25 +08:00
Han Kang
3a50917795 migrate kubelet's metrics/probes & metrics endpoint to metrics stability framework 2019-08-28 11:16:38 -07:00
Kubernetes Prow Robot
f105fef3d5
Merge pull request #81429 from huffmanca/resize_block_volume
Enables resizing of block volumes.
2019-08-23 17:59:05 -07:00
Hemant Kumar
9dbe0b3ad8 Fix devicePath for raw block expansion
Fix tests
2019-08-22 22:48:46 -04:00
Kubernetes Prow Robot
a3488b4cee
Merge pull request #81206 from tallclair/staticcheck-kubelet-push
Cleanup Kubelet static analysis issues
2019-08-22 15:09:43 -07:00
Christian Huffman
7a4cdf5ab2 Included resizing for CSI-based block volumes.
Perform a no-op when volume is of type raw block

Fix bug with checking volume mounts for readonly
2019-08-22 15:45:57 -04:00
Kubernetes Prow Robot
2af52db689
Merge pull request #81529 from tedyu/asoww-get-pod
Drop GetPods from ActualStateOfWorld
2019-08-22 08:43:24 -07:00
Tim Allclair
a2c51674cf Cleanup more static check issues (S1*,ST*) 2019-08-21 10:40:21 -07:00
Tim Allclair
8a495cb5e4 Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
Tim Allclair
6510d26b6a Fix misc static check issues 2019-08-21 10:40:21 -07:00
Tim Allclair
3f510c69f6 Remove dead code from pkg/kubelet/... 2019-08-21 10:40:21 -07:00
Kubernetes Prow Robot
59d29b67d9
Merge pull request #59484 from verb/debug-kubelet-1
Add support for Ephemeral Containers to the kubelet
2019-08-21 00:29:17 -07:00
Kubernetes Prow Robot
e319abf274
Merge pull request #81163 from jsafrane/skip-unused-volumes
Skip unused volumes in VolumeManager
2019-08-16 17:02:36 -07:00
Ted Yu
e85e0bafbd Drop GetPods from ActualStateOfWorld 2019-08-16 12:59:23 -07:00
fredkan
67aeb09c6a error config attachable plugin 2019-08-15 22:29:18 +08:00
fredkan
6524b83d53 error config attachable plugin 2019-08-15 20:41:32 +08:00
fredkan
87243f49a4 fix error set csiplugin attachable 2019-08-15 17:08:21 +08:00
Jan Safranek
5b69362ff0 Skip unused volumes in VolumeManager
DesiredStateOfWorldPopulator should skip a volume that is not used in any
pod. "Used" means either mounted (via volumeMounts) or used as raw block
device (via volumeDevices).

Especially when block feature is disabled, a block volume must not get into
DesiredStateOfWorld, because it would be formatted and mounted there.
2019-08-15 10:48:38 +02:00
Jan Safranek
8d580262f9 Refactor makeMountsMap into GetPodVolumeNames
The function will be handy in subsequent patches. Also change custom maps
into sets.String.
2019-08-15 10:48:38 +02:00
Kubernetes Prow Robot
345e58b434
Merge pull request #75071 from mkimuram/issue/74552e2e
Fix volume reconstruction and add e2e tests
2019-08-06 06:05:55 -07:00
Jan Safranek
c744385804 Add limit of stored errors
There should be a limit so the set of errors does not grow too much in
case of some bug in the populator.
2019-08-05 10:06:44 +02:00
Lee Verberne
b5d592e735 Simplify VisitContainers pattern in volumemanager populator 2019-08-03 14:13:46 +00:00
Masaki Kimura
c130b77a48 Move nil check for mapperPlugin earlier in reconstructVolume 2019-08-01 20:36:21 +00:00
Jan Safranek
bab81b809b Don't create mounter when reconstructing block volume
CSI mounter will create a new directory + json for a filesystem volume,
leading to even more orphaned files/directories.
2019-08-01 20:04:10 +00:00
Lee Verberne
7bce18b0ce Generated code for Ephemeral Containers in kubelet 2019-07-24 16:25:52 +00:00
Lee Verberne
ea212d5d49 Add support for ephemeral containers to the kubelet 2019-07-24 16:24:26 +00:00
Jan Safranek
af0c2fe572 Fix some error messages 2019-07-22 10:54:33 +02:00
Jan Safranek
17be780651 Add events to dswp 2019-07-19 17:46:21 +02:00
Kubernetes Prow Robot
2501a9083d
Merge pull request #68513 from codenrhoden/mount-refactor
Refactor util/mount interface in prep for moving out of k/k
2019-06-28 13:57:28 -07:00
Mario Valderrama
a44b754405 Refactor online volume resize unit tests 2019-06-17 18:24:22 +02:00
Travis Rhoden
be7da5052f Refactor pkg/util/mount to be more reusable
This patch refactors pkg/util/mount to be more usable outside of
Kubernetes. This is done by refactoring mount.Interface to only contain
methods that are not K8s specific. Methods that are not relevant to
basic mount activities but still have OS-specific implementations are
now found in a mount.HostUtils interface.
2019-06-14 09:35:18 -06:00
Hemant Kumar
0f62e3fbe8 Make language of error msgs and func names consistent: ExpandVolumeInUse
change feature flag
Fix the e2e test for online and offline expansion
2019-06-03 12:26:56 -04:00
Robert Krawitz
38753efcc7 Set sizeLimit to the smaller of the ephemeral storage limit and the emptydir limit (if set) 2019-05-29 15:17:47 -04:00
Robert Krawitz
f8661d6240 Use xfs_quota command to apply quotas 2019-05-29 15:12:28 -04:00
Robert Krawitz
448e0c44c6 Apply quotas via syscalls using cgo. 2019-05-29 15:12:28 -04:00
Andrew Kim
c919139245 update import of generic featuregate code from k8s.io/apiserver/pkg/util/feature -> k8s.io/component-base/featuregate 2019-05-08 10:01:50 -04:00
Hemant Kumar
15e2421f90 Add jan and msau42 as approver for volumemanager 2019-05-03 13:34:50 -04:00
Xing Yang
000ab86788 Move CSIDriver Lister to the controller 2019-04-05 12:20:11 -07:00
Kubernetes Prow Robot
428a8e04d4
Merge pull request #75458 from jingxu97/March/raceofActualDesiredState
Fix race condition between actual and desired state in kublet volume manager
2019-03-25 13:24:51 -07:00
Jing Xu
7cb5df6728 Fix race condition between actual and desired state in kublet volume
manager

This PR fixes the issue #75345. This fix modified the checking volume in
actual state when validating whether volume can be removed from desired state or not. Only if volume status is already mounted in actual state, it can be removed from desired state.
For the case of mounting fails always, it can still work because the
check also validate whether pod still exist in pod manager. In case of
mount fails, pod should be able to removed from pod manager so that
volume can also be removed from desired state.
2019-03-18 17:08:48 -07:00
caiweidong
92aee22646 Remove the unused variabe: syncDuration in volumemanager 2019-03-15 10:04:41 +08:00
Hemant Kumar
89d1de9eb9 Rename ExandFS to NodeExpand
Handle resize error in online resizing
Use NodeExpandable plugin to mark volumes that require node expansion
2019-03-08 09:21:44 -05:00
Yecheng Fu
8940976602 Distinguish volume path with mount path 2019-02-27 19:31:26 +08:00
Kubernetes Prow Robot
a684bd5eb1
Merge pull request #73556 from msau42/triage-72931
Mark volume as in use even when node status didn't change
2019-02-12 17:29:05 -08:00
Michelle Au
80a2698a02 Add unit tests for volumesinuse during node status update 2019-02-12 13:46:30 -08:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
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
Kubernetes Prow Robot
6fb69d3967
Merge pull request #71648 from houjun41544/20181203-volume
Fix an error in comment
2019-02-03 12:02:45 -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
Kubernetes Prow Robot
54c4428eb4
Merge pull request #71276 from jingxu97/Oct/uncertain
Handle failed attach operation leave uncertain volume attach state
2019-01-17 22:52:57 -08: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
67552a8f6e Add unit test to verify generated volume names. 2018-12-12 13:03:21 +08:00
houjun
5c6eb3a153 Fix an error in comment 2018-12-03 11:35:07 +08:00