Commit Graph

169 Commits

Author SHA1 Message Date
neogopher
400c8f71cf docs: Correct the log message for pv controller to make it more accurately descriptive 2022-10-30 23:17:55 +05:30
Roman Bednar
42422a1d16 add a metric for retroactive sc errors 2022-10-25 15:09:16 +02:00
Roman Bednar
f5693a4008 restart claim sync when PVC is updated
We should not rely on syncUnboundClaim() to do nothing after it updates
PVC with a default storage class until next re-sync but instead restart
the sync explicitly to make sure we hit isDelayBindingMode() and
findBestMatchForClaim() immediately right after the PVC update.
2022-10-17 14:05:39 +02:00
Roman Bednar
a0a5aa3680 allow retroactive storage class assignment in pv controller 2022-08-02 20:52:04 +02:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Wojciech Tyczyński
13e4f2b554 Clean shutdown of volume integration tests 2022-07-14 11:25:57 +02:00
Deepak Kinni
a7b1fcba40 Add or Remove PV deletion protection finalizer considering the recalimPolicy
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
2022-04-07 00:48:35 +05:30
Deepak Kinni
836ace46a0 Default enable flag for beta feature HonorPVReclaimPolicy
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
2022-03-26 06:48:28 +05:30
Konstantin Misyutin
4ba98a8610 cleanup: remove unnecessary import aliases 2022-03-16 15:43:09 +08:00
Konstantin Misyutin
1d7cefe9c4 Move volume helpers to "k8s.io/component-helpers/storage/volume".
This patch aims to simplify decoupling "pkg/scheduler/framework/plugins"
from internal "k8s.io/kubernetes" packages. More described in
issue #89930 and PR #102953.

Some helpers from "k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
package moved to "k8s.io/component-helpers/storage/volume" package:

- IsDelayBindingMode
- GetBindVolumeToClaim
- IsVolumeBoundToClaim
- FindMatchingVolume
- CheckVolumeModeMismatches
- CheckAccessModes
- GetVolumeNodeAffinity

Also "CheckNodeAffinity" from "k8s.io/kubernetes/pkg/volume/util"
package moved to "k8s.io/component-helpers/storage/volume" package
to prevent diamond dependency conflict.

Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2022-03-16 15:43:09 +08:00
Deepak Kinni
d37f14d0ae Support for in-tree PV Deletion protection finalizer
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
2022-03-10 21:37:43 -08:00
Deepak Kinni
bfd5f23a0b PV controller changes to support PV Deletion protection finalizer
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
2021-11-08 10:35:58 -08:00
Konstantin Misyutin
808c8f42d5 Remove StorageObjectInUseProtection feature gate logic
This feature has graduated to GA in v1.11 and will always be
enabled. So no longe need to check if enabled.

Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2021-11-03 00:13:50 +03:00
Mike Dame
4960d0976a Wire contexts to Core controllers 2021-11-01 10:29:00 -04:00
torubylist
f28a8d7f2b fix:cached claim is not the newest will cause unexpected issue 2021-10-13 20:03:00 +08:00
Kubernetes Prow Robot
838a967be5
Merge pull request #101175 from lojies/cleanupforpvcontroller
code cleanup:remove redundant return statement in pv_controller.go
2021-05-24 21:48:49 -07:00
wangyx1992
fd51e654af cleanup: fix errors in wrapped format and log capitalization in controller
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-22 15:40:54 +08:00
卢振兴10069964
8009823867 code cleanup:remove redundant return statement in pv_controller.go 2021-04-16 09:02:21 +08:00
Sung Jun Park
5f69cf74d8 fix: when newly binding pvc to a pv, adjust pvc.status.capacity to pv's annotation that denotes the pre-resize capacity of the original pvc that pv was bound to if it has one
test: confirm that pvc's status capacity is adjusted if pv has a pre-resize capacity annotation
2021-03-09 07:55:10 +00:00
Kubernetes Prow Robot
f6152d1521
Merge pull request #97086 from xing-yang/check_datasource
Only CSI plugin can have a DataSource
2021-03-01 06:53:26 -08:00
Kubernetes Prow Robot
c200a8f9b7
Merge pull request #98433 from damemi/remove-helper-from-volume-zone
Move GetPersistentVolumeClaimClass to component-helpers
2021-02-26 12:38:15 -08:00
xing-yang
676a3a7012 Only CSI plugin can have a DataSource 2021-02-25 15:27:26 +00:00
Jiawei Wang
6a7222cf4e Add migrated field to storage_operation_duration_seconds metric 2021-02-12 17:35:01 -08:00
Mike Dame
ba72411aa2 Move GetPersistentVolumeClaimClass to component-helpers
The goal of this move is related to issue 89930, to break the dependence
of scheduling plugins on internal helpers. This function can easily move to
component-helpers where it will be used by other components as well.
2021-02-01 10:48:38 -05:00
Kubernetes Prow Robot
096819c963
Merge pull request #95909 from pohly/pv-controller-delete-pv-fix
PV controller: don't delete PVs when PVC is not known yet
2020-11-02 02:00:52 -08:00
Patrick Ohly
5686664a1d PV controller: don't delete PVs when PVC is not known yet
Normally, the PV controller knows about the PVC that triggers the
creation of a PV before it sees the PV, because the PV controller must
set the volume.beta.kubernetes.io/storage-provisioner annotation that
tells an external provisioner to create the PV.

