Commit Graph
902 Commits
Author SHA1 Message Date
Satoru Takeuchi 36f8074938 osd: improve log on specifying lv and loop device as osd
We can use LVM logical volumes and loop devices as OSD iff we specify
them in the `devices` field. If we use filters like `deviceFilter`,
these devices are not picked with a log message which let users
to specify the exact device name. It's better to mention which field
users should use in this case.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-11-28 23:18:54 +00:00
Travis Nielsen 3a07f3ac98 Merge pull request #10887 from travisn/duplicate-mon-endpoint
mon: Remove out of quorum mons from ceph.conf
2022-11-09 10:16:07 -07:00
Shinya Hayashi 05875a3f4f osd: support loop devices for test clusters
A new variable is added to rook-ceph-operator-config
ConfigMap to allow using loop devices for osd.

This feature is intended to be used for testing purposes only.

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
2022-11-09 06:45:41 +00:00
Travis Nielsen b6e8ea2b50 mon: remove out of quorum mons from ceph.conf
The mons that are out of quorum may cause ceph commands to timeout
or fail unnecessarily trying to connect to a mon that is no longer
online. Now the mon health check will update the mon endpoints configmap
when a mon is detected out of quorum. This also means that if the
operator is restarted during a mon failover, the failed mon will no
longer remain in the ceph.conf, thus allowing the quorum to be more
likely to respond to the mons that are still in quorum.

The update for mons out of quorum only applies if other mons are in
quorum. If quorum is down, the configmap will not keep track of the offline
mons since too many are offline.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-11-08 11:36:37 -07:00
Travis Nielsen e3cb30f026 osd: improve logging during osd purge
When the osd is purged, properly log the host name
that is being purged and whether the host was
removed from the crush map.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-10-18 16:01:23 -06:00
Travis Nielsen 429d209a21 Merge pull request #11138 from subhamkrai/update-osd-removal-job
osd: osdSafeToDestroy check should be after osd out
2022-10-18 07:20:59 -06:00
subhamkrai 77f9e0d5b6 osd: osdSafeToDestroy check should be after osd out
currently, osdSafeToDestroy check is done before
marking osd out which prevents ceph from rebalancing.
With this changes, we are moving check for
osdSafeToDestroy after osd is marked out.

Signed-off-by: subhamkrai <srai@redhat.com>
2022-10-11 16:22:21 +05:30
Blaine Gardner 51fac0a993 nfs: fix nfs grace period when multus is enabled
Run the ganesha-rados-grace command in a remote pod when multus
networking is enabled.

Signed-off-by: parth-gr <paarora@redhat.com>
Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-10-05 16:28:36 -06:00
Rakshith R 9d0d93472f osd: use 256 as cryptographicLength for keys using kmip kms
This commit changes cryptographic length for keys created
for kmip kms to 256 from 128, since it is more secure.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-29 11:25:31 +05:30
Satoru Takeuchi b6a6f66ff0 osd: clarify lv is not picked by filters
LVM logical volumes are not picked by `deviceFilter`, `devicePathFilter`,
and `useAllDevices`. It's to prevent old version's users from creating
lv-backed osd during upgrading rook by accident.

It's better to clarify lvs are not picked by filters" in docs and
suggest users to use exact device name instead.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-09-28 00:58:04 +00:00
dkeven dc95af5c33 osd: allow raw partitions to be picked up by discover daemon
Signed-off-by: dkeven <dkvvven@gmail.com>
2022-09-27 14:18:30 +08:00
Blaine Gardner 2965373ea9 Merge pull request #10898 from parth-gr/test-nfs
nfs: fix nfs if multus is enabled
2022-09-22 12:27:47 -06:00
parth-gr ddea97ebde nfs: fix nfs if multus is enabled
Closes: https://github.com/rook/rook/issues/10812
Signed-off-by: parth-gr <paarora@redhat.com>
2022-09-21 14:09:40 +05:30
Liang Zheng 9a78f6af07 osd: update ceph status parse
Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
2022-09-20 12:48:53 +08:00
Liang Zheng f9c360e609 osd: optimize device probe
1. Eliminate possible memory leaks of timer.
2. Eliminate duplicated events between udev events and kernel events.
3. Empty struct have the lowest size.

Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
2022-09-20 10:41:51 +08:00
Satoru Takeuchi 9ad82eebbb Merge pull request #10968 from cybozu-go/osd-disallow-to-create-encrypted-osd-on-part
osd: disallow to create encrypted osd on partition
2022-09-14 04:26:15 +09:00
Travis Nielsen f97e270870 Merge pull request #10969 from cybozu-go/ci-disallow-to-create-encrypted-osd-on-lv
ci:  disallow to create encrypted osd on lv and osd on lv with metadata device
2022-09-13 11:36:38 -06:00
Blaine Gardner 005000212c nfs: add kerberos client security support
Add support for enabling kerberos for client authentication.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-09-13 08:46:52 -06:00
Satoru Takeuchi 39cc6059f1 ci: disallow to create osd on lv with metadata by accident
OSD on LV with metadata device is not supported. So we once we made
a fix to disallow this configuration. However, it's insuffucient
because we forgot to reset `matched` flag.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-09-13 13:21:31 +00:00
Satoru Takeuchi 7969450589 ci: disallow to create encrypted osd on lv
Rook doesn't support encrypted OSD on LV. Without disallowing
this configuration, ceph-volume results in failure.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-09-13 12:44:53 +00:00
Satoru Takeuchi 591fc5f68b osd: disallow to create encrypted osd on partition
Rook doesn't support encrypted osd on partition. So we should
skip partitions as candidates of the new encrypted osds.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-09-13 12:04:14 +00:00
Rakshith R f21c12234d osd: add kmip encryption support
The cluster-wide encryption feature now
supports KMIP (Key Management Interoperability Protocol)
kms.
KMIP is an extensible communication protocol that defines
message formats for the manipulation of cryptographic keys
on a key management server.

