Commit Graph

159 Commits

Author SHA1 Message Date
王怀宗
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
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
Madhu Rajanna
8f07c9efcc remove unused param from function
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-03-04 19:01:25 +05:30
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
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
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
ce3affcc6a cephfs: DeleteVolume should assume the volume to be already deleted if metadata doesn't exist 2019-02-25 18:07:28 +01: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
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
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
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
Madhu Rajanna
bf7ec10fea Remove glog from Gopkg.toml
replace klog with glog

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-08 13:51:22 +05:30
Humble Chirammal
c9da8469ad migrate cephfs code to use klog instead of glog
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-02-05 12:09:04 +00:00
Madhu Rajanna
5983fedddb Fix issues found in gometalinter static check
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-02-04 10:44:37 +05:30
Madhu Rajanna
50ba8ed446 Fix gometalinter issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-29 11:24:36 +05:30
Madhu Rajanna
ca2e475296 Fix gometalinter issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-29 11:23:50 +05:30
Madhu Rajanna
7a0c233c27 Fix issues found in gometalinter
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-29 11:20:35 +05:30
Madhu Rajanna
008c82c1e7 Fix gometalinter issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-29 11:20:35 +05:30
Madhu Rajanna
25642fe404 Add method comments
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-29 11:20:35 +05:30
Madhu Rajanna
7fcbdfb945 Fix template to add userID
Fix Node server

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:20:32 +05:30
Madhu Rajanna
1a246f7bf3 simplify the error check
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:16:03 +05:30
Madhu Rajanna
36f99e36ca Fix unparam issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:16:03 +05:30
Madhu Rajanna
284c5801c3 Fix golint issue
pkg/rbd/rbd.go:67:65⚠️ exported func NewNodeServer
returns unexported type *rbd.nodeServer, which can be
annoying to use (golint)

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:16:03 +05:30
Madhu Rajanna
4c564207c6 Fix error checking issue in json Decode
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:15:25 +05:30
Madhu Rajanna
1d11d0acc3 Fix lint issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:15:25 +05:30
Madhu Rajanna
5eb1974e38 Fix vetshadow issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:15:25 +05:30
Madhu Rajanna
75beccd8c0 Remove unused variable
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:14:48 +05:30
Madhu Rajanna
fa78c00535 update struct names and struct fiels
it wont be meaningful to call cephfs.NewcephfsDriver()
to get a new driver, it will be better if we call
cephfs.GetNewDriver() which returns the cephfs driver
object.

