Commit Graph
464 Commits
Author SHA1 Message Date
Sébastien Han 929853b652 ceph: remove ROOK_VERSION from the mgr pod
Because of this, the mgr would be restarted if the operator image
change. This must not happen.
Added unit tests for cephMgrOrchestratorModuleEnvs() as well.

Closes: https://github.com/rook/rook/issues/4361
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 15:40:36 +01:00
Sébastien Han 088548a7f3 Merge pull request #4360 from travisn/upgrade-log-msg
Clarify log message for Ceph upgrades
2019-11-25 23:31:53 -08:00
Travis Nielsen 87e2b09453 ceph: clarify log message for Ceph upgrades
Some log messages indicate when the upgrade checks will be
performed. If the Ceph image hasn't changed, the upgrade checks
are skipped. The messages were confusing if running a Rook
upgrade.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-11-22 09:03:03 -07:00
Sébastien Han c3370ef3c6 ceph: add missing pod sec context for crash
When running on OCP we must use priv containers so that we can chown the
hostpath dir properly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-19 07:18:02 -08:00
Blaine Gardner f32cecb701 Merge pull request #3206 from d-luu/ceph_priority_classes
ceph: added priority classes to components
2019-11-18 11:27:57 -07:00
Sébastien Han 7ac4b01a4d Merge pull request #4320 from leseb/lvm-skip
ceph: osd various lvm enhancement
2019-11-18 09:32:18 -08:00
d-luu 9c755fac66 ceph: added priority classes to components
Adds priority class support to Ceph components
  to influence scheduler's pod preemption

Signed-off-by: d-luu <david@davidluu.info>
2019-11-15 16:28:41 -06:00
Sébastien Han 3e82a0f4a6 ceph: osd add env var to skip uded on lvm
With DM_DISABLE_UDEV, LVM will avoid interaction with udev.
LVM will manage the relevant nodes in /dev directly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-15 22:54:03 +01:00
Sébastien Han 91b76cc24c doc: update design links
Since we re-organized the design directory we need to update the links
in various files.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-15 11:29:46 +01:00
Sébastien Han 314394f464 Merge pull request #4281 from rohantmp/consolidated
Ceph: Fix topology logic for drains.
2019-11-13 16:37:09 +01:00
Rohan CJ 1ba2633c27 Ceph: Clean up canaries on nodes that no longer have OSDs or when the node is deleted.
This prevents long-lasting false positives that prevent the ordered progression
of drains.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-11-13 16:04:45 +05:30
Rohan CJ dd3f0ca63c Ceph: Set the drain-canaries deployment ownerReference to the rook operator.
The drain canary was not being garbage collected properly.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-11-13 16:04:45 +05:30
Sébastien Han d9679e5cf4 Merge pull request #3316 from leseb/ceph-crash
ceph: add ceph-crash controller
2019-11-12 23:16:02 +01:00
Sébastien Han a0fdf1bb5f ceph: add CEPH_VOLUME_SKIP_RESTORECON env var
This will tell ceph-volume not to run any restorecon commands.

This relies on https://github.com/ceph/ceph/pull/31421

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-12 16:27:20 +01:00
Sébastien HanandRohan CJ 90cd8224f4 ceph: add ceph-crash controller
A new controller to bootstrap ceph-crash pod on Ceph nodes running Ceph
pods only.

This implementation is unfortunately a mix of 'hacks' to make the daemon
working correclty. The ceph-crash script faced different issues:

* it's not a daemon
* it does not have any key in cephx
* it runs ceph commands under the hood which need an admin key and a
ceph.conf

On upstream Ceph, ceph-crash needs to grow better, once that happens we
will improve our implementation.

This also enhances osd provisionConfig struct with DataPathMap

Pod volumes and volume mount needs DataPathMap to perform the right
actions on log and crash dir. Exposing DataPathMap makes that possible.

Obviously, this is exposing ceph crash reports on the host as
well as pushing them into the mgr.
Basically, if a daemon fails, it'll put its core dump into
/var/lib/ceph/crash, bindmounting this dir on the host, ensures that the
crashes don't get lost when the pod dies.

Example:

