Commit Graph
3904 Commits
Author SHA1 Message Date
Nizamudeen 53883f68cf ceph: Handling Unhandled errors
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>
2020-02-21 22:48:24 +05:30
Travis Nielsen e35939b26c ceph: bump ceph version to v14.2.7
The ceph/ceph:v14.2.7 image is released so we can pick these fixes
up as the recommended version of ceph.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-20 11:06:40 -07:00
Sébastien Han a702f463cc ceph: set crush device class via annotations on PVC
When the OSD on PVC is backed by a metadata block PVC, the Ceph CRUSH
device class should be set to something else rather than the rotational
property of the drive.

Closes: https://github.com/rook/rook/issues/4881
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-20 18:53:31 +01:00
Travis Nielsen a9903ed8d7 ceph: fix status for EC pool creation
Creating an EC pool was succeeding, but then the update to the
status was failing because of an incorrect check for changing EC
parameters. Now we correctly check if EC parameters are changing
unexpectedly.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-18 15:34:01 -07:00
Travis Nielsen 10ddf4b0df tests: retry wiping devices if failed
The job to wipe devices fails the integration tests periodically.
Now the job will be retried once if it fails to retry wiping the
disks.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-17 22:27:13 -07:00
Travis Nielsen 41fe8c3a2b ceph: call the ParentClusterChanged in a goroutine
When the cluster is upgraded, the child controllers are notified with the
callback to the ParentClusterChanged() method. These should be made
in a separate goroutine so that the cluster controller is not blocked
on the child controllers and also so child controllers aren't blocked
on each other for the upgrade.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-17 16:24:28 -07:00
Travis Nielsen 6090ad1385 Merge pull request #4863 from crombus/encoders
ceph: Add encoders for input and output of ceph
2020-02-17 11:34:18 -07:00
crombus ae110fc517 ceph: Add comment that sprintf formatting is safe
This commits adds comment for safety of using
sprintf formatting

Closes: https://github.com/rook/rook/issues/4575
Signed-off-by: crombus <pkundra@redhat.com>
2020-02-17 18:04:24 +05:30
Sébastien Han 2b5aa9a413 Merge pull request #4874 from muff1nman/limit-namespace-watch
Limit namespace watches when ROOK_CURRENT_NAMESPACE_ONLY is true
2020-02-17 10:23:26 +01:00
Andrew DeMaria 60ec9c35fa ceph: limit watches to configured namespace
When ROOK_CURRENT_NAMESPACE_ONLY is true, watches should be limited to
the configured namespace

Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
2020-02-14 18:34:57 -07:00
Travis Nielsen 22fde10aaa Merge pull request #4865 from nizamial09/credential
rook: Fixing the potential hardcoded credential warnings
2020-02-14 08:48:28 -07:00
Nizamudeen 78ef4abeec ceph: Fixing the potential file inclusion error
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>
2020-02-14 12:22:49 +05:30
Nizamudeen a42e180ad8 ceph: Fixing the potential hardcoded credential warnings
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>
2020-02-14 12:18:51 +05:30
Sébastien HanandSean Micklethwaite b04e35dab5 ceph: add support for disk selection by full path
Rook-Ceph now supports specify device by their fullpath instead of links
created by the kernel like /dev/sdb.

Closes: https://github.com/rook/rook/issues/1228
Co-authored-by: Sean Micklethwaite <sean@wayve.ai>
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-13 17:31:38 +01:00
Sébastien Han 45118185cf ceph: remove mimic support, default to nautilus
As of 1.3, Rook will only support Ceph Nautilus 14.2.5.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-13 09:17:34 +01:00
Sébastien Han 04ee2d91fd ceph: populate CSI configmap for external cluster
The configmap for csi wasn't created so csi wasn't working.

