Commit Graph

195 Commits

Author SHA1 Message Date
王怀宗
4ec3a5777a code style 2019-03-29 16:09:05 +08:00
王怀宗
043d3603ff remove unuse var 2019-03-29 10:51:11 +08:00
王怀宗
5b53e90ee4 fix code style 2019-03-29 10:18:59 +08:00
王怀宗
af330fe68e 1. fix mountcache race conflict
2. support user-defined cache dir
    3. if not define mountcachedir disable mountcache
2019-03-27 16:04:58 +08:00
王怀宗
b318964af5 issue #91
issue #217

Goal

we try to solve when csi exit unexpect, the pod use cephfs pv can not auto recovery because lost mount relation until pod be killed and reschedule to other node. i think this is may be a problem. may be csi plugin can do more thing to remount the old path so when pod may be auto recovery when pod exit and restart, the old mount path can use.

NoGoal

Pod should exit and restart when csi plugin pod exit and mount point lost. if pod not exit will get error of **transport endpoint is not connected**.

implment logic

csi-plugin start:

	1. load all MountCachEntry  from node local dir
	2. check if volID exist in cluster, if no we ignore this entry, if yes continue
	3. check if stagingPath exist, if yes we mount the path
	4. check if all targetPath exist, if yes we binmount to staging path

NodeServer:

1. NodeStageVolume: add MountCachEntry on local dir include readonly attr and ceph secret
2. NodeStagePublishVolume: add pod bind mount path to MountCachEntry  and persist local dir
3. NodeStageunPublishVolume: remove pod bind mount path From MountCachEntry  and persist local dir
4. NodeStageunStageVolume: remove MountCachEntry  from local dir
2019-03-25 22:47:39 +08:00
John Griffith
d79ca5bc90 Merge branch 'csi-v1.0' into default_multiwrite_blockmode 2019-03-19 08:02:14 -06:00
j-griffith
6ec1196f47 Rework multi-node-multi-writer feature
This commit reverts the initial implementation of the
multi-node-multi-writer feature:
  commit: b5b8e46460

It replaces that implementation with a more restrictive version that
only allows multi-node-multi-writer for volumes of type `block`

With this change there are no volume parameters required in the stoarge
class, we also fail any attempt to create a file based device with
multi-node-multi-write being specified, this way a user doesn't have to
wait until they try and do the publish before realizing it doesn't work.
2019-03-18 10:07:06 -06:00
Róbert Vašek
a4dd845735
Merge pull request #223 from Madhu-1/fix-222-1.0
update driver name as per csi spec
2019-03-14 06:38:13 +01:00
j-griffith
a164169fd3 Revert "Add multiNodeWritable option for RBD Volumes"
This reverts commit b5b8e46460.
2019-03-13 18:26:46 -06:00
Madhu Rajanna
d61a87b42e Fix driver name as per CSI spec
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-13 12:04:30 +05:30
Róbert Vašek
2a25666109
Merge pull request #249 from Madhu-1/fix-return
Fix return error codes
2019-03-12 17:25:05 +01:00
Madhu Rajanna
dd41295900 store volume size in bytes in configmap
during volume creation we check volume size in
bytes, and even during listing of volumes and
snapshots we need to check size in bytes

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-12 18:37:10 +05:30
Madhu Rajanna
9f5ac5eeaa Fix return error codes
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-07 18:29:07 +05:30
Róbert Vašek
b07211739c
Merge pull request #238 from Madhu-1/fix-image-size
Fix image size
2019-03-05 12:12:04 +01:00
Madhu Rajanna
16279eda78 Roundup volume size to Mib for rbd
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-04 19:17:28 +05:30
Madhu Rajanna
0fd091fa7f skip errcheck
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-04 19:02:10 +05:30
Madhu Rajanna
8f07c9efcc remove unused param from function
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-04 19:01:25 +05:30
j-griffith
72edf06916 Fix obsolete comment
Had a stray comment that got left behind during refactoring, move it
back to where it's relevant and reword it a bit to fit the finished
product.
2019-03-01 22:36:46 +00:00
j-griffith
b5b8e46460 Add multiNodeWritable option for RBD Volumes
This change adds the ability to define a `multiNodeWritable` option in
the Storage Class.

This change does a number of things:
1. Allow multi-node-multi-writer access modes if the SC options is
enabled
2. Bypass the watcher checks for MultiNodeMultiWriter Volumes
3. Maintains existing watcher checks for SingleNodeWriter access modes
regardless of the StorageClass option.

