Commit Graph
2135 Commits
Author SHA1 Message Date
Satoru Takeuchi 6af014b798 ceph: fix hostpath of osd to avoid data corruption
A directory is created under dataDirHostPath for each OSD. In host-based cluster,
its name is constructed from kernel device name like _dev_sdb though user specifies
udev persistent device name. We should use unique name among all OSDs.

Closes: https://github.com/rook/rook/issues/7878

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-05-12 01:31:46 +00:00
Sébastien Han 4f63e88ad5 Merge pull request #7877 from Rakshith-R/cleanup/csi-sts-dep
ceph: remove redundant csi statefulset template path vars
2021-05-11 18:00:57 +02:00
Travis Nielsen 169b225be5 Merge pull request #7867 from subhamkrai/crash-collector
ceph: create crash collector pods after secret created
2021-05-11 07:18:42 -06:00
Sébastien Han 87154dfe9c Merge pull request #7726 from sp98/pdb-controller-changes
ceph: update podDisruptionBudget controller for OSD
2021-05-11 15:02:22 +02:00
subhamkrai b4efd9f8f4 ceph: create crash collector pods after secret created
there was confusion regarding crash collector pods
in pending state which was basically due to secret
`rook-ceph-crash-collector-keyring` was not created
till mons are in quorum. this commit creates crash
collector pods after secret `rook-ceph-crash-collector-keyring`
is created.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-11 17:52:38 +05:30
Rakshith R e9f0136b13 ceph: remove redundant csi statefulset template path vars
This commit removes redundant `RBDProvisionerSTSTemplatePath` and
`CephFSProvisionerSTSTemplatePath` variables which were forgetten to
be removed in https://github.com/rook/rook/pull/5982 when csi support
for k8s 1.13 was removed.

Signed-off-by: Rakshith R <rar@redhat.com>
2021-05-11 14:36:15 +05:30
Sébastien Han 19de2b28e9 ceph: allow heap dump generation when logCollector is not running
We don't need to set log_file to empty string since "log_to_file" is set
to False. This is probably an old leftover/hack we were doing in the
past when "log_to_file" and other related options were not there.

Because of this line
https://github.com/ceph/ceph/blob/master/src/perfglue/heap_profiler.cc#L99,
Ceph looks for the log_file conf option. In our case it was empty, so
the logging would default to the current directory which points to the
container runtime root when not set and we don't have permission to
write there.

We now force it to Ceph's default so that existing cluster will get the
fix after upgrading.

Just removing the option allows us to get dump in /var/log/ceph.
Phew, what a bug!

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-10 17:21:04 +02:00
Santosh Pillai aee8f56853 ceph: update podDisruptionBudget controller for OSD
This PR has following changes around OSD pdbs
- Detect node drains more reliably. When OSD is down and OSD pod is not scheduled to any node or if the scheduled node is not ready, then assume that node is draining.
- Don't set no-out flag on the failure domain if the OSD is down due to reasons other than node drain (say disk failure)
- update unit tests
- update design doc to reflect above changes

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-05-10 12:59:40 +05:30
Travis Nielsen 33d784d937 Merge pull request #7526 from parth-gr/operator-debug-logs
core: enhancement in debug logs
2021-05-06 10:41:28 -06:00
Shachar Sharon 2a3cfc693b ceph: allow setting primary-affinity to osd
A user with unbalanced system (e.g., some OSDs use a partition which
resides on a device along-side OS partition) may want to have a
fine-grained control on the overall load of specific OSD. While osd
weight affects write-load, primary-affinity affects read-load.

This patch allow user to define osd's primary-affinity (similar to
'DeviceClass' and 'InitialWeight'), which is sent to the osd (via mon)
as part of deployment sequence, using 'ceph osd primary-affinity' command.

Valid values are within the range [0.0, 1.0). If not set, default value
is 1.