Closes: https://github.com/rook/rook/issues/4816
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-12 17:58:53 +01:00
Sébastien Han 836f30d5ed Merge pull request #4817 from umangachapagain/csi-placement-config
Ceph: adds "rook-operator-config" configmap
2020-02-12 15:37:19 +01:00
Sébastien Han abafb08699 Merge pull request #4603 from galexrt/fix_4528
k8sutil: set ResourceVersion for PrometheusRule
2020-02-12 11:40:04 +01:00
Umanga Chapagain 7b201b8dae Ceph: adds "rook-ceph-operator-config" configmap
"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>
2020-02-12 14:07:03 +05:30
Sébastien Han e1dc677714 ceph: implement osd block expansion on PVC
When running on PVC, if the backend resizes the block, Rook will expand
it and the size of the OSD will grow.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-11 18:33:50 +01:00
Sébastien Han c08c3ced05 ceph: add support for metadata PVC for OSD on PVC
We now support the addition of the PVC that acts as a metadata device
for a given OSD.
For this, you need to create a new `volumeClaimTemplates`, its name must
be "metadata" otherwise, Rook won't pick it up.

A template will look like this:

```
volumeClaimTemplates:
- metadata:
    name: data
  spec:
    resources:
      requests:
        storage: 10Gi
    # IMPORTANT: Change the storage class depending on your environment (e.g. local-storage, gp2)
    storageClassName: gp2
    volumeMode: Block
    accessModes:
      - ReadWriteOnce
- metadata:
    name: metadata
  spec:
    resources:
      requests:
        storage: 6Gi
    # IMPORTANT: Change the storage class depending on your environment (e.g. local-storage, gp2)
    storageClassName: gp2
    volumeMode: Block
    accessModes:
      - ReadWriteOnce
```

We now map block and block.db directly inside the container instead of
running ceph-volume activate. This is much cleaner.

Closes: https://github.com/rook/rook/issues/3852
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-11 17:30:02 +01:00
Sébastien Han 7390940acd ceph: osd add missing annotation
Setting annotation on pvc deployments too so that we don't
restart/update deployment is not necessary.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-11 17:25:51 +01:00
Alexander Trost 430e4dc0f4 k8sutil: set ResourceVersion for PrometheusRule
This change sets the ResourceVersion on the PrometheusRule object before
it is updated in Kubernetes.
This change fixes the following error
```
is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update
```
which can occur during update when no ResourceVersion is set.

Resolves #4528

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2020-02-10 13:36:46 +01:00
Travis Nielsen 12ff5ab54a Merge pull request #4830 from leseb/octopus-support-osd
ceph: allow osd full upgrade to octopus
2020-02-06 16:25:54 -07:00
Travis Nielsen c46aeffc4f Merge pull request #4584 from jmolmo/issue_4565
ceph: Remove ineffectual assignments
2020-02-06 11:26:34 -07:00
Sébastien Han 25d6d27a8a ceph: allow osd full upgrade to octopus
Once osds will run on octopus we will activate the necessary features
for these OSDs.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-06 18:40:04 +01:00
Sébastien Han e906b02ead ceph: add more ceph version checks
We need to be able to know which version we are running on.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-06 17:27:11 +01:00
Sébastien Han 2e9ee105ed ceph: nits from https://github.com/rook/rook/pull/4679
- Use %q when possible
- don't use fmt.Errorf
- use the right type when returning errors

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-06 16:40:19 +01:00
Travis Nielsen e487480487 Merge pull request #4679 from rohantmp/drainFix
Ceph: Improve detection of drain-canaries and info-log significant nodedrain scheduling events
2020-02-05 23:53:32 -07:00
Travis Nielsen b6cf2c7ebf ceph: remove owner references to csi driver
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>
2020-02-05 15:21:55 -07:00
crombus 767f8d9c4c ceph: Fix md5 crypto to more secure sha256
This commit fixes md5 crypto to more efficent crypto
sha256 and fix test according sha256.

Closes: https://github.com/rook/rook/issues/4572
Signed-off-by: crombus <pkundra@redhat.com>
2020-02-05 22:31:47 +05:30
Rohan CJ eaab7b161d Ceph: Info log significant events in the nodedrain controller.
Info log events where a drain canary is either scheduled on a new node
or removed from a node.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2020-02-05 16:24:56 +05:30
Rohan CJ 9d1419864e Ceph: Improve detection of stale canaries.
In the case where the node disappears abrubtly,
there was nothing to trigger the nodedrain reconciler to clean up
the stale canary.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2020-02-05 16:21:22 +05:30
Maksim Nabokikh 7dc9ec1191 cassandra: JMX prometheus exporter
Export prometheus metrics for cassandra in sidecar container

