Commit Graph
1747 Commits
Author SHA1 Message Date
Travis Nielsen 69c9ed4206 ceph: storage warn iare specified but ignored
In the cluster CR the nodes element will be ignored under storage when
useAllNodes is true. The nodes will only be applied when useAllNodes is
false. It is a common usability problem that users can't figure out
why their nodes are not configured. At least this log entry can give
them a clue.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-05 18:26:32 -07:00
Travis Nielsen 0eee2b4dee ceph: always mount /dev in the osd prepare pod
The osd prepare job is now always working with devices so
we always need to mount /dev and run privileged. There is
no scenario for not mounting /dev since filestore support
was removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-05 18:15:58 -07:00
Sébastien Han a137b31e1a ceph: refactor controller helper
Clean and refactor code helper for controller-runtime.
Implement those into the block pool controller.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-05 12:37:44 -07:00
Nizamudeen 3296fc64a9 ceph: Follow up for adding the state variable
Changed back the status.State to the exact way it was implemented on the ceph cluster. Added the States as a Constant and used that constant to call the status.State.

Signed-off-by: Nizamudeen <nia@redhat.com>
2020-03-04 18:57:07 +05:30
Travis Nielsen 65f3f84ab0 tests: ensure pools are purged during integration tests
With a finalizer on the pools, the pools were not always being purged
during the integration tests. Now the multicluster suite will ensure
its pool is purged.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-03 19:44:23 -07:00
Nizamudeen 3b9456ed61 ceph: Adding status.state variable and assigned it to status.phase
Most of the OLM UI currently uses status.Phase to show the status of the cluster and in some case it uses status.State to show the information.
Having them both for now and slowly deprecating the uses of status.state is the most appropriate way to do now.

Signed-off-by: Nizamudeen <nia@redhat.com>
2020-03-03 11:13:03 +05:30
Elise Gafford 9a2e8f88e2 ceph: set BlockOwnerDeletion=false for csi driver ownerReference
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>
2020-03-02 15:52:56 -05:00
Travis Nielsen f263a828ad Merge pull request #4935 from shaas/is4934
Ceph: Ceph CSI fails to start. #4934
2020-03-02 13:19:51 -07:00
Sébastien Han a3068dee0b ceph: separate controller for CephBlockPool CRD
Now, the CephBlockPool CRD is managed with the controller-runtime.
So the watcher is outside of the main controller reconciliation loop of
CephCluster which brings numerous benefit such as:

* having its own reconciliation loop
* won't block anything from the main CephCluster controller loop
* fast than waiting for CephCluster loop to completion

Partially close: https://github.com/rook/rook/issues/1981
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-02 17:31:03 +01:00
Stefan Haas 84cac45d2c Ceph: Ceph CSI fails to start. #4934
Signed-off-by: Stefan Haas <shaas@suse.com>
2020-03-02 16:27:59 +01:00
Sébastien Han acab9b0ead ceph: enable command debug when DEBUG
Only print command debugs if the operator log level is DEBUG.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-02 09:29:48 +01:00
Sébastien Han 9f13cba8be ceph: print command output
Print the output so that we can parse it and silence it if we want.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-02 09:29:48 +01:00
Sébastien Han 65e1c054a3 ceph: only print command when running debug mode
We don't need commands e run under the hood. Enable debug logs to see
that.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-02 09:29:48 +01:00
Stefan Haas b3cc4aeb44 ceph: ceph-csi version detection #3824
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>
2020-02-28 14:14:40 +01:00
Sébastien Han ca21442c20 Merge pull request #4903 from egafford/delete-csi-drivers
ceph: delete CSI drivers with deletion of last cluster
2020-02-28 10:46:34 +01:00
Elise Gafford de2c409d79 ceph: delete CSI drivers with deletion of last cluster
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>
2020-02-27 19:06:23 -05:00
Nizamudeen 0382cc3c60 ceph: Failed Condition to the external rook-ceph cluster
This commit will add a phase and also a condition to display a Failed status on the external rook-ceph cluster if its failed to establish a connection.

Signed-off-by: Nizamudeen <nia@redhat.com>
2020-02-27 11:34:08 +05:30
Travis Nielsen bcb99d86ce crds: pick up the rook types in the v1 package
The rook types used across the storage providers moved from the v1alpha2
package to the v1 package. This commit points the packages at their new
location. Implementation is expected to remain unchanged.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-26 11:18:17 -07:00
Travis Nielsen 6807a0566d crds: move supporting types from v1alpha2 to rook.io/v1
The types that are used in CRDs across the storage providers do not need
to be in the v1alpha2 package. These should be declared stable in the v1
package. The only types remaining in the v1alpha2 package are the flex
volume types, which will never graduate since their replacement is the
csi driver.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-26 11:18:17 -07:00
Sébastien Han dab9233c8b ceph: add CRD setting for pool size 1
As of Octopus, Ceph will prevent you from creating a pool with a
replica size of 1. Allowing such pool could lead to data loss, so enable
the new option: requireSafeReplicaSize: false if you are **ABSOLUTELY**
certain that is what you want.

Closes: https://github.com/rook/rook/issues/4889
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-25 16:28:58 +01:00
Sébastien Han 5ca4880ed0 Merge pull request #4888 from leseb/pvc-hybrid-dev-class
ceph: set crush device class via annotations on PVC
2020-02-25 14:07:22 +01:00
Sébastien Han ccef1f5601 Merge pull request #4867 from nizamial09/error_handling
rook: Handling Unhandled errors
2020-02-25 09:27:58 +01:00
Blaine Gardner a871010337 Merge pull request #4906 from SUSE/nfs-ganesha-no-rook-container
ceph: nfs do not use rook binary
2020-02-24 12:46:51 -05:00
Blaine Gardner 5d2199dc87 ceph: nfs do not use rook binary
Do not use the Rook binary to generate minimal config for Ceph's
NFS-Ganesha pods. Instead, `cat` the minimal file in an init container
using the Ceph container.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-02-24 08:24:25 -07:00
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 d81d2ff61d ceph: remove obsolete ceph.conf settings
The Ceph daemons no longer use the ceph.conf for settings generated
by the operator. The operator only generates the ceph.conf in order
to connect to the mons and configure the cluster. Now we reduce
to the minimal required settings.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-02-20 16:30:35 -07:00
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
Travis Nielsen 7877a4b10e Merge pull request #4844 from leseb/pvc-osd-expand
ceph: implement osd block expansion on PVC
2020-02-11 12:32:26 -07:00
Sébastien Han edbf8d3732 Merge pull request #4843 from leseb/balancer-clients
ceph: force enabling balancer module with older clients
2020-02-11 20:26:50 +01:00
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 b6c1cb13a5 ceph: force enabling balancer module with older clients
When running old client version, we must force the compatibility
features so that the orchestration does not fail in a loop.

Closes: https://github.com/rook/rook/issues/4842
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-11 18:25:15 +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