same goes for rbd also

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:14:48 +05:30
Madhu Rajanna
15b5b0112e rename Id to ID to fix lint issue
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:14:48 +05:30
Madhu Rajanna
de1f099680 Remove unused struct fields
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:10:52 +05:30
Madhu Rajanna
9f76f6bd59 Remove dead code
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-25 14:10:52 +05:30
Huamin Chen
c6c496ff59 switch to node registrar 2019-01-22 14:46:41 -05:00
Huamin Chen
0151792684 review feedback: make monValueFromSecret override monitors if both are set
Signed-off-by: Huamin Chen <hchen@redhat.com>
2019-01-21 09:21:03 -05:00
Huamin Chen
db463edeef allow ceph mon stored in secret so when mon changes, cephfs driver can get latest mons and override old ones
Signed-off-by: Huamin Chen <hchen@redhat.com>
2019-01-18 10:27:48 -05:00
Madhu Rajanna
e42e66ff30 user errors.New if error formatting is not required
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-16 18:54:13 +05:30
Madhu Rajanna
20af5afcab Fix golint issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-16 18:33:38 +05:30
Madhu Rajanna
9ddc265c10 reject block volume creation in cephfs
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2019-01-16 18:17:14 +05:30
Huamin Chen
85b8415024 Merge branch 'master' into master-to-1.0 2019-01-15 16:15:30 +00:00
mickymiek
b387daaabf remove useless comment 2019-01-14 20:15:09 +00:00
mickymiek
62d65ad0cb cm metadata persist for rbd and cephfs 2019-01-14 20:15:09 +00:00
gman
29bdeb2261 cephfs: don't set quotas for zero-sized volumes 2019-01-14 20:15:09 +00:00
Mike Cronce
d9fbdeb517 pkg/cephfs: Use request name to generate deterministic volume names 2018-12-04 21:39:00 -05:00
Mike Cronce
04872e5ebf Merge branch 'master' of github.com:ceph/ceph-csi into csi-v1.0.0 2018-12-04 16:28:37 -05:00
Mike Cronce
37caeb5b2c pkg/cephfs/driver.go: Updated PluginFolder to use new CSI 1.x directory 2018-12-04 15:38:09 -05:00
gman
ed811e0506 cephfs: don't set quotas for zero-sized volumes 2018-12-01 10:39:09 +01:00
Mike Cronce
af3083f717 pkg: Updated "version" variables from 0.3.0 to 1.0.0 2018-11-29 13:15:52 -05:00
Mike Cronce
41b30eb6c2 pkg/cephfs: Updated for new versions of CSI/Kubernetes dependencies 2018-11-24 13:48:36 -05:00
Kenjiro Nakayama
c1e072de0b Fix misspelling of "successfully" 2018-09-21 23:08:23 +09:00
gman
3c11129149 cephfs: ceph user is created in CreateVolume and deleted in DeleteVolume 2018-08-28 10:21:11 +02:00
gman
9c3389d784 cephfs/util: log execCommandJson; cache mount.New() instance 2018-08-28 10:19:28 +02:00
gman
12958d0a9a cephfs/cephuser: fixed getCephUser
output from `ceph auth -f json get` contains non-JSON data in the beginning
workaround for this is searching for the start of valid JSON data (starts with "[{")
and start reading from there
2018-08-28 10:13:53 +02:00
gman
6ddf98addf cephfs: cache available volume mounters 2018-08-14 16:48:30 +02:00
gman
c515a013d3 cephfs: volumemounter probe
The driver will now probe for either ceph fuse/kernel every time
it's about to mount a cephfs volume.

This also affects CreateVolume/DeleteVolume where the mounting
was hard-coded to ceph kernel client till now - mounter configuration
and probing are now honored.
2018-08-14 11:19:41 +02:00
Róbert Vašek
069140e74a
Merge pull request #65 from clkao/execCommandJson-error
Log error output for execCommandJson as well.
2018-08-08 17:58:52 +02:00
Chia-liang Kao
a1de128a81 Log error output for execCommandJson as well. 2018-08-08 23:39:19 +08:00
gman
1c38412e39 cephfs: CSI 0.3.0; NodeStageVolume/NodeUnstageVolume; refactoring 2018-08-08 14:47:25 +02:00
Huamin Chen
4331960ab3
Merge pull request #55 from nak3/nonempty
Add nonempty option to ceph-fuse to support ReadWriteMany
2018-08-07 14:14:57 -04:00
Kenjiro Nakayama
e8784ec094 Logging command and options for debug friendly
Some commands were executed in ceph-csi, but users do not know what
commands with what options were executed. Hence, it is difficult to
debug once the command did not work fine.

This patch adds logging what commmand and options are executed.
2018-07-31 15:31:11 +09:00
Kenjiro Nakayama
b649d4f1f6 Add nonempty option to ceph-fuse to support ReadWriteMany
fuse mount does not allow to mount directory if it contains some
files. Due to this, currently scaled pod with cephfs failed to mount
by ceph-fuse.

This patch adds nonempty option to ceph-fuse command to support
ReadWriteMany with ceph-fuse.
2018-07-31 14:44:33 +09:00
Masaki Kimura
753dbc2303 Fix Cephfs plugin to return false to ValidateVolumeCapabilities if Block volume is specified
Cephfs doesn't have a feature to provide Block Volume, therefore it should return false to ValidateVolumeCapabilities if Block Volume is specified.

