Commit Graph

542 Commits

Author SHA1 Message Date
Hemant Kumar
d190fa3e7d Fix race condition between external-resizer and kubelet
This fixes the race condition that could happen because
resize controller just finished volume expansiona and has only
finished marking PV and yet to mark PVC.

The workaround proposed here should not be necessary once
RecoverVolumeExpansionFailure goes GA/beta.
2024-01-31 12:23:56 -05:00
carlory
e198938671 Remove deprecated comment about cleanup the target_path of CSI volumes 2024-01-30 18:47:59 +08:00
carlory
55e1646fa4 removed the deprecated azureFile in-tree storage plugin 2024-01-04 14:41:33 +08:00
Jan Safranek
15e0c41601 Fix CSI migration for vSphere volumes
Restore `migratedPlugins` entry for in-tree vSphere volumes and mark them
as migrated. Otherwise the CSI volume plugin ignores in-tree vSphere
volumes and they will never get attached / mounted by CSI migration.

The entry in `migratedPlugins` was incorrectly removed during
CSIMigrationvSphere feature gate removal.
2023-12-15 13:03:35 +01:00
Humble Chirammal
3890546265 Update APIs and adjust tests
Signed-off-by: zhucan <zhucan.k8s@gmail.com>
Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
2023-11-01 09:28:36 +05:30
Kubernetes Prow Robot
0501933e56
Merge pull request #121291 from bzsuni/ga/CSIMigrationvSphere
Remove GA featuregate about CSIMigrationvSphere in 1.29
2023-10-26 01:08:06 +02:00
Chris Henzie
2dbd405583 Graduate ReadWriteOncePod to GA 2023-10-20 10:40:39 -07:00
bzsuni
7561284819 Remove GA featuregate about CSIMigrationvSphere in 1.29
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2023-10-17 20:44:50 +08:00
Akanksha Panse
38935b787e Do not fail volume attach operation at kubelet if staging target path already exists on windows worker node. 2023-10-03 13:08:14 +05:30
Kubernetes Prow Robot
f9f00da6bc
Merge pull request #118761 from TommyStarK/gh_113831
move common logic of highestSupportedVersion to util package
2023-09-18 13:59:25 -07:00
TommyStarK
42356bfbb3
move common logic of highestSupportedVersion to util package
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-09-18 21:25:29 +02:00
Rohit Singh
61ecc2ad88 Retry operations if CSI Driver Isn't Found by Treating this Error as Transient 2023-09-11 06:07:40 +00:00
Kubernetes Prow Robot
52457842d1
Merge pull request #117055 from cyclinder/csi_migration
remove CSI-migration gate
2023-06-28 04:28:31 -07:00
Stephen Kitt
ab75e48494
storage: stop using deprecated io/ioutil
This replaces deprecated ioutil variables and functions as follows:

* ioutil.ReadDir -> os.ReadDir
* ioutil.ReadFile -> os.ReadFile
* ioutil.TempDir -> os.MkdirTemp
* ioutil.TempFile -> os.CreateTemp
* ioutil.WriteFile -> os.WriteFile

The ReadDir conversion involves an API change, the replacement
function returns a slice of fs.DirEntry instead of fs.FileInfo.
Where appropriate, the surrounding code has been adjusted; mostly,
that means using DirEntry.Type() instead of FileInfo.Mode().
Applying this change to the IoUtil interface would mean changing its
API, so this is left for later.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-06-20 16:49:03 +02:00
Kubernetes Prow Robot
bfd833baf3
Merge pull request #115982 from peaaceChoi/master
Update toplogy keyset initialization
2023-06-19 04:04:21 -07:00
cyclinder
8e4228a8c1 remove CSI-migration gate 2023-06-04 18:40:17 +08:00
Andy Zhang
1ce285ad3d
Revert "removed the deprecated azureFile in-tree storage plugin" 2023-06-02 10:20:53 +08:00
andyzhangx
485d1631cd Remove Azure file in-tree storage plugin 2023-05-24 14:10:34 +00:00
Kubernetes Prow Robot
8722ab2c84
Merge pull request #117022 from mpatlasov/fix-dir-mismatch-for-SetVolumeOwnership
Fix directory mismatch for `volume.SetVolumeOwnership()`
2023-04-11 19:18:23 -07:00
Kubernetes Prow Robot
de109979a1
Merge pull request #116138 from cvvz/fix-114207
fix: the volume is not detached after the pod and PVC objects are deleted
2023-04-11 15:35:48 -07:00
Maxim Patlasov
0a37f09c32 Fix directory mismatch for volume.SetVolumeOwnership()
In most cases `dir` arg of `SetUpAt()` method of `volume.Mounter` interface is the same as `mounter.GetPath()` because we usually call `SetUpAt()` from `SetUp()` like this:"
```
func (ed *emptyDir) SetUp(mounterArgs volume.MounterArgs) error {
	return ed.SetUpAt(ed.GetPath(), mounterArgs)
}
```
(this example is from `volume/emptydir/empty_dir.go`, but there are plenty other examples like that in `volume/*`)

However, there is currently one exception. This is from `volume/projected/projected.go`:
```
	if err := wrapped.SetUpAt(dir, mounterArgs); err != nil {
		return err
	}
```
(see 96306f144a/pkg/volume/projected/projected.go (L203))

In this case `dir` is not equal to `wrapped.GetPath()` and `volume.SetVolumeOwnership()` fails when called from `SetUpAt()` of wrapped volume:
```
lstat /var/lib/kubelet/pods/a2f6e58f-7edf-4c48-a97c-ef1b8fd3caf6/volumes/kubernetes.io~empty-dir/wrapped_kube-api-access-knvkv: no such file or directory
```