fix lint-errors
2019-03-01 21:59:57 +00:00
Huamin Chen
d938944528
Merge pull request #233 from gman0/fuse-unmount-wait
cephfs: wait for FUSE to exit after unmount
2019-02-27 15:00:28 -05:00
gman
b779009770 parse ceph-fuse PID with regexp 2019-02-27 20:29:20 +01:00
Madhu Rajanna
6f4f148d3b remove glog
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-27 14:17:19 +05:30
Madhu Rajanna
fdc0d8255a move csi-common to ceph-csi
kubernetes/driver/csi-common is no
longer maintained.

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-27 14:17:19 +05:30
gman
3a0d048186 cephfs/volumemounter: unmountVolume now waits till the ceph-fuse daemon exits 2019-02-26 17:57:24 +01:00
Huamin Chen
dfcd1c33c3
Merge pull request #232 from gman0/cephfs-concurrency-fix
cephfs concurrency fix
2019-02-26 09:40:32 -05:00
Madhu Rajanna
1cedbf0eee sort volume ID's for rbd volume list
looping over a map is not guaranteet
to be ordered.
we need to sort the volume ID's for
ListVolume rpc  for rbd plugin.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-02-26 14:35:16 +00:00
Madhu Rajanna
e861f12a60 Fix review comments
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-02-26 14:35:16 +00:00
Madhu Rajanna
3b320ef19e Add support of RBD list volumes
currently all the created volumes are
stored in the metadata store, so we
can use this information to support
list volumes.

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-26 14:35:16 +00:00
gman
2f8931315a don't attempt to delete mountpoint if unmount failed 2019-02-26 14:46:21 +01:00
gman
143003bcfd cephfs: added locks for {Create,Delete}Volume, NodeStageVolume 2019-02-26 11:06:25 +01:00
gman
60588d8968 cephfs/volume: create/delete-volume idempotency checks 2019-02-26 11:06:16 +01:00
gman
d12fdfd400 rbd: fixed metadata idempotency in DeleteVolume; DeleteSnapshot should assume the snapshot to be already deleted if metadata doesn't exist 2019-02-25 18:09:21 +01:00
gman
ce3affcc6a cephfs: DeleteVolume should assume the volume to be already deleted if metadata doesn't exist 2019-02-25 18:07:28 +01:00
gman
e5dbea15d3 util/cachepersister: check and return CacheEntryNotFound error in Get() 2019-02-25 18:05:20 +01:00
Huamin Chen
e627a6166c
Merge pull request #220 from Madhu-1/skip_cred_log
remove  secret and key  from logging
2019-02-25 08:04:38 -05:00
Madhu Rajanna
68e69502e8 remove secret and key from logging
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-02-21 17:05:24 +05:30
gman
0235b9c249 k8s metadata cache: delete shouldn't fail on NotFound errors 2019-02-20 20:20:44 +01:00
Róbert Vašek
bc256aa755
Merge pull request #211 from Madhu-1/clean-up
cleanup: remove duplicate code
2019-02-19 15:50:46 +01:00
Madhu Rajanna
fd4c019aba cleanup: remove duplicate code
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-19 13:44:10 +05:30
Madhu Rajanna
e91a59d2f9 RBD: Remove dead code
during volume creation we are validating
that volume name cannot be empty,removing
this check as we are not going to hit
this case

Fixes: #204

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-19 12:17:40 +05:30
Madhu Rajanna
6fbde110cd skip redundant error check
correct misspelled  word

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-18 17:16:59 +05:30
gman
49f5d4a54e fix lint error 2019-02-14 21:31:52 +00:00
gman
1803a1be97 rbd: don't delete volume/snapshot if metadata creation fails 2019-02-14 21:31:52 +00:00
gman
8223ae325b addressed review comments 2019-02-14 13:55:51 +00:00
gman
96bf4a98bd cephfs: don't need to store keyrings anymore 2019-02-14 13:55:51 +00:00
gman
8e371f62fa cephfs: ceph-fuse mimic supports passing keys via args, let's use it 2019-02-14 13:55:51 +00:00
gman
b3944f3121 cephfs exec: read stdout and stderr separately 2019-02-14 13:55:51 +00:00
gman
892d65d387 added StripSecretInArgs in pkg/util 2019-02-14 13:55:51 +00:00
gman
a63b06a620 cephfs: specify monitors explicitly 2019-02-13 14:09:33 +00:00
gman
9cd0786569 cephfs/volume: fixed incorrect path for unmountAndRemove 2019-02-12 17:39:54 +01:00