Fixes #44
2018-07-10 16:48:55 +00:00
gman
675ee93e46 cephfs: DeleteVolume() calls are allowed only for volumes with provisionVolume=true parameter 2018-06-13 16:29:10 +02:00
gman
8c53b5eb79 cephfs: Identity Service advertises PluginCapability_Service_CONTROLLER_SERVICE 2018-06-12 17:09:44 +02:00
gman
0cc1e06beb cephfs: createCephUser needs admin credentials 2018-06-12 17:08:14 +02:00
gman
b260bff659 cephfs: CreateVolume() needs ceph config 2018-06-12 17:07:20 +02:00
gman
2fcc252f5c cephfs: pass volume UUIDs where needed 2018-06-12 17:05:42 +02:00
gman
f45ddd7c9d cephfs: cephuser: set config and admin explicitly when creating/deleting users 2018-06-12 17:03:45 +02:00
gman
cc88d2fa09 cephfs: cephconf: include volume UUID in keyrings/secrets 2018-06-12 17:02:14 +02:00
gman
0ba3174bbc cephfs/NodePublishVolume: fix error message 2018-05-23 10:28:25 +02:00
gman
1a7b365b95 cephfs: ceph config filename is now mixed with volume UUID 2018-05-18 18:17:37 +02:00
gman
bf89151b87 cephfs: ceph.conf is created in NodePublishVolume instead of CreateVolume 2018-05-18 18:15:37 +02:00
gman
77469c8370 cephfs/volumecache: fixed error msg 2018-04-20 16:24:13 +02:00
gman
8844452453 cephfs/nodeserver: create a new user if necessary; updated NodeUnpublishVolume 2018-04-13 15:53:43 +02:00
gman
a2160e88a7 cephfs/controllerserver: create volume if provisionVolume=true; implemented DeleteVolume 2018-04-13 14:54:40 +02:00
gman
886fdccb9b cephfs: added mounter probing and --volumemounter cmd arg 2018-04-13 14:53:17 +02:00
gman
b7d856e562 cephfs/volume: added createVolume and purgeVolume 2018-04-13 14:49:49 +02:00
gman
c21d05a536 cephfs/cephconf: added cephFullCapsKeyring 2018-04-13 14:38:44 +02:00
gman
58eb8d1de7 updated cephfs/util 2018-04-13 14:34:48 +02:00
gman
88ca7077ae added cephfs/cephuser 2018-04-13 14:31:46 +02:00
gman
8fd5478aa1 added cephfs/credentials 2018-04-13 14:31:03 +02:00
gman
cc6921fbd3 moved cephfs mounting logic to volumemounter 2018-04-13 14:29:54 +02:00
gman
62f271056a added cephfs/volumecache - stores volume info in json files 2018-04-13 14:28:59 +02:00
gman
69ecce1e75 cephfs/volumeidentifier: changed volume ID scheme
volumes have "csi-cephfs-dyn-" prefix when they are provisioned dynamically (provisionVolume=true)
and have "csi-cephfs-sta-" prefix when they are provisioned statically by the user (provisionVolume=false)
2018-04-13 14:24:40 +02:00
gman
374176c6ce cephfs/volumeoptions: added fields; validate values
added Pool and ProvisionVolume fields
Mounter is now optional
2018-04-13 14:21:15 +02:00
gman
61103bbc47 cephfs/cephconf: workaround for http://tracker.ceph.com/issues/23446 2018-03-26 15:01:13 +02:00
gman
cb36c9e4c8 cephfs: code cleaning 2018-03-26 15:00:28 +02:00
gman
4c5c67b8f9 cephfs: check volumeOptions.Mounter and choose ceph-fuse or mount.ceph accordingly 2018-03-22 14:14:57 +01:00
gman
defc676b3d cephfs/volume: added the ability to use either FUSE or ceph kernel client 2018-03-22 14:14:57 +01:00
gman
9fefc270d8 cephfs/controllerserver: write ceph.conf 2018-03-20 16:40:30 +01:00
gman
aa4130865c cephfs/nodeserver: read credentials from Secret 2018-03-20 16:40:30 +01:00