```
[leseb@tarox~/go/src/github.com/rook/rook][rgw-liveprobe !] kubectl -n rook-ceph exec -ti rook-ceph-crashcollector-minikube-574858b99c-zvg4z bash
bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]# ceph crash ls

[root@rook-ceph-osd-2-7644f99695-cljzh /]# pidof ceph-osd
13258 5415 5397
[root@rook-ceph-osd-2-7644f99695-cljzh /]# kill -SIGABRT 13258
[root@rook-ceph-osd-2-7644f99695-cljzh /]# ls /var/lib/ceph/crash/
2019-11-12_12:56:51.404109Z_39f060e1-776d-4605-8f28-85c97e53de96     posted

... wait maximum 10 min (ceph-crash scraps every 10 minutes)
... the container will exit

[root@rook-ceph-osd-2-7644f99695-cljzh /]# exit
[leseb@tarox~/go/src/github.com/rook/rook][rgw-liveprobe !]
[leseb@tarox~/go/src/github.com/rook/rook][rgw-liveprobe !] kubectl -n rook-ceph exec -ti rook-ceph-crashcollector-minikube-574858b99c-zvg4z bash
bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]#
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]#
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]# ceph crash ls
2019-11-12_12:56:51.404109Z_39f060e1-776d-4605-8f28-85c97e53de96 osd.1
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]# ls /var/lib/ceph/crash/
posted
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]# ls /var/lib/ceph/crash/posted/
2019-11-12_12:56:51.404109Z_39f060e1-776d-4605-8f28-85c97e53de96
[root@rook-ceph-crashcollector-minikube-574858b99c-zvg4z /]# tail /var/lib/ceph/crash/posted/2019-11-12_12\:56\:51.404109Z_39f060e1-776d-4605-8f28-85c97e53de96/log
   1/ 5 mgr
   1/ 5 mgrc
   1/ 5 dpdk
   1/ 5 eventtrace
  -2/-2 (syslog threshold)
  -1/-1 (stderr threshold)
  max_recent     10000
  max_new         1000
  log_file /var/lib/ceph/crash/2019-11-12_12:56:51.404109Z_39f060e1-776d-4605-8f28-85c97e53de96/log
--- end dump of recent events ---
```

Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Rohan CJ <rohantmp@gmail.com>
2019-11-12 16:06:07 +01:00
Sébastien Han 76c33e0f85 Revert "ceph: osd hide 'restorecon' when necessary"
This reverts commit d224fbdef1.
Since https://github.com/ceph/ceph/pull/31421, the monkey patching of
'restorecon' is not needed anymore.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-12 15:34:12 +01:00
Sébastien Han 124a98bc67 ceph: expose AppName of mgr and rbd-mirror
The ceph-crash controller needs to access the app name, so let's export them.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-12 13:50:36 +01:00
Travis Nielsen 0bb8000825 Merge pull request #4273 from egafford/associate-keyrings-with-deployments
ceph: Standardize association of keyrings with deployments
2019-11-11 17:06:24 -07:00
Rohan CJ 4d7c6df034 Ceph: Fix topologyAware in clusterdisruption package does not respect the rook topolgy prefix.
Allow the clusterdisruption package to recognize node topologies other than zone.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-11-11 09:38:33 +05:30
Sébastien Han ccb9f6ec98 Merge pull request #4277 from sp98/fix-osd-on-pvc-on-restart
ceph: skip osd prepare job creation if osd daemon exists for the pvc
2019-11-08 16:16:57 +01:00
egafford bb7aac4b62 ceph: Standardize association of keyrings with deployments
This change standardizes the ownerRefs of Ceph keyrings to
k8s Deployment resources across all daemons and refactors a
bit of duplicate code on keyring association for ease of
maintenance.

Fixes: #4089