ROOK issue: https://github.com/rook/rook/issues/7773

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2021-05-06 17:46:15 +03:00
Travis Nielsen af1d728ba6 Merge pull request #7801 from sp98/mon-failover-on-drain
ceph: retry once before mon failover if mon pod is unscheduled
2021-05-05 12:39:05 -06:00
Santosh Pillai f38829b57d ceph: retry once before mon failover if mon pod is unscheduled
Events like node drain can take more than 10-15 minutes. If the node is not update the default monTimeOut of 10 minutes, then rook will attempt to fail over the mon. This failover won't work as the node is still down.
This PR retries once before the mon failover if the mon pod is not scheduled

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-05-05 23:32:27 +05:30
Rakshith R 7987e1b8a2 ceph: update snapshot APIs from v1beta1 to v1
This commit updates external-snapshotter version to
v4.0.0 which supports snapshots v1.
Rook now defaults to enabling RBD and CephFS snapshotter
for K8s >= v1.17 and disabling it for K8s <= v1.16.
Supporting changes in documents and examples yaml files
are made.

Signed-off-by: Rakshith R <rar@redhat.com>
2021-05-05 21:04:10 +05:30
Travis Nielsen ce50eb2407 ceph: remove unused volumesource schema from cephcluster
The VolumeSource type was only used internally when loading
the storageClassDeviceSets. The volumeSource element is never
expected to be specified in the CephCluster CR, so it is now
removed from the schema. The VolumeSource type is renamed to
deviceSet for clarity.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-03 11:54:46 -06:00
Sébastien Han 15a12577f5 ceph: fix external mode setup
Because of the recent CRD changes made, the mon count had a minimum of
1, making the configuration of the external cluster impossible. The
operator would fail to add the finalizer:

```
2021-04-29 16:57:38.429451 E | ceph-cluster-controller: failed to reconcile. failed to add finalizer: failed to add finalizer "cephcluster.ceph.rook.io" on "test-external": CephCluster.ceph.rook.io "test-external" is invalid: spec.mon.count: Invalid value: 0: spec.mon.count in body should be greater than or equal to 1
```

We now fixed the CRD as well as adding the CR status.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-03 12:07:40 +02:00
Travis Nielsen 2b9bd2af1a Merge pull request #7445 from jshen28/fix-upgrade-mds
ceph: complete missing steps of upgrading mds
2021-04-29 07:21:35 -06:00
shenjiatong 21bb12a20d ceph: upgrade mds fix typos
fix some nits on error wraps and logging

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-04-29 16:45:08 +08:00
Ali Maredia c9fee1f883 ceph: ensure object store endpoint is initialized for user
when store.Status was not initialized it caused
crashes when assigning store.Status.Info["endpoint"]
to objContext.Endpoint.

This commits makes sure store.Status is not Nil
before setting objContext.Endpoint and
objContext.SecureEndpoint in the ObjectStoreUser
controller.

Closes: https://github.com/rook/rook/issues/6916
Signed-off-by: Ali Maredia <amaredia@redhat.com>
2021-04-28 21:47:34 -04:00
shenjiatong 41f775ec17 ceph: make sure standbys are stopped
wait and make sure standbys are stopped before
continuing to upgrade the primary mds daemon.

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-04-29 08:12:29 +08:00
shenjiatong 81f888260b ceph: reset max_mds and allow_standby_replay in deferred function
set fsPreparedForUpgrade to true for upgrading mds, to
make sure that max_mds is set back to active count
after all mds agent gets upgraded

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-04-29 08:06:39 +08:00
shenjiatong 58f6b495af ceph: complete missing steps of upgrading mds
Upgrading mds requires extra steps than simply
replacing ceph image. see https://docs.ceph.com/en/latest/cephfs/upgrading/
for reference.

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-04-29 08:06:38 +08:00
Blaine Gardner 6ee626b3aa Merge pull request #7764 from thotz/obcsslfix
ceph: support for OBC operations if it uses TLS RGW endpoint
2021-04-28 14:27:08 -06:00
Travis Nielsen 6af362abd4 Merge pull request #7768 from travisn/skip-upgrade-checks-log
ceph: Clarify log message to continue with upgrade if needed
2021-04-28 13:19:23 -06:00
parth-gr bb23622b72 core: enhancement in debug logs
When DEBUG logging is enabled in the operator, there are a number of overwhelming messages in the log that are very overwhelming and don't seem useful, which makes debug mode difficult to use
Updated and Cutted down the messages that are not useful in debug mode

