Commit Graph
1464 Commits
Author SHA1 Message Date
Sébastien Han 7c928f4196 ceph: return an error if PVC is not clean
With 5f57b6fd3a, we introduced a
regression in the validation code.
If the OSD PV comes from another cluster, GetCephVolumeRawOSDs must
return an error.
The prepare job will crash loop but at least with a useful and
comprehensive message.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 11:28:08 +01:00
Sébastien Han 5966f09376 Merge pull request #7160 from leseb/rm-crash-pod-when-ceph-pods-are-gone
ceph: remove crash collector if ceph pod moved
2021-02-09 10:08:16 +01:00
Sébastien Han b9e91b600d ceph: remove crash collector if ceph pod moved
If Ceph pods were evicted onto other nodes, there is no reason for the
crash collector to remain on those nodes. So let's remove it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 09:48:16 +01:00
Varsha Rao baa79cf4c3 ceph: filesystem is not required for nfs server deployment
nfs server requires valid pool for storing nfs-ganesha recovery objects. Only
when filesystem exports are created, filesystem should be configured first.

Signed-off-by: Varsha Rao <varao@redhat.com>
2021-02-08 20:13:14 +05:30
Travis Nielsen 7dc36e0f46 ceph: use localhost for the mgr endpoint binding instead of podIP
The pod IP address is no longer needed for port binding for the dashboard
and prometheus endpoints anymore in the mgr modules. The default binding
to localhost will be sufficient. This will allow the endpoints to be more
reliable in some environments where today the podIP is not working.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-04 08:44:05 -07:00
Travis Nielsen b3129fd5cf ceph: bind mgr modules to all interfaces instead of pod ip
Binding the dashboard and prometheus to all interfaces instead of the pod ip
will ensure that they are listening properly. Binding to the pod ip was only
a short term solution that was intended to be removed with Nautilus, which
is already Rook's min supported version.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-04 07:08:59 -07:00
Sébastien Han 3a2e618ec4 Merge pull request #7112 from sp98/check-orchestration-cancellation
ceph: check for orchestration cancellation while waiting for all OSDs  to start.
2021-02-04 11:36:04 +01:00
Santosh Pillai f5808185e0 ceph: check for orchestration cancellation while OSDs are pending
completeOSDsForAllNodes() method waits for 20 minutes for all the OSDs to start on all the nodes. This PR checks if
cluster deletion request was sent while waiting for OSDs to start. If yes, then completeOSDsForAllNodes() method will returnwithout waiting for 20 minutes.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-02-04 14:49:37 +05:30
Santosh Pillai b780e5b5c0 ceph: skip pdb reconcile on create and delete events
This PR makes create and delete events on pdb a no-op. Update event only triggers reconcile if its the main OSD pdb and allowed disruptions is 0.
This prevents controller to reconcile on pdb events namespaces outside rook ceph.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-02-03 22:43:20 +05:30
Sébastien Han 8d033efb5a ceph: silence harmless errors
If the ceph cli outputs an error with "error calling conf_read_file"
this means that the operator has not written its ceph configuration
file. Thus ceph cli commands will fail, so we can just ignore that since
the operator will soon write this file in its initialization sequence.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 17:28:44 +01:00
Travis Nielsen 5371c943ca ceph: simplify the log-collector container name
The log-collector container name was exceeding the 63-char limit
if the parent CR name was too long. The container name just needs
to be unique to the pod spec, so we simplify it to remove the parent
name and avoid hitting the limit in the pod spec.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-02 12:42:53 -07:00
shenjiatong 2b63fff087 ceph: skip csi detection if CSI is disabled
Before this patch, csi detection will run whether or
not rbd and cephfs are all disabled. Run detection only
if it is necessary.

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-02-02 08:28:35 +08:00
Sébastien Han 8b65eb6126 ceph: do not enable ShareProcessNamespace if HostPID
If HostPID is enabled, this means the Ceph version is older than Octopus
and we are still running OSD with HostPID due to an internal
inter-process check.
If the log collector is enabled we need to enable ShareProcessNamespace
**only** if HostIPC is disabled.

