Commit Graph
37 Commits
Author SHA1 Message Date
Madhu Rajanna 7f14b52ba6 CSI: update ceph-csi from v1.2.1 to v1.2.2
cephcsi v1.2.2 release is out and the image is available
for use, updating rook to use latest available release
image

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-11-21 10:59:20 +05:30
Madhu Rajanna 49381b322d CSI: update kubernetes sidecar images
update csi sidecar images to fix CVE-2019-11255

more info:
https://github.com/kubernetes/kubernetes/issues/85233
https://github.com/kubernetes-csi/external-snapshotter/issues/193
https://github.com/kubernetes-csi/external-provisioner/issues/380

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-11-19 10:20:12 +05:30
ShyamsundarR 48a0decc49 CSI: Make attach mandatory in ceph CSIDriver object
A recent PR #4172 added the ability for rook to create
the CSIDriver object on a kubernetes cluster. The change also
made it so that attachRequired value in the ceph CSI drivers
were set to false.

This leads to the entire attach skipping the AD controller
that deals with RWO attachment enforcement. Thus, if a
CephFS volume is marked RWO, 2 pods on different hosts can
end up mounting the same and consuming it at the same time.

Further for RBD, currently the image watchers are the only ones
that prevent a double mount of an image, other than the AD controller
enforcement of single attach for RWO RBD PVs. This has proven
not to be reliable in the face of MON failures, as the watcher
information is lost, and a second mount is allowed.

Thus, we need to bring back the attach requirement to leverage
kubernetes checks and balances for RWO volume type, and
prevent unwanted multi-attach use of the same.

This PR hence undoes some of the changes introduced by the
PR #4172, to bring the attacher side car back, and also declare
the attachRequired for both RBD and CephFS CSI plugins as true.

NOTE: Initially the attachRequired was set to false as this
improved attach times considerably on kubernetes, as the
entire phase was being avoided.

Signed-off-by: ShyamsundarR <srangana@redhat.com>
2019-11-15 16:15:53 -05:00
Madhu Rajanna 9b368ef15c CSI: Create CSIDriver Object
This will be helpful to list the CSI drivers
deployed in the kubernetes cluster. if we have
N number of CSI drivers deployed in the cluster,
the user can query kubectl get csidriver and get
the list of registered CSI drivers and it requires
kube 1.14+

This removes the deployment of Attacher sidecar container,
as we are setting the attacher required to false during
the CSIDriver object creation.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-11-06 11:18:03 +05:30
Song Gao 8d0e6ea36d ceph: add label for CSI deployments/daemonsets/statefulsets
Add rook version label to CSI deployments/daemonsets/statefulsets just as the Ceph daemons.

Signed-off-by: Song Gao <2695690803@qq.com>
2019-10-24 23:42:45 +08:00
Sébastien Han 98bc8e4ca0 ceph: revert "CSI: Add support for CSIDriver object creation"
I merged https://github.com/rook/rook/pull/4169 too quickly and didn't
noticed we were supposed to wait for csi 1.2.2.

This reverts commit 520ad44d71.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-24 12:30:11 +02:00
Madhu Rajanna 520ad44d71 CSI: Add support for CSIDriver object creation
This will be helpful to list the CSI drivers deployed
in the kubernetes cluster. if we have N number of
CSI drivers deployed in the cluster, the user can
query kubectl get csidriver and get  the list of
registered CSI drivers and it requires kube 1.14+
and also the functionality is disabled by default

More info here: https://github.com/ceph/ceph-csi/pull/698

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-10-24 15:08:26 +05:30
Sébastien Han fcc2e21faf ceph: rework csi keys and secrets
We know create 4 secrets containing 4 ceph keys where each of them have
limited permissions to access the cluster.

Closes: https://github.com/rook/rook/issues/4074
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-22 15:14:28 +02:00
Blaine Gardner 24d2187f1a ceph: set default Ceph CSI images as var not const
Set the default Ceph CSI images as vars in the code instead of consts.
This allows these values to be overridden at build time with Go linker
-X flags. This allows users to build Rook in such a way that it will
automatically update the CSI images to a custom opinionated default
without having to manually manage the environment variable-based
overrides at upgrade time.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-09-30 12:15:32 -06:00
Madhu Rajanna f54099df0c CSI: Make metrics and liveness port configurable
provided ENV variables to configure the grpc
and liveness metrics port for both cephfs and
rbd CSI drivers.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-27 17:31:45 +05:30
Madhu Rajanna 9d298fe4f0 Add Toleration and NodeAffinity to CSI
Add support for setting Toleration and NodeAffinity
to CSI Provisioner deployment or statefulset and
plugin daemonset through ENV variables.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-27 10:23:12 +05:30
Madhu Rajanna ec9784203e Add check for csi volumes before cluster delete
Add a finalizer to the CephCluster to check
the PV created by CSI so that we can block the
cluster deletion till the PVC are deleted.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-26 20:15:11 +05:30
Madhu Rajanna 0a516d5f32 use v1.2.1 cephcsi release
update CSI deployment templates and
doc to use new cephcsi v1.2.1 release

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-25 16:08:55 +05:30
Madhu Rajanna bdfdac8ee4 Update service if already present
previously we are not updating the service
if it's already present. with this change,
we will update the service. this does not
trigger any error message if service
already present.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-24 09:43:02 +05:30
Madhu Rajanna 345f099bbc Make kubelet path configurable in operator
currently CSI templates have hardcoded kubelet
path which will  be used for  mounting PVC,this
will not work if kubelet is configured to use
different path, with this PR  kubelet path
can be configured for CSI.