Signed-off-by: Maksim Nabokikh <maksim.nabokikh@flant.com>
2020-02-03 11:40:38 +04:00
Travis Nielsen 57fb7cda2e Merge pull request #4714 from Madhu-1/log-level
CSI: Add LogLevel for csi templates
2020-01-31 11:54:32 -07:00
Travis Nielsen bf28fb5f3b Merge pull request #4784 from leseb/enable-balancer
ceph: ability to enable the balancer module
2020-01-31 08:54:04 -07:00
Travis Nielsen 48499115f8 ceph: fix garbage collection for csi driver
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>
2020-01-31 07:21:59 -07:00
Sébastien Han 488b27a5b7 ceph: ability to enable the balancer module
The balancer module is a special module that needs particular actions to
be enabled.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1790500
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-01-31 11:33:41 +01:00
Madhu Rajanna 48a6e493e8 CSI: Add LogLevel for csi templates
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>
2020-01-31 15:04:11 +05:30
Sébastien Han 6a9f2aec82 Merge pull request #4777 from leseb/tune-slow-dev-fix
ceph: fix TuneSlowDeviceClass spec
2020-01-30 13:58:20 +01:00
Sébastien Han a60a18c477 ceph: fix TuneSlowDeviceClass spec
TuneSlowDeviceClass wasn't part of the StorageClassDeviceSet types but
only in VolumeSource which is not exposed in the CR spec so setting the
option would never work.
The only issue is that this apply to all volumeClaimTemplates
where each can point to a particular storage class...

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-01-30 11:59:18 +01:00
Nizamudeen 4b55a74ac4 ceph: Implementing Conditions on rook-ceph
Fixed conditions getting resetted after the operator restart.
Did the changes which required to implement conditions on the rook ceph cluster
Conditions will eliminate the current status.State and incorporates a type which
provides much more description to the current status of the cluster.

Signed-off-by: Nizamudeen <nia@redhat.com>
2020-01-30 10:21:11 +05:30
Travis Nielsen 0a684fa84c Merge pull request #4549 from jmolmo/issue_3764
Ceph: Assure mon canary pods deletion
2020-01-29 12:32:03 -07:00
Travis Nielsen bd3c618cef Merge pull request #4767 from Madhu-1/nil-check
ceph: Add nil check for ceph version
2020-01-29 11:59:53 -07:00
Dmitry Yusupov b4139b364e Merge pull request #4766 from SergeyKaydalov/edgefs-resources-fix
edgefs: memory/CPU resources limits fix
2020-01-29 09:17:33 -08:00
Juan Miguel Olmo Martínez b4ae856c70 Ceph: Assure mon canary pods deletion
If for any cause the operator processing a mon failover is restarted, the
mon canary pods created in order to get the right placement for this
kind of pods can remain in <pending> state forever.

The following labels have been added to the mon canary deployments:
"mon_type" = "canary"
"canary_pvc_name" = <PVC name used for the canary pod>

A separate <removeCanaryDeployments> has been implemented for
removing the dependence of the variable <canaryCleanup>.
This function uses the <canary> labels to obtain the <real>
and <existing> list of mon canary deployments in any moment.

This change, by itself, will avoid most of the problems with
pending canary pods, but as second safe guard measure a call to this
function has been added in the health check, to <force> a canary pod
deletion if the cluster of monitors is healthy and complete (this implies
that no canary pods should be present)

Resolves #3764

[test ceph]

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
2020-01-29 17:13:15 +01:00
Madhu Rajanna 34e1585f54 ceph: Add nil check for ceph version
as CephVersion is pointer added a nil check
for CephVersion in status to avoid panic.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-01-29 19:34:30 +05:30
Sergey Kaydalov db788da967 edgefs: trlogKeepDays is a fractional value
The trlogKeepDays has to expressed as a fraction of a day: 0.5, 0.1 and etc

Signed-off-by: Sergey Kaydalov <kayserg@gmail.com>
2020-01-29 13:03:13 +02:00
Travis Nielsen ec7f06b52b Merge pull request #4680 from jmolmo/mdszones
Ceph: MDS pod placement adheres to fault domain topology
2020-01-28 16:19:53 -07:00
Madhu Rajanna 1cab0985d5 CSI: Add log if the CSI volume expansion is not supported
Added warning log in opeartor, if csi volume
expansion is not supported.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-01-28 23:50:23 +05:30