Commit graph

597 commits

Author SHA1 Message Date
张可10140699
ab19ec1bfc Fix:globalmount path may be residual while pod creation-deletion 2026-01-08 08:36:40 +08:00
Kubernetes Prow Robot
8362ec56da
Merge pull request #134441 from humblec/kubelet-volume
Record proper orphaned pod cleanup error based on the system call
2025-12-17 16:26:18 -08:00
Kubernetes Prow Robot
1187749524
Merge pull request #133719 from carlory/removeMaxAttachLimit
clean up removeMaxAttachLimit
2025-12-17 16:25:40 -08:00
Humble Devassy Chirammal
902c652ccb Record proper orphaned pod cleanup error based on the system call
The code actually calls os.Remove(), not rmdir(). The error message
should accurately reflect the operation being performed.
os.Remove() can remove both files and directories, while rmdir()
only removes directories

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2025-11-01 11:35:27 +05:30
Anish Ramasekar
30a6d4b389
Add CSI driver opt-in for service account tokens via secrets field
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-10-24 11:04:02 -07:00
Kubernetes Prow Robot
7498131d5e
Merge pull request #131098 from DataDog/fricounet/upstream/race-csinode-creation
Wait for CSINode removal to register CSI plugin
2025-10-23 11:35:35 -07:00
Baptiste Girard-Carrabin
28507d0e92
[test] Add case for existing driver on old csi node
The driver on the old object should not appear on the new one because it represented a different node
2025-10-23 10:44:55 +02:00
Baptiste Girard-Carrabin
a14230ae82
[test] Validate migration annotation are still applied 2025-10-23 10:28:51 +02:00
Kubernetes Prow Robot
5b3bbd89e6
Merge pull request #134144 from swagatbora90/fix-kubeletnull-crash
change klog to log volume name instead of entire spec in GetDeviceMountPath
2025-10-10 09:21:00 -07:00
Kubernetes Prow Robot
a20a9a4113
Merge pull request #133599 from eltrufas/block-transient
Mark API server errors as transient in csi raw block driver
2025-10-08 05:29:02 -07:00
Rafael Castillo
f99d0e9759 Mark API server errors as transient in csi raw block driver
Certain failures during SetupDevice and MapPodDevice are not treated as
transient in the csi raw block plugin implementation, while they are in
the file mode plugin. This can lead to certain failures causing volumes
to be marked as unmounted incorrectly.