To fix the issue let's pass `dir` arg to `volume.SetVolumeOwnership()` explicitly, and use it instead of `mounter.GetPath()`.
2023-04-03 12:34:37 -07:00
andyzhangx
5d0a54dcb5 remove Azure Disk in-tree driver code
fix
2023-03-09 13:24:08 +00:00
torredil
6aebda9b1e Remove AWS legacy cloud provider + EBS in-tree storage plugin
Signed-off-by: torredil <torredil@amazon.com>
2023-03-06 14:01:15 +00:00
weizhichen
b0eeeacfc0 fix: the volume is not detached after the pod and PVC objects are deleted 2023-02-28 17:14:00 +00:00
peaaceChoi
4d3f92d5f7 Update toplogy keyset initialization 2023-02-23 10:58:22 +09:00
HirazawaUi
79b799a0f3 delete unused functions in pkg/volume directory 2023-01-16 21:19:11 +08:00
Maxim Patlasov
fcf89f66a9 Fix installDriverToCSINode(): we should not skip CSINode update if Allocatable.Count changed 2022-12-16 18:02:59 -08:00
Jan Safranek
5b284a50b7 Revert "Remove references to openstack and cinder"
This reverts commit 9bbf01bae9.
2022-11-10 18:25:30 +01:00
Kubernetes Prow Robot
a7117b716b
Merge pull request #112344 from zlabjp/fix-invalid-attach-limit
Fix incorrect "Invalid attach limit" error when maxAttachLimit is 0
2022-11-09 08:30:13 -08:00
Jan Safranek
167d27a790 Save SELinux context both in MountDevice and SetUp
And make it feature gated in both places.
2022-11-08 18:10:51 +01:00
Jan Safranek
e575e60ea4 Reconstruct SELinux mount option
When reconstructing volumes from disk after kubelet restart, reconstruct
also context=XYZ mount option and add it to the ActualStateOfWorld.
2022-11-08 11:17:38 +01:00
Kubernetes Prow Robot
1c230d519e
Merge pull request #113262 from jsafrane/rework-reconstruction
Rework volume reconstruction
2022-11-07 12:42:29 -08:00
Kubernetes Prow Robot
d9db8db68f
Merge pull request #111707 from leiyiz/migration
remove const that's not used
2022-11-04 13:48:15 -07:00
Fabio Bertinatto
b19172c58f Promote DelegateFSGroupToCSIDriver feature to GA 2022-11-04 07:26:17 -03:00
Jan Safranek
fc245b339b Refactor ConstructVolumeSpec
Return a struct from ConstructVolumeSpec to be able to add more fields to
it later.
2022-11-03 16:55:13 +01:00
Kubernetes Prow Robot
7d9c0e0a78
Merge pull request #113411 from jsafrane/fix-selinux-context-mount
Fix SELinux context mount with unknown context
2022-10-31 17:00:44 -07:00
Jan Safranek
8dd3510032 Fix SELinux context mount with unknown context
Don't mount with SELinux mount option if kubelet does not know the SELinux
context, i.e. MounterArgs.SELinuxLabel is ""
2022-10-31 19:11:48 +01:00
Kubernetes Prow Robot
9702161caa
Merge pull request #112597 from mythi/grpc-authority
grpc: set localhost Authority to unix client calls
2022-10-31 03:12:45 -07:00
Kubernetes Prow Robot
a74e16fc81
Merge pull request #113306 from jsafrane/csidriver-setup
Move CSIDriver checks from NewMounter to SetUpAt
2022-10-26 17:08:43 -07:00
Jan Safranek
483fd45e8e Move fsGroupPolicy from NewMounter to SetUpAt
getFSGroupPolicy needs to get CSIDriver from the API server, which may not
be available during volume reconstruction at kubelet startup.
2022-10-25 11:10:11 +02:00
Jan Safranek
04183005e4 Move lifecycle checks from NewMounter to SetUpAt
The checks need to get CSIDriver from the API server and the API server may
not be the case when NewMounter is called during volume reconstruction.
2022-10-24 17:30:51 +02:00
Jan Safranek
f76efd0400 Move CSI json file saving to SetUpAt()
When saving a json state file in NewMounter, we risk the json file will not
be cleaned when SetUpAt() fails. Move it to SetUpAt() instead.
2022-10-18 14:19:06 +02:00
Mikko Ylinen
fbcdf48bb8 grpc: set localhost Authority to unix client calls
Several reports exist (both with device plugins and CSI) that
kubelet w/ grpc-go sends invalid Authority header and some non
grpc-go servers reject these unix domain socket client connections.

grpc-go sets the Authority header correct when the dial address
is in a format where the its address scheme can be determined.

Instead of making changes to get the all server addresses to unix://
prefixed format, set grpc.WithAuthority("localhost") client connection
override to get the same result.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-20 13:15:36 +03:00
Kubernetes Prow Robot
60e2f6c519
Merge pull request #112509 from humblec/new-1
various corrections in pkg/volume
2022-09-19 09:09:18 -07:00
Hemant Kumar
8d1e2e0faa Do not return err if CSIdriver is not found
while checking for selinux support
2022-09-16 15:53:03 -04:00
Humble Chirammal
f22a74aa6a various corrections in pkg/volume
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-09-16 16:42:06 +05:30
Takashi Kusumi
b35ea96d9a Fix incorrect "Invalid attach limit" error when maxAttachLimit is 0 2022-09-09 09:32:51 +09:00
Davanum Srinivas
9bbf01bae9
Remove references to openstack and cinder
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-08-22 16:43:14 -04:00
Léiyì Zhang
ea0fe5a33e remove const that's not used 2022-08-04 15:55:17 -07:00
Jonathan Dobson
5f774832a5 Move CSIInlineVolume feature to GA 2022-08-04 13:06:30 -06:00