Signed-off-by: egafford <egafford@redhat.com>
2019-11-08 09:50:37 -05:00
Santosh Pillai 26360689f5 ceph: skip osd prepare job creation if osd daemon exists for the pvc
When an orchestration is restarted or retriggered and starts new osd prepare pods, they are unable to start because the device is already in use by the osd daemon pods.
This fix simple skips the osd prepare pod creation if the daemon is already running.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-11-08 20:11:49 +05:30
Sébastien Han 4ac8e5417b Merge pull request #4276 from leseb/external-cluster-csi-keys
ceph: create csi keys and secrets for external cluster
2019-11-08 13:21:08 +01:00
RAJAT SINGH 65fb5684f2 Ceph: Simplification of addOrRemoveMonitor()
Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
2019-11-07 15:26:47 +05:30
Sébastien Han 10c57f834d ceph: create csi keys and secrets for external cluster
Once the cluster is connected, we need to create the CSI keys so that we
can provide persistent storage to containers, via ceph csi.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-07 10:56:06 +01:00
Sébastien Han f78ed36539 Merge pull request #4131 from leseb/osd-fs-flag
ceph: remove topologyAware CRD option
2019-11-06 15:08:21 +01:00
Blaine Gardner 97e07069dc Merge pull request #4195 from d-luu/fix_missing_ceph_mgr_annotation
ceph: fix set mgr annotations
2019-11-05 09:25:39 -07:00
Nizamudeen 1aaad8f3be ceph: added a check for triggering the orchestration
Fix for automatic orchestration triggering even if the cluster CRD is unchanged.

Signed-off-by: Nizamudeen <nia@redhat.com>
2019-11-05 15:25:29 +05:30
Travis Nielsen 47764715fe ceph: remove the location from the cluster CR
The topology of the cluster should be based on the node labels rather
than a setting in the cluster CR. This allows a much richer and more
dynamic topology to be configured. The location will now be ignored
if specified in the cluster CR.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-11-04 23:07:13 -07:00
d-luu 014431ee0d ceph: fix set mgr annotations
Mgr annotation was previously not being set.

Signed-off-by: d-luu <david@davidluu.info>
2019-11-04 15:22:24 -06:00
Sébastien Han ef6815ebfa ceph: remove topologyAware CRD option
We removed the topologyAware CRD option since it was redundant with the
use of an OSD being backed by a PVC.
So now, if an OSD is backed by a PVC we assume the topology aware
decision and will discover zone and region labels on that host.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-04 09:53:14 -07:00
Travis Nielsen 831c15086a ceph: support all layers of CRUSH map with node labels
The node labels were already supported for zones and regions to add to
the CRUSH map. Now all layers of the CRUSH map will be supported
with the new labels such as topology.rook.io/rack.
The labels will be detected at the osd startup time
similar to the zone and region labels already being detected.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-10-31 14:47:18 -06:00
Travis Nielsen b04567c0bd Merge pull request #4222 from sp98/fix-orchestration-restart
stop orchestration restart on device config map update for osd on pvc
2019-10-30 13:11:27 -06:00
Santosh Pillai d1c82015f9 ceph: stop orchestration restart on device config map update for osd on pvc
when running OSD on PVC, orchestration should not be started again if there is any change in the device config
map. Added a check to skip orchestration on device CM update when StorageClassDeviceSets are available,
that is, when running osd on pvc.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-10-30 20:00:27 +05:30
Travis Nielsen 95171c682b ceph: continue with orchestration if a single mon pod fails to start
If the cluster has previously been initialized and the operator
is restarted, the operator needs to perform the first orchestration
to confirm basic cluster health, then start watching for CR events.
If there was a single mon pod in a failed or pending pod state, the
orchestration was blocked even if just one mon was in this state.

The scenario is when a node is lost and a mon and the operator happen
to be running on that node. The operator will restart, but the mon
will not restart because it is tied to the node that died (unless running
on a PVC). The mon would remain in a pending state while attempting
to schedule on the node that is down indefinitely and the operator would
be blocked indefinitely. Now we will just log the error and attempt
to continue.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-10-30 08:24:18 -06:00
Sébastien Han 09e29d01b1 Merge pull request #4214 from leseb/skip-restorecon
ceph: osd hide 'restorecon' when necessary
2019-10-30 14:44:30 +01:00
Sébastien Han d224fbdef1 ceph: osd hide 'restorecon' when necessary
Some testing on OpenShift has shown that enabling Hostnetworking causes
issues with ceph-volume creating OSD.
This is a pure Red Hat OpenShift downstream issue.

This is meant to be temporary while we are waiting for the Selinux team
to get back to us.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-30 11:32:15 +01:00
egafford 51689b6d3f ceph: Generate keyrings before OSD deployment
Generating keyrings after deployments created a race condition
resulting in intermittent OSD pod failure on the first attempt.
This change creates keyrings prior to creation of OSD deployments
and updates the owner after the creation of a deployment.