Both HostPID and ShareProcessNamespace cannot be enabled.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-01 18:23:19 +01:00
Sébastien Han efefb557a8 Merge pull request #7111 from leseb/fix-1922108
ceph: do not enable ShareProcessNamespace if HostIPC
2021-02-01 17:18:58 +01:00
Travis Nielsen 661b8c7336 Merge pull request #7075 from sp98/timeout-radosgw-admin-cmd
ceph: timeout `radosgw-admin` cli commands
2021-02-01 09:10:18 -07:00
Travis Nielsen d150980241 ceph: skip logging error for mon pdbs if single mon
If there is a single mon, we don't expect the PDBs to be created
and neither do we need to log that it is an error condition.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-01 07:57:53 -07:00
Sébastien Han 260274cdb3 ceph: do not enable ShareProcessNamespace if HostIPC
If HostIPC is enabled, this means the Ceph version is older than Octopus
and we are still running OSD with HostIPC due to an internal
inter-process check.
If the log collector is enabled we need to enable ShareProcessNamespace
**only** if HostIPC is disabled.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-01 15:50:16 +01:00
Santosh Pillai 113376f1ab ceph: timeout radosgw-admin cli commands
When creating object store, `radosgw-admin realm get ..` command is stuck forever when required number of OSDs are not available. Because of this the uninstall of object store is also stuck. User has to manually remove the finalizer to delete the object store.This PR uses `ExecuteCommandWithTimeout` for running `radosgw-admin` command. Timeout during installation will be reconciled. Cleanup will be treated as best effort. Any errors during uninstalling of single site object store will only be logged.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-02-01 10:57:04 +05:30
Blaine Gardner 1761874da2 Merge pull request #6999 from rohan47/clean_terminating_pods
ceph: clean pods stuck in terminating state on a failed node
2021-01-29 13:15:36 -07:00
Travis Nielsen 0a1bfe575c Merge pull request #7062 from leseb/cephfs-mirror
ceph: add cephfs mirroring support
2021-01-29 09:09:56 -07:00
Santosh Pillai 5831c0f0d0 ceph: add --public-addr args to ceph mds command
add --public-addr=<podIP> args to ceph mds command when host network is not enabled.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-01-28 12:40:42 -07:00
Travis Nielsen 4f7250298c Merge pull request #7084 from travisn/maxmonid-commit
ceph: Only commit the maxmonid after starting a mon daemon
2021-01-28 11:30:10 -07:00
Sébastien Han c0123cf182 ceph: add cephfs mirroring support
With Ceph Pacific, Rook can now deploy the cephfs-mirror daemon.
This initial commit covers the deployment of a single daemon only.
Multiple mirror daemons is currently untested.
Only a single mirror daemon is recommended.

The configuration of peers will come in a later PR since the mgr module
is still pending upstream: https://github.com/ceph/ceph/pull/39050

The same goes for integration tests, they will get added later once we
start testing on Pacific.

Closes: https://github.com/rook/rook/issues/7002
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-28 19:21:18 +01:00
rohan47 0876a20e7c ceph: clean pods stuck in terminating state
when a node fails some pods remains in terminating while other manage to
be rescheduled on another node successfully.
this commit adds code to clean up all the Rook and CSI pods that are stuck in terminating
state on a failed node.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2021-01-28 23:21:53 +05:30
Blaine Gardner 2caeb8bfe3 Merge pull request #6833 from sp98/configure-osd-upgrade-timeout
ceph: configure health check timeout for OSDs when upgrading
2021-01-28 09:46:12 -07:00
Sébastien Han 920381d677 Merge pull request #7077 from jshen28/fix-disable-mds-liveness-probe
ceph: fix mds liveness probe
2021-01-28 11:04:20 +01:00
Sébastien Han d7610b7e6f ceph: use errors package instead of fmt
Small fix since all the ceph codebase is using the errors package.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-28 08:51:48 +01:00
Travis Nielsen 4fa3c04e44 ceph: only commit the maxmonid after starting a mon daemon
The maxMonId should only track the mons that have been committed to starting.
Currently the maxMonId was tracking all mon scheduling. If the reconcile
was aborted or failed, or the operator restarted in a reconcile, the
maxMonId was being reset by analyzing the mon deployments that existed.
This does not work for scenarios where mon quroum is lost and being
reset to a single mon. Now the maxMonId will only be incremented
when a mon daemon is started, and will never be decremented after
that to ensure that new mons will be incremented to the next id.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-27 16:33:36 -07:00
Travis Nielsen 5cf3338bcd ceph: prevent operator crash with host networking and mon not found
When the node is not found for mon assignment with host networking
enabled, the operator may crash. This change ensures the node is
not nil and returns an error instead of crashing.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-27 15:34:16 -07:00
Sébastien Han f841c1b211 Merge pull request #7071 from travisn/osd-args-ordering
ceph: Consistently order the osd args to avoid restarts
2021-01-27 16:47:36 +01:00
Travis Nielsen 475260de35 Merge pull request #6875 from Madhu-1/fix-6830
ceph: add option to set FSGroupPolicy for CSI PVC
2021-01-27 08:34:45 -07:00
ushen 9bd2150d5e ceph: fix mds liveness probe
Previous patchset does not work before, because
`ConfigureLivenessProbe` does not directly modifies
input variable.

