Commit Graph
5036 Commits
Author SHA1 Message Date
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
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
Sébastien Han 6a5d958236 Merge pull request #4803 from leseb/target_size_ratio
ceph: ability to set target_size_ratio
2020-02-06 10:22:05 +01:00
Sébastien Han cface95317 ceph: ability to set target_size_ratio
target_size_ratio is used the tell the Ceph cluster the excepted
occupancy of a pool in the cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-06 09:13:47 +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 d0c2de9c94 Merge pull request #4820 from travisn/disable-csi-owner-ref
Remove owner references to csi driver
2020-02-05 17:17:29 -07:00
Travis Nielsen dff7cddc87 Merge pull request #4811 from leseb/unclean-pvc
ceph: fail if no devices found
2020-02-05 16:15:59 -07:00