As a safeguard against the error case described in #4934, this
change sets BlockOwnerDeletion to false on the ownerReference
of all Ceph CSI resources.
Signed-off-by: Elise Gafford <egafford@redhat.com>
Checks the version of the configured ceph-csi image while starting the operator. The operator will fail if the image is not supported.
Added an additional parameter to operator to disable the check e.g. to test not yet supported csi images.
Signed-off-by: Stefan Haas <shaas@suse.com>
Prior attempts to delete CSI drivers using owner references to the
Ceph ConfigMap resulted in garbage collection of the driver
resources as described in rook#4590. This patch manually deletes these
resources by name as a stopgap to provide an appropriate user
experience while the team investigates this issue further.
Resolves: rook#4824
Signed-off-by: Elise Gafford <egafford@redhat.com>
This commit is to handle all those unhandled errors which raises the gosec warning.
Fixed G104: Unhandled Errors are handled now
Signed-off-by: Nizamudeen <nia@redhat.com>
This commit is also part of gosec error handling which handles the following issue:
Fixed G304: Potential File inclusion by cleaning up the file path
Signed-off-by: Nizamudeen <nia@redhat.com>
This commit fixes the gosec warning
G101: Potential hardcoded credential variable by adding a #nosec tag and relavant comment
Signed-off-by: Nizamudeen <nia@redhat.com>
"rook-ceph-operator-config" can be used to override Env Var
initialized during operator deployment.
This commit makes use of the ConfigMap to determine NodeAffinity
and Tolerations for ceph-csi drivers.
Closes#3239
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
The owner references for the csi driver are causing the csi driver
to disappear when the garbage collector rebuilds its references.
To unblock production clusters we remove the owner references
until we can find the correct fix for the owner references.
Neither the apiVersion of v1 or core/v1 is working.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
The CSI driver was disappearing in some clusters after certain events such
as restarting the operator or master nodes being restarted. This is due to
an incorrect owner reference on the csi driver back to the configmap. The
owner reference must specify core/v1 instead of v1 for the APIVersion
of the configmap. This issue is only hit when the k8s garbage collector
rebuilds its cache, which would happen at indeterminate times from
Rook's perspective.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
Currently there is no option to turn on and off the
log level verbosity in csi containers, This PR adds
the functionality to select logging levels for csi containers.
Fixes: #4690
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
external-attacher v2.x is not compatible with v1.x
This PR makes the require changes in csi templates
and upgrade documentation for easily upgrade
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
CSI nodeplugins, specifically when using cephfs FUSE or
rbd-nbd as the mounters, when upgraded, will
cause existing mounts to become stale/not-rechable
(usually connection timeout errors).
This is due to losing the mount processes running within the
CSI nodeplugin pods.
This PR add updated the Daemonset update strategy
based on the ENV variable to take care of above issue
with some manual steps
Moreinfo: https://github.com/ceph/ceph-csi/issues/703
Resolves: https://github.com/rook/rook/issues/4248
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
There are two issues at odds with the cephfs driver. The
first is that older kernels less than 4.17 do not support
quotas so PVC sizes will not be enforced with the kernel
driver in that case. If the FUSE client is used instead, there
are issues during upgrade because the client mount will be
disrupted and the client pods will have to restart.
To prevent client pods from breaking during upgrade, we enable
the kernel driver by default. If the quotas are critical,
the admin will need to take steps during upgrade to prevent
breaking the applications.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
In ceph-csi v1.2.2 we have add a flag `forcecephkernelclient`
to force use Ceph Kernel clients on kernel < 4.17 which
support quotas for Cephfs
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
When using the "errors" package, using `%+v` (extended format),
each Frame of the error's StackTrace will be printed in detail.
Let's only print `%v` to print the error.
If the error has a Cause it will be printed recursively.
Basically `%+v` has been replaced with `%v` for all `error` type
interfaces, whether the logger is Info, Warning or Error.
Signed-off-by: Sébastien Han <seb@redhat.com>
As of 14.2.5, the crash collector pod will use the client.crash user
instead of the client.admin keyring to post crash dumps.
Closes: https://github.com/rook/rook/issues/4388
Signed-off-by: Sébastien Han <seb@redhat.com>
we need to set a ENV `CSI_RBD_ENABLE_SNAPSHOTTER`
variable to "false" in operator template to disable
deployment of snapshotter sidecar in ceph-csi rbd
provisioner.
Fixes: #4401
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
We create CSI resources when we create the first Ceph cluster.
This change deletes all CSI resources when we delete the last Ceph
cluster.
Partially resolves: #4234
Signed-off-by: Elise Gafford <egafford@redhat.com>
In order to facilitate the deletion of CSI resources, this patch
adds ownerReferences to all CSI deployments, daemonsets, and
services. This ownerRef refers to the CSI ConfigMap in all cases.
Partially resolves#4234
Signed-off-by: Elise Gafford <egafford@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>