For more information, refer:
https://en.wikipedia.org/wiki/Key_Management_Interoperability_Protocol

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-09 11:39:33 +05:30
Satoru Takeuchi c7ab01b946 Merge pull request #10858 from cybozu-go/osd-refactoring
osd: refactor code
2022-09-03 06:25:17 +09:00
Satoru Takeuchi 00b3d0f323 osd: refactor code
Simplify osd management code.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-09-02 11:17:05 +00:00
Satoru Takeuchi 8b513a4a74 osd: disallow to create osd on lv with metadata device
OSD on logical volume is raw mode. This mode can'set metadata device.
We should not mark a logical volume as available in this case.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-09-01 05:12:43 +00:00
taki-d ca73efa1e5 osd: fix osd detection logic for old lsblk
Old lsblk can't detect bluestore signature.
So read the head of device and verify signature
as a workaround.

closes: https://github.com/rook/rook/issues/10665

Signed-off-by: taki-d <mail@orangepla.net>
2022-08-31 11:02:25 +09:00
Travis Nielsen 5ef8d15659 build: format comments for go 1.19
The tool gofmt in go 1.19 requires certain formatting
in the comments section for better rendering.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-08-11 12:41:10 -06:00
Jiffin Tony Thottan 5c8ca01bd0 object: adding support for sse s3 for RGW
The RGW support server side encryption with help of s3 protocol, till
now the `sse:kms` was support in which keys will be provided by the user
and but it will be saved in external management service like vault. Now
the support for `sse:s3` is added so the entire encryption key
management is performed by RGW itsels.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2022-07-28 11:50:48 +05:30
Travis Nielsen e3256c07fe Merge pull request #10523 from leseb/fix-stuck-reconciler
core: fix stuck reconciler (more checkpoints for cancelled context)
2022-07-18 08:58:07 -06:00
Eng Zer Jun 8a25b1d903 test: use T.Setenv to set env vars in tests
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-07-15 23:07:19 +08:00
Travis Nielsen fc541764f1 Merge pull request #10484 from jsoref/spelling
core: fix spelling
2022-07-15 08:31:41 -06:00
Liang Zheng 7609dad72f osd: metadata device supports udev path
This commit adds udev path for metadata device

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

Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
2022-07-14 10:26:33 +08:00
Sébastien Han 247d725aac core: let IsInitialized return errors
Let's return an error instead of a bool so we can better parse it and
decide what to do with it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-07-12 12:07:57 +02:00
Satoru Takeuchi 7e571f6114 osd: support OSD on logical volume in host-based cluster
Rook supports raw mode OSD in host-based cluster. So we can also
support OSD on logical volume in this kind of cluster.

Logical volumes aren't picked by filters (i.e. `useAllDevices: true`
and `device{Path,}Filter` to avoid unwanted LV consumption on upgrade.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-07-11 21:08:50 +00:00
Josh Soref 6e7b8767f3 core: fix spelling
* another
* are
* availability
* available
* bootstrap
* boundaries
* ceph
* certificate
* class
* codifies
* consuming
* corrupted
* createor
* csi
* deployments
* exceeded
* execute
* filesystem
* healthiness
* heuristics
* immediately
* insecure
* installed
* isolated
* maintained
* maximum
* minute
* monitor
* new
* nginx
* nonexistent
* not
* occurs
* omitempty
* operator
* orchestration
* persistentvolumes
* placement
* preexisting
* prometheus
* protecting
* provisioner
* purposes
* reconcile
* regex
* related
* requests
* returns
* rubbish
* running
* schedulable
* schedule
* serviceaccount
* simulating
* snapshots
* statement
* static
* tenants
* the
* unavailable
* volumeattachment
* waiting
* with
* wrapper
* zonegroup

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-07 18:10:47 -04:00
Travis Nielsen dad97f3425 core: remove support for ceph octopus
With octopus coming to end of life, we remove support from
Rook for deploying Ceph Octopus and assume a min version of
Pacific v16. Any checks for octopus or earlier are removed
from the reconciles since they are obsolete.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-07-07 15:03:26 -06:00
Blaine Gardner 800d3e5050 Merge pull request #9915 from BlaineEXE/dependents-cephfilesystem
file: block deletion on more dependents
2022-06-17 14:07:07 -06:00
Sébastien Han bfe4f7c111 osd: do not return if deactivate fail
Let it fail further once we run c-v activate. The error reported by LVM
could potentially ignored. If there is a failure, the c-v command will
fail anyways.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-06-15 15:42:48 +02:00
Blaine Gardner a63844f8bf file: block deletion on more dependents
Block deletion of CephFilesystems when there are any raw Ceph
subvolumegroups present that have subvolumes in them. Empty
subvolumegroups will not block deletion.