Closes: https://github.com/rook/rook/issues/7499
Signed-off-by: parth-gr <paarora@redhat.com>
2021-04-28 22:28:10 +05:30
Jiffin Tony Thottan a5a5661e5f ceph: add security spec to object store spec
Add `SecuritySpec` to specify kms details for rgw in `ObjectStoreSpec` than using existing
`SecuritySpec` used for `ClusterSpec`. The vault secret engines conflict with OSD and RGW
kms encrytpion

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-28 14:39:39 +05:30
Jiffin Tony Thottan 3ef3e8b72e ceph: check for kv engine version for SSE RGW
The "https://docs.ceph.com/en/latest/radosgw/vault/" says RGW supports only version v2 of
kv engine, so pod won't start if the admin didn't provide "VAULT_BACKEND" in security.kms.ConnectionDetails

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-28 13:03:22 +05:30
Jiffin Tony Thottan 8e5c6c126c ceph: modify ValidateConnectionDetails() in kms
The ValidateConnectionDetails() contains `clusterSpec` assuming `SecuritySpec` only
part to `cephCluster` CRD. But we may need to validate same for `SecuritySpec` in
`cephObjectStore` CRD. Hence modifying the signature of the api.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-28 13:03:16 +05:30
Jiffin Tony Thottan f9c7634d88 ceph: support for OBC operations on enabled TLS RGW endpoint
OBC operations will fail if RGW only enabled HTTPS. With this change, OBC operations
will use needed TLS certs to succeed the operation.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-28 12:37:38 +05:30
Jiffin Tony Thottan 7a5928d2c5 ceph: add api to fetch cacert for RGW server
Rook operator sends S3 to RGW server for bucket operations performed by healthchecker,
bucketprovisioner etc. Add api to fetch cacert if the TLS enabled for RGW.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-28 12:25:36 +05:30
Blaine Gardner b60c495561 Merge pull request #7704 from alrs/nfs-multiple-imports
nfs: fix multiple imports
2021-04-27 15:47:34 -06:00
Travis Nielsen 6f61d95dc3 ceph: clarify log message to continue with upgrade if needed
The ceph upgrade blocks if the ceph heatlh is HEALTH_ERR. If the user
wants to force the upgrade despite the health error, they will need
to set skipUpgradeChecks: true in the cephcluster CR. This message
will hopefully make that setting more discoverable.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-04-27 11:31:28 -06:00
Travis Nielsen 08f896e865 ceph: detect the osd topology affinity during upgrade
The nodeAffinity for portable OSDs is needed to ensure the OSDs are
tied to the same zone or other failure domain where the OSD was
prepared and where it is expected to run. During upgrade the topology
affinity was not being detected since the osd prepare job is skipped
in that case. Now the topology will be detected from the running
OSD daemon pod's node.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-04-27 08:51:51 -06:00
Satoru Takeuchi 2beaa5db79 Merge pull request #7719 from cybozu-go/ceph-simplify-cmd-timeout
ceph: unity timeout values of commands
2021-04-27 07:12:36 +09:00
Satoru Takeuchi 709e8d5ba8 ceph: unity timeout values of commands
There is no strong reason to have different timeout values.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-04-26 12:57:40 +00:00
Jiffin Tony Thottan 809a8d174c test: adding unit test for service serving cert
include unit tests for the new apis and functionality introduced by the feature
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-26 18:23:29 +05:30
Jiffin Tony Thottan aea21d9c84 ceph: service server cert support for rgw
Service serving certificates are intended to applications that require
encryption in openshift. These certificates are issued as TLS web server
certificates. Currently RGW supports TLS authentication with help of
certs passed as secrets, in this case we add following details as
`service.annotations` in the Objectstore Gateway Spec :
```
service:
  annotations:
    service.beta.openshift.io/serving-cert-secret-name: <name for
autogenerated secret>
```