Partially fixes: rook#4089
Signed-off-by: egafford <egafford@redhat.com>
2019-10-29 16:01:50 -04:00
Sébastien Han 5662911317 ceph: fix set osd prepare resources
Use the right struct field. Previously it was pointing to the osd global
resource now it does the osd prepare.

Closes: https://github.com/rook/rook/issues/4182
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-25 10:55:25 +02:00
Sébastien Han aa9f408822 ceph: use quorum_status instead of mon_status
In Octopus, this commit
https://github.com/ceph/ceph/pull/30859/commits/c09b82a80a392ccd0da7677c7b424ce5cd3fa5d6
moved the quorum_status command to a socket call. Thus, the `ceph
quorum_status` command does not exist anymore, to use it we need to do
`ceph daemon mon.$ID quorum_status`. However, this command only works
locally so it won't work if we run it from the operator.
The `ceph mon_status` command is a general command that run from
anywhere and returns the mon map, let's use this one on the operator
code.
This is not a breaking change.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-24 11:27:52 +02:00
Travis Nielsen 0178724425 Merge pull request #4033 from travisn/mgr-module-async
Run the mgr module configuration asynchronously
2019-10-23 12:28:01 -06:00
Sébastien Han 9f053ca4e1 ceph: osd remove --conf flag
Even legacy osds were still running with this flag. In my previous patch
I was trying to minimize the impact of the change and was afraid the
config file was holding important information but that appears not to be
true.

The only option in the config could have the keyring path, but it's
passed in the CLI startup line.

Closes: https://github.com/rook/rook/issues/4063
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-23 11:43:28 -06:00
travisn 9d94245918 ceph: configure mgr modules asynchronously
The mgr modules take some time to run and have also been known
to hang. While the hang issues should have been resolved separately,
an improvement is still to allow the configuration to happen
in parallel for unrelated modules. All of the module configuration
will be completed before continuing with osd configuration
in order to keep the logging simpler.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-10-23 11:38:00 -06:00
Travis Nielsen 766a0a81a2 Merge pull request #4021 from travisn/restore-cluster
Enable restoring a cluster after disaster recovery
2019-10-23 11:18:06 -06:00
Travis Nielsen 733eed9461 Merge pull request #3996 from sp98/fix-operator-reconcile
fix operator reconcile to restart osd daemons
2019-10-23 10:09:54 -06:00
Santosh Pillai 8ea693a740 ceph: fix operator reconcile to restart osds daemons
OSD on PVC does not upgrade when the user upgrades the ceph version on cluster-on-pvc yaml.
The solution incudes:
   - upgrade osd prepare and daemon pods on upgrade
   - skip c-v prepare if filesystem is already present on the pvc device.
   - skip lvm release in case of upgrade.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-10-23 16:56:15 +05:30
rohan47 7f9611d489 Ceph: Added removeOSDsIfOutAndSafeToRemove to Cluster CR
OSDs can be removed automatically with the current mechanism if a new
setting removeOSDsIfOutAndSafeToRemove is set to true. The default for
all new or upgraded clusters should be false.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-10-23 15:10:36 +05:30
travisn 53812c0039 ceph: create missing mon deployments without waiting for quorum
If mon deployments need to be created, the operator should
go ahead and create all of them instead of waiting for quorum
in between checking each mon. In particular, if a cluster is
being restored in a disaster recovery situation, none of the mons
deployments will exist. All of them should be created before
checking for quorum.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-10-22 15:13:25 -06:00
travisn a72a981642 ceph: mgr modules requests should timeout
Requests to enable mgr modules or call mgr modules should
timeout rather than hang. For example, if creating a self
signed cert request hangs, the mgr should continue with other
actions in the orchestration

Signed-off-by: travisn <tnielsen@redhat.com>
2019-10-22 15:13:25 -06:00
Sébastien Han fcc2e21faf ceph: rework csi keys and secrets
We know create 4 secrets containing 4 ceph keys where each of them have
limited permissions to access the cluster.

Closes: https://github.com/rook/rook/issues/4074
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-22 15:14:28 +02:00