When restarting, the PV controller first syncs its caches, so that
case is also covered.

However, the creator of a PVC might decided to set that annotation
itself to speed up volume creation. While unusual, it's not forbidden
and thus part of the external Kubernetes API. Whether it makes sense
depends on the intentions of the user.

When that is done and there is heavy load, an external provisioner
might see the PVC and create a PV before the PV controller sees the
PVC. If the PV controller then encounters the PV before the PVC, it
incorrectly concludes that the PV needs to be deleted instead of being
bound.

The same issue occurred earlier for external binding and the existing
code for looking up a PVC in the cache or in the apiserver solves the
issue also for volume provisioning, it just needs to be enabled also
for PVs without the pv.kubernetes.io/bound-by-controller annotation.
2020-10-27 11:26:58 +01:00
Matthew Cary
f2e23afcf1 Adds filtering of hosts to DialContexts.
The provided DialContext wraps existing clients' DialContext in an attempt to
preserve any existing timeout configuration. In some cases, we may replace
infinite timeouts with golang defaults.

- scaleio: tcp connect/keepalive values changed from 0/15 to 30/30
- storageos: no change
2020-09-18 00:07:32 +00:00
Yecheng Fu
8422044f17 sharing a common pod pvc indexer among volume controllers 2020-06-03 14:51:21 +08:00
Yecheng Fu
32df4300ef emit correct event when unbound delay binding claim is used by pod 2020-05-29 19:36:13 +08: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
Jayasekhar Konduru
5a4f1be19d Added events for failures in PV/PVC processing:
- PV has a dangling reference to a PVC
- PVC is trying to bind to a PV that already references a different PVC

Change-Id: Ic509d39808763149b02b4dd52347edb74a8803fd
2020-04-16 22:11:02 -07:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Hemant Kumar
d9f7a1f311 Don't call delete for already deleted volumes 2020-02-18 15:59:47 -05: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
David Zhu
b7817a2981 Add annotation annealing for migration for PVs and PVCs during syncVolume and syncClaim. This allows external-provisioners to pick up and delete volumes when they have been rolled up from previous kubernetes versions. 2020-01-27 16:14:53 -08:00
danielqsj
5bc0e26c19 unify alias of api errors under pkg and staging 2019-12-26 16:42:28 +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
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Jan Safranek
a689697519 Do not bind block PV/PVCs when block feature gate is off 2019-10-17 12:40:22 +02:00
David Zhu
92cb06a2e7 Refactor CSI Translation Library into a struct that is injected into various components to simplify unit testing in future 2019-09-27 12:59:53 -07:00
Yi Tang
8c13f9dea3 fix pv controller not find pv for pvc provisioning 2019-07-26 16:24:30 +08:00
AllenZMC
852040c036
fix typos in pv_controller.go
make code kinda more readable
2019-07-25 11:28:19 +08:00
Shintaro Murakami
7c0b33e012 Add check to reduce orphaned volume 2019-07-11 16:31:56 +09:00
Ted Yu
a18633427b Drop unnecessary claim parameter from PersistentVolumeController#updateBindVolumeToClaim 2019-07-01 13:30:11 +08:00
xiangqian
38a884aa04 using storage class provisioner instead of annotation of a pv for external provisioner
minor updates
2019-05-30 10:19:36 -07:00
xiangqian
9688511595 record provision and deletion latency metric
instead of using provisioner from storage class directly, uses plugin name firstly
2019-05-29 14:15:30 -07:00
Yecheng Fu
2d0d226371 Move all private annotations to shared package and update code 2019-05-05 09:43:43 +08:00
Yecheng Fu
842fed658c Refactor PV scheduling library into separate package 2019-05-02 14:45:52 +08:00
Deep Debroy
1da91ad39a Add GetIntreeNameFromCSIName and SupersedesInTreePlugin APIs and unit tests
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-03-04 16:36:45 -08:00