Signed-off-by: ushen <yshxxsjt715@gmail.com>
2021-01-27 20:27:24 +08:00
Santosh Pillai 4237aa7ecc ceph: configure health check timeout for OSDs when upgrading
added waitTimeoutForHealthyOSD in the cluster crd that defines the time (in minutes) the operator would wait before an OSD can be stopped for
upgrade. This PR also removes the ok-to-continue logic for osds as its already handled by ok-to-stop. The default value is 10 minutes.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-01-27 11:13:05 +05:30
Travis Nielsen 570cba9b4e ceph: consistently order the osd args to avoid restarts
The settings for tuneDeviceClass and tuneFastDeviceClass were
stored as a map[string]string. When iterating over the map to
append the args, the args were being appended in an unpredictable
order. The order could change every reconcile, resulting in an
unnecessary OSD restart potentially every reconcile. Now we iterate
over a slice that will be ordered predictably and ensure OSDs
will not be restarted when not needed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-26 17:23:01 -07:00
Travis Nielsen 4b43e7afa5 ceph: allow removal of arbitrary osds on pvcs and simplify pvc names
OSDs on PVCs previously were always replaced with PVCs of a given name.
For on-prem scenarios where the OSDs might need to be removed instead
of replaced, the operator now allows holes to exist in the PVC index
names as long as there are a sufficient number of PVCs to meet the
criteria for the deviceSet.count.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-26 14:38:12 -07:00
ron1 1e64b82b64 ceph: set ProgressingCompleted CephCluster status condition type
Set ProgressingCompleted CephCluster status condition to include type cephv1.ConditionProgressing

Closes: https://github.com/rook/rook/issues/7055
Signed-off-by: ron1 <ron18219@gmail.com>
2021-01-25 10:09:07 -05:00
Sébastien Han 28c78b9204 Merge pull request #7044 from leseb/fix-7022
ceph: update rgw and mds deployment for logCollector
2021-01-25 09:29:40 +01:00
Sébastien Han ebbf332d8d ceph: update rgw and mds deployment for logCollector
If the CephCluster CR spec is updated to activate the logCollector, we
must reflect that change onto child CRDs, like the mds and rgw since
their configurationn would be impacted too.
Now we watch for the CephCluster object changes from the object/file
controllers and react upon the appropriate event.

Closes: https://github.com/rook/rook/issues/7022
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-22 18:19:07 +01:00
Jiffin Tony Thottan ee6a03dfb8 ceph: minor update init container script in generateVaultGetKEK
Replacing VAULT_KV_VERS with VAULT_BACKEND for specifing version of kv engine.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-01-22 16:04:35 +05:30
Madhu Rajanna e305810bf0 ceph: add option to set FSGroupPolicy for CSI PVC
in kubernetes 1.19 it added a support to set FSGroupPolicy
in the csidriver object, same supported is added to both
CephFS and RBD. where user will have an option to set
the FSGroupPolicy for CephFS and RBD separately.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-01-22 14:26:56 +05:30
Jiffin Tony Thottan da61c9a83e ceph: vault kms configuration for ceph object store
The first patch to configure vault for ceph object store. If the `security.kms` configured in
`clusterSpec` CRD, RGW will be configured with vault kms settings to handle SSE request from s3 clients.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-01-22 10:44:03 +05:30
Travis Nielsen b9fc942d65 Merge pull request #7041 from leseb/notify-upgrade
ceph: update rbd-mirror when cluster is upgraded
2021-01-21 10:55:02 -07:00
Sébastien Han 47a02145e7 ceph: update rbd-mirror when cluster is upgraded
The rbd-mirror was left being when the CephCluster was upgraded.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-21 18:23:20 +01:00
Sébastien Han dff0a46a35 ceph: fix incorrect camelcase
Golang use camel cases, so localcephNFS should be localCephNFS.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-21 18:22:27 +01:00
Madhu Rajanna 05c75b7084 ceph: add support to disable snapshotter sidecar
In some cases the user dont want to run snapshotter
container either for CephFS or RBD. In that case the
user wont install the required snapshot CRD's due
to that the snapshotter sidecar container produces
lot of noisy logs.
Snapshotter will be enabled by default for both
CephFS and RBD, but with this PR we are providing
an option to disable snapshotter sidecar deployment
either for CephFS or RBD.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-01-21 15:29:55 +05:30
Sébastien Han 9f8404e330 ceph: add quincy version
Quincy just started https://github.com/ceph/ceph/pull/38996 so let's add
it to our version code.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-21 08:50:41 +01:00
Sébastien Han 093ed7dd62 Merge pull request #6984 from leseb/core-dumps-dir
ceph: set process working dir to /var/log/ceph
2021-01-20 10:39:42 +01:00
Satoru Takeuchi 0512c7d33c Merge pull request #6793 from cybozu-go/ceph-fix-osd-corruption
ceph: avoid potential osd corruption due to wrong file-lock
2021-01-20 09:39:39 +09:00
Sébastien Han 2bb9444130 Merge pull request #6974 from cybozu-go/ceph-delete-discovery-daemon-after-disabling-it
ceph: delete discovery daemon if it is disabled
2021-01-18 11:36:21 +01:00
Satoru Takeuchi ae8dcf7cc3 ceph: fix osd corruption
Multiple OSD pods for the same OSD might run simultaneously becasue OSD pod
is managed by Deployment resource. However, OSD locking mechanism
doens't work because the lock file (fsid file) exist for each OSD pod.
It resutls in OSD corruption.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-01-18 03:11:50 +00:00