Fixes: #3921

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-20 18:51:44 +05:30
Madhu Rajanna b64768ee39 Use release ceph-csi version
replace canary tag with release ceph-csi
v1.2.0 tag

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-05 16:10:30 +05:30
Madhu Rajanna a8589af337 Implement grpc metrics for cephcsi
grpc metrics is made option in rook
this can be disabled/enabled with ROOK_CSI_ENABLE_GRPC_METRCS
variable in operator.yaml
this will help admin who want to check the grpc metrics
of the ceph-csi plugins

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-30 15:01:45 +05:30
Madhu Rajanna 8d5d9b9117 Fix liveness service creation
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-30 13:16:55 +05:30
Madhu Rajanna 11293393ca Fix logging in csi
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-30 13:16:55 +05:30
Madhu Rajanna 78fb35a93d Use Deployment with leader election instead of StatefulSet
Deployment behaves better when a node gets disconnected
from the rest of the cluster - new provisioner leader
is elected in ~15 seconds, while it may take up to
5 minutes for StatefulSet to start a new replica.

if kube version is 1.13.x deploy provisioner as statefulset.
if kube version is higher than 1.14+ deploy provisioner
as deployment.

Refer: kubernetes-csi/external-provisioner@52d1fbc
Refer: ceph/ceph-csi#497

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-26 19:29:37 +05:30
Madhu Rajanna fcf6250df9 remove unused files related to cephcsi
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-26 15:45:23 +05:30
Sébastien Han 83eca4b7ae ceph: fix various debug messages
Debug was used instead of Debugf so types were not interpreted
correctly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
John Mulligan 55b871060f ceph csi: add additional error handling for csi related functions
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 7c5bd58878 ceph csi: ensure the required namespace env var is set
Return an error if the function that updates the csi config map
can not determine a valid namespace for the config map.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 12c48ba375 ceph: refactor csi related code into a new file in csi package
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 9f6c0ba2c5 csi: prevent trivial conflicts between ceph csi instances with a prefix
Add a prefix to the csi drivername when ceph csi is deployed by rook.
This aims to prevent trivial conflict between csi instances when two
rook operators are deployed into the same cluster. By default the
prefix is the "<rook-namespace>." but can by customized on the cli
and via environment vars.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 2b1ae54b84 ceph csi: clean up how templates are expressed
Avoid using global values that are not used anywhere in the code.
Split the object used to express the ceph csi templates into two
so only values that are set globally need to be managed globally,
all other values can be stored in the temporary local struct.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 08219a4492 ceph: update a cross-cluster csi configmap when mons change
Instead of requring csi instances for every ceph cluster that rook
manages, maintain one config map for all ceph clusters. This allows
for one set of csi drivers per rook operator.
The config is intialized as empty when Ceph CSI components are first
created and then updated every time a cluster's mons change.
As before clusters are identified by the k8s namespace the ceph cluster
is running in.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 76abdc2ae4 csi: set csi global vars to false by default
Thes values being defaulted "on" cause issues with some of the units
tests but add no additional value to the normal rook ceph binaries
because they are immediately overwritten by the values set on the
command line (and env).

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
travisn af72af0633 add option to disable flex driver
The flex driver does not need to be started if
only the CSI drivers are going to be used. Therefore,
we allow the admin to stop launching the rook flex
agent with the setting ROOK_ENABLE_FLEX_DRIVER in
operator.yaml

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:01:26 -06:00
travisn 0a3fbf62f3 enable the ceph-csi driver by default
CSI is now the preferred storage driver for Rook.
By default both the CSI and flex drivers will be started
by the operator. In a future release the flex driver
will be deprecated, but for now is still supported.

The drivers can be disabled with an environment
variable in the operator deployment in operator.yaml.
If users are only using one driver or the other there is
no need to enable both drivers.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:00:41 -06:00
Madhu Rajanna 71f369303e update rook to use ceph-csi canary version
ceph-csi canary version is close to ceph-csi v1.1.0
release

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-06-25 17:15:46 +05:30
John Mulligan 7ee207b0fb ceph csi: tweak options handling around enabling csi
Simplify one function and improve option wording.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-04-10 17:53:28 -04:00
Madhu Rajanna d9dd81396c remove attacher statefulset for rbd csi driver
deploy attacher as a container inside  rbd provisioner
stateful set

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-04-10 18:27:08 +05:30
Madhu Rajanna d99527382d replace fmt.Errorf with errors.New
if error formatting is not required
we can we errors.New()

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-04-09 15:48:16 +05:30
Huamin Chen 1b21e42a90 convert extensions to apps
Signed-off-by: Huamin Chen <hchen@redhat.com>
2019-02-14 16:06:05 -05:00
Huamin Chen 3806baffe1 add ceph csi deploy options
Signed-off-by: Huamin Chen <hchen@redhat.com>
2019-02-12 21:20:41 -05:00