More details about service serving cert can be found at :
https://docs.openshift.com/container-platform/4.6/security/certificates/service-serving-certificate.html

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-26 18:15:12 +05:30
Nitin Goyal 99bc72d79f ceph: stop using updatePVCIfChanged and start using ExpandPVCIfRequired
delete updatePVCIfChanged method on "Cluster" from osd package and use
the common one ExpandPVCIfRequired from k8sutil pkg

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
2021-04-23 08:47:49 +05:30
Nitin Goyal 3575c3bf78 ceph: expand Mon Pvc's
Expand Mon Pvc's if storage request has increased for the Mons in the
cephcluster crd.

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
2021-04-23 08:47:49 +05:30
Nitin Goyal 2e8f513197 core: add func ExpandPVCIfRequired in k8sutil pkg
ExpandPVCIfRequired will expand PVC if and only if current PVC size is
less than the desired PVC size.

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
2021-04-23 08:47:49 +05:30
parth-gr 80a9b26bfd ceph: operator loops forever over existing nodes
When the node get added to the cluster the operator always watches for node events and starts a reconcile when a node is ready.
Checking the Node if they already have OSDs present and stopping them from reconcile.

Closes: https://github.com/rook/rook/issues/7534
Signed-off-by: parth-gr <paarora@redhat.com>
2021-04-22 22:38:08 +05:30
parth-gr f6bd25ae01 ceph: update OSDs reconcile
OSDs not automatically started when adding nodes to existing cluster.
Call the helper NormalizeCrushName(name) to make sure the node name can match the name in the crush map before querying for the node in the crush map, and reconcile when new nodes get added.

Closes: https://github.com/rook/rook/issues/7462
Signed-off-by: parth-gr <partharora1010@gmail.com>
2021-04-22 20:40:14 +05:30
Madhu Rajanna 6bc3c1ac3a ceph: update cephcsi to v3.3.1
As we have cephcsi v3.3.1 release
with couple of bug fixes and a CVE fix
updating the cephcsi to latest release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-04-22 13:57:01 +05:30
Lars Lehtonen 50a57985bf nfs: fix multiple imports
This removes multiple imports.

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2021-04-20 12:57:12 -07:00
Shachar Sharon 9766e9b8fb ceph: allow passing 'osd-crush-initial-weight'
Ceph support the option '--osd-crush-initial-weight' upon OSD start,
which sets an explicit weight (in TiB units) to specific OSD. Allow
passing this option all the way from the user (similar to
'DeviceClass'), for the special case where end users wants it cluster
to have non-even balance over specific OSDs (e.g., one of the OSDs is
placed over a partition alongside OS-partition).

ROOK issue: https://github.com/rook/rook/issues/7448

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2021-04-20 20:50:54 +03:00
Sébastien Han c9dfd43f35 ceph: remove rbd-mirror ceph config/key
After the peer is imported via a token, ceph internally stores the
information of the remote cluster. So the rbd-mirror daemon does not
need to have files (key and config) for the remote site.
This means lighter code for us, as well no more restarts for the
rbd-mirror daemon once a peer is added to the configuration.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-04-20 16:55:09 +02:00
Travis Nielsen 56e7af3ee0 Merge pull request #7331 from thotz/healthcheckwhensslenabled
ceph: fix healthcheck in case ssl enabled for rgw
2021-04-20 08:32:17 -06:00
Jiffin Tony Thottan 70f94a2d3c ceph: removing serviceIP from bucketChecker struct
serviceIP is not used by the health bucket checker, hence removing it.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-20 14:24:11 +05:30
Jiffin Tony Thottan bcbe707bcb ceph: fix healthcheck incase ssl enabled for rgw
In case ssl enabled for RGW, bucket healthcheck won't work since access is denied from the server.
In that case configure S3 agent using "InsecureSkipVerify: true" option.

Fixes: 7288
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-04-20 14:23:48 +05:30
Rakshith R f5a3f6fa71 ceph: add option to toggle host networking in csi plugin pods
As host networking is no longer necessary for CSI driver,
it will be disabled by default.
An option CSI_ENABLE_HOST_NETWORK is added to rook-ceph-operator-config
configmap and enableCSIHostNetwork in helm chart values.yaml to
enable/disable host network in CSI plugin pods.

Closes: #7203

Signed-off-by: Rakshith R <rar@redhat.com>
2021-04-20 12:57:09 +05:30
Sébastien Han ca1cf6672e ceph: always apply config flags for mds and rgw
We now always set the config flags on reconcile. Previously we were
looking for non-existing rgw or mds which means that on upgrade we would
never set those flags. However, we want to set those flags on "old"
cluster that got upgraded.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-04-19 17:39:43 +02:00