One important subvolume group is "csi" which is the default location
where CSI subvolumes are kept. If this group is empty, it means that
there are no PVCs created based on the CephFilesystem in question. This
also holds true if there are external consumers of the filesystem in
external cluster mode.

Similarly, if there are any subvolumegroups (for example "_nogroup",
which includes subvolumes in the filesystem root) that contain
manually-created subvolumes, Rook will also see this and block deletion.
This comes into play currently with manually-created NFS exports.

A work-in progress aims to create a Ceph-CSI NFS export provisioner
which will likely create subvolumes in the "csi" group as well. This
implementation will catch this case also.

Rook still checks for CephFilesystemSubVolumeGroups explicitly in
addition to the check added here. This is to ensure that even empty
groups will block deletion if they are created via this CR type.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-06-14 13:02:35 -06:00
Sébastien Han 219e017564 osd: do not hide the error
Return the error instead of hiding it, err could be non-nil for a lot of
reasons, eg: a canceled context or a non-existing object.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-06-03 11:00:10 +02:00
Travis Nielsen dd3ea3e760 pool: built-in pools require flag to force creation
Ceph added a check recently that prevents creation of the
built-in pools that start with a dot, such as .nfs, .mgr,
and .rgw.root. These pools require a --yes-i-really-mean-it
flag to be passed to force the creation now.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-05-25 17:26:15 -06:00
Satoru Takeuchi e66b35aa55 Merge pull request #10230 from leseb/fix-9470
core: append filesystem property on disk
2022-05-10 09:07:09 +09:00
Sébastien Han 8328ec6d31 core: add mountpoint detection to the prepare pod
Amount various filters let's add a mountpoint property and skip the
device if its filesystem is mounted.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-05-09 15:26:50 +02:00
Satoru Takeuchi 4c46dd1abd osd: fix disk uuid management
- disk UUID should only be got for "disk" type device.
- It's not necessary to fail prepare job when failing to get disk UUID
- We should consider that `sgdisk` reports UUID even if there is no GPT.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-05-09 18:25:09 +09:00
Sébastien Han 6ef491d9fc osd: close the encrypted disk after cleanup is done
Once we are done cleaning up the content of the encrypted osd, let's
close the main LUKS device.
This avoids having dm devices on the system after the cleanup.

Closes: https://github.com/rook/rook/issues/10181
Signed-off-by: Sébastien Han <seb@redhat.com>
2022-05-03 16:47:59 +02:00
Sébastien Han 583791c45c core: move clusterInfo code to the controller package
The CSI package needs to load clusterInfo, today this code is in the mon
package which makes the call of LoadClusterInfo impossible without
having a circular import.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-04-26 11:05:02 +02:00
Sébastien Han 6bc7827150 osd: only set kek to env var on encryption scenario
There is a corner case where an env variable populated with the prepare
job could influence and trigger some encryption code. We have an env
variable to discover whether the prepare job will encrypt a drive or not
so let's use that instead of running code as a noop and sometimes
trigger a corner case. In this scenario, the prepare job had an "IBM_"
env variable present in the OS image (IBM OS) so the setKEKinEnv()
  function would get called for no reason.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-04-11 16:54:18 +02:00
Madhu Rajanna b0fc7c9b92 namespace: add new CRD
This introduces a new CRD to add the ability
to create rados namespace for a given
ceph block pool. Typically the name of the pool
is the name of the blockpool created by rook.

Closes: #7035

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-04-05 10:10:04 +05:30
subhamkrai 24802c559e core: fix golangci linter
fix golangci linter

Signed-off-by: subhamkrai <srai@redhat.com>
2022-04-04 20:59:31 +05:30
Krzysztof Nazarewski 352df4e62f osd: add NixOS specific PATHs
This commits makes Rook usable on NixOS.

NixOS system holds "installed" binaries in `/run/current-system/sw/{bin,sbin}`.
The only binaries residing outside those paths are `/usr/bin/env` and `/bin/sh`.

I got a suggestion on Slack to simply add those NixOS specific paths

Signed-off-by: Krzysztof Nazarewski <3494992+nazarewk@users.noreply.github.com>
2022-04-01 16:37:23 +02:00