This patch brings the block plugin up to parity with the fs one by
marking the equivalent calls as transient. This mostly covers API server
and some csi driver calls.
2025-10-08 02:39:01 +00:00
Baptiste Girard-Carrabin
cb01a28df4
Ensure CSINode is owned by node when installing CSI drivers
CSI drivers can be installed while the node is still initializing since the daemonsets usually tolerate all taints. As a result, we also need to make sure the outdated CSINode object has been removed before installing a new CSI driver.
2025-10-07 11:00:55 +02:00
Baptiste Girard-Carrabin
328f9da729
Add current and old nodeIDs in log messages
Refactor the nodeOwnsCSINode function to also outputs the current owner ID so that it can be logged afterwards.
2025-10-07 10:03:13 +02:00
Humble Devassy Chirammal
2ddc955558 correct metrics function comments
Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2025-10-03 17:11:54 +05:30
Swagat Bora
9d5ddd9fac change klog to log volume name instead of entire spec in GetDeviceMountPath
Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-09-18 23:47:06 +00:00
carlory
2f3e6778ff
clean up removeMaxAttachLimit 2025-08-27 10:58:47 +08:00
Eddie
727a6e6db5
Reject pod when attachment limit is exceeded (#132933)
* Reject pod when attachment limit is exceeded

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Record admission rejection

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix AD Controller unit test failure

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Consolidate error handling logic in WaitForAttachAndMount

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Improve error context

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Update admissionRejectionReasons to include VolumeAttachmentLimitExceededReason

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Update status message

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Add TestWaitForAttachAndMountVolumeAttachLimitExceededError unit test

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Add e2e test

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: Eddie Torres <torredil@amazon.com>

---------

Signed-off-by: Eddie Torres <torredil@amazon.com>
2025-07-24 17:58:54 -07:00
Baptiste Girard-Carrabin
a375b0aa36
Ensure CSINode belongs to current node on init
When a CSI plugin attempts to register on a node, the node checks if the CSINode object exists. If it does but the ownerReference of the CSINode does not match the UID of the current node, possibly because the node object was recreated with the same name, we end up in a race condition where the CSINode object will be updated but subsequently deleted by the GC controller.
In this situation, the CSINode object will be gone and won't be recreated unless the CSI plugin or the kubelet are restarted.
This commit fixes this race by checking that the CSINode object belong to the current node during initialization.
If it doesn't, it means that the CSINode object is left over from a previous node and it must be removed first. Once removed, registration can progress as usual.
2025-07-17 21:10:05 +02:00
Kubernetes Prow Robot
3fdc11cbe0
Merge pull request #130230 from carlory/cleanup-CSIDriverRegistry
clean up CSIDriverRegistry
2025-07-04 15:25:31 -07:00
Kubernetes Prow Robot
f407bd6d24
Merge pull request #132254 from carlory/cleanup-MountContainers
Cleanup after Alpha feature MountContainers was removed
2025-06-18 17:24:50 -07:00
carlory
85bc3cb096 Remove GetExec method from VolumeHost
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-06-13 10:58:37 +08:00
carlory
f0dde38234 Remove pluginName param from GetMounter and GetExec
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-06-12 17:29:17 +08:00
Lan Liang
7b664a1135 pkg/volume: drop pointer wrapper functions.
The new k8s.io/utils/ptr package provides generic wrapper functions,
    which can be used instead of type-specific pointer wrapper functions.
    This replaces the latter with the former, and migrates other uses of
    the deprecated pointer package to ptr in affacted files.

    See kubernetes/utils#283 for details.

Signed-off-by: Lan Liang <gcslyp@gmail.com>
2025-06-05 05:20:46 +00:00
Hemant Kumar
c704025a0e Fix error handling and csi json file removal interaction 2025-04-15 11:27:26 -04:00
carlory
21f7026c25 clean up CSIDriverRegistry 2025-03-19 14:54:12 +08:00
Kubernetes Prow Robot
64621d17a6
Merge pull request #129832 from pohly/dra-seamless-upgrade
DRA: seamless driver upgrades
2025-03-18 13:51:51 -07:00
Eddie Torres
c766a52356
Implement KEP 4876 Mutable CSINode (#130007)
* Implement KEP-4876 Mutable CSINode Allocatable Count

Signed-off-by: torredil <torredil@amazon.com>

* Update TestGetNodeAllocatableUpdatePeriod

Signed-off-by: torredil <torredil@amazon.com>

* Implement CSINodeUpdater

Signed-off-by: torredil <torredil@amazon.com>

* Use sync.Once in csiNodeUpdater

Signed-off-by: torredil <torredil@amazon.com>

* ImVerify driver is installed before running periodic updates

Signed-off-by: torredil <torredil@amazon.com>

* Update NodeAllocatableUpdatePeriodSeconds type comment

Signed-off-by: torredil <torredil@amazon.com>

* Leverage apivalidation.ValidateImmutableField in ValidateCSINodeUpdate

Signed-off-by: torredil <torredil@amazon.com>

* Update strategy functions

Signed-off-by: torredil <torredil@amazon.com>

* Run hack/update-openapi-spec.sh

Signed-off-by: torredil <torredil@amazon.com>

* Update VolumeError.ErrorCode field

Signed-off-by: torredil <torredil@amazon.com>

* CSINodeUpdater improvements

Signed-off-by: torredil <torredil@amazon.com>

* Iron out concurrency in syncDriverUpdater

Signed-off-by: torredil <torredil@amazon.com>

* Run hack/update-openapi-spec.sh

Signed-off-by: torredil <torredil@amazon.com>

* Revise logging

Signed-off-by: torredil <torredil@amazon.com>

* Revise log in VerifyExhaustedResource

Signed-off-by: torredil <torredil@amazon.com>

* Update API validation

Signed-off-by: torredil <torredil@amazon.com>

* Add more code coverage

Signed-off-by: torredil <torredil@amazon.com>

* Fix pull-kubernetes-linter-hints

Signed-off-by: torredil <torredil@amazon.com>

* Update API types documentation

Signed-off-by: torredil <torredil@amazon.com>

* Update strategy and validation for new errorCode field

Signed-off-by: torredil <torredil@amazon.com>

* Update validation tests after strategy changes

Signed-off-by: torredil <torredil@amazon.com>

* Update VA status strategy

Signed-off-by: torredil <torredil@amazon.com>

---------

Signed-off-by: torredil <torredil@amazon.com>
2025-03-18 12:45:49 -07:00
Patrick Ohly
b471c2c11f DRA kubelet: support rolling upgrades
The key difference is that the kubelet must remember all plugin instances
because it could always happen that the new instance dies and leaves only the
old one running.

The endpoints of each instance must be different. Registering a plugin with the
same endpoint as some other instance is not supported and triggers an error,
which should get reported as "not registered" to the plugin. This should only
happen when the kubelet missed some unregistration event and re-registers the
same instance again. The recovery in this case is for the plugin to shut down,
remove its socket, which should get observed by kubelet, and then try again
after a restart.
2025-03-18 12:32:35 +01:00
Kubernetes Prow Robot
78208023e2
Merge pull request #128952 from my-git9/volume-deadcode
pkg/volume: remove unused function
2025-03-14 06:37:46 -07:00
Kubernetes Prow Robot
2491c0b150
Merge pull request #129218 from novahe/master
Add lock for csiNode update
2025-03-14 05:29:46 -07:00
Hemant Kumar
49dabe56d0 Monitor progress tracking for permission change 2025-02-24 15:55:37 -05:00
novahe
a70b6b9105 Add lock for csiNode update
Signed-off-by: novahe <heqianfly@gmail.com>
2025-02-17 21:48:54 +08:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
xin.li
bf1280014b pkg/volume: remove unused function
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-11-26 13:46:53 +08:00
Jan Safranek
aa8872d7a3 Add SELinux warning controller 2024-11-06 11:16:02 +01:00
Hemant Kumar
1e7b4406a3 Apply fsGroup when accessMode is ReadWriteOncePod 2024-10-21 17:14:33 -04:00
Kubernetes Prow Robot
65bc7c0c1a
Merge pull request #126924 from carlory/volumelimit
Remove attachable volume limit from node's status capacity
2024-10-04 15:02:41 +01:00
Matthieu MOREL
27b98be303 fix: enable nil-compare and error-nil rules from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-25 06:02:47 +02:00
Abhishek Kr Srivastav
95860cff1c Fix Go vet errors for master golang
Co-authored-by: Rajalakshmi-Girish <rajalakshmi.girish1@ibm.com>
Co-authored-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>
2024-09-20 12:36:38 +05:30
carlory
47eed55a66 Remove attachable volume limit from node's status capacity if they exists 2024-09-18 11:09:53 +08:00
Madhu Rajanna
d644860cfb check usage when VolumeCondition is not supported
The Usage and VolumeCondition are both
optional in the response and kubelet
need to consider returning metrics if
either one is set.
2024-09-02 11:03:26 +02:00
carlory
e1228754f6 csi volume plugin stop watching the volumeattachment object if the object is not found or volume is not attached when kubelet wait for volume attached 2024-08-28 12:47:27 +08:00
carlory
c4851c64a0 remove volumeoptions from VolumePlugin and BlockVolumePlugin 2024-07-24 14:07:02 +08:00
Hemant Kumar
f7f1a6c81a Address review comments and return nicer errors 2024-07-22 10:43:38 -04:00
Hemant Kumar
c8d9863a3e Add new type for infeasible errors 2024-07-15 10:14:57 -04:00
Kubernetes Prow Robot
1236f48109
Merge pull request #124770 from uucloud/docs/fix_tls_bootstrapping_link
docs:fix broken link
2024-06-24 13:36:34 -07:00
Kubernetes Prow Robot
4cc989a7a9
Merge pull request #124740 from bells17/use-sets-set-string
[pkg/volume] Changed to use sets.Set[string] instead of sets.String
2024-05-31 05:32:15 -07:00
carlory
21baa25e1a remove BulkVolumeVerifier interface from volume 2024-05-14 14:17:25 +08:00
bells17
8cf18d1b5c [pkg/volume] Changed to use sets.Set[string] instead of sets.String 2024-05-11 18:02:45 +09:00
carlory
c8e91b9bc2 CephRBD volume plugin ( ) and its csi migration support were removed in this release 2024-05-09 22:55:34 +08:00