Commit Graph
721 Commits
Author SHA1 Message Date
Travis Nielsen 68fa240a1e Merge pull request #11993 from heliochronix/ipv6-msgr2-mon-config
core: fix config format for msgr2 ipv6 monitors
2023-03-30 08:04:38 -06:00
Miles Simpson f99a8dea3f core: fix config format for msgr2 ipv6 monitors
Signed-off-by: Miles Simpson <miles@milessimpson.com>
2023-03-28 16:45:07 -07:00
Satoru Takeuchi 3e34ebeff8 osd: handle global or node-local device class configuration correctly
Rook uses global or node-local device class configuration if device-level
configurations doesn't exist. However, after introducing device-class
level resource configuration, rook set the default value of device class.
So global or node-level device class configuration has never been used
after that.

Closes: https://github.com/rook/rook/issues/11871
Closes: https://github.com/rook/rook/issues/11826

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2023-03-27 04:28:45 +00:00
parth-gr 8e317ee074 ci: update golangci-lint version as it fails for some k8s version in 1.10
Closes: https://github.com/rook/rook/issues/11896

Signed-off-by: parth-gr <paarora@redhat.com>
2023-03-16 20:59:22 +05:30
Rakshith R 71e011f731 osd: add rotate-key functionality to rook's key-management cmd
This commit adds functionality to be able to rotate
key encryption key of encrypted PVC backed OSDs.
Necessary changes such as adding update functionality
to kms and rbac changes are made as well.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-03-08 12:07:26 +05:30
Rakshith R b41fdfbb62 osd: add support for updating secret for default KMS
This commit adds support for updating secret for default KMS.
This is required for encryption key rotation.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-03-08 12:07:26 +05:30
Rakshith R 973723cbdd osd: add util functions to support encryption key rotation
This commit adds util functions to support encryption key rotation
such as RemoveEncryptionKeySlot, AddEncryptionKey and
ensureEncryptionKey.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-03-08 12:07:26 +05:30
Blaine Gardner e88b920411 Merge pull request #11221 from zhucan/bugfix-11204
file: check if fs exists before checking dependencies
2023-03-01 12:18:03 -07:00
parth-grandBlaine Gardner 69ae9569cd build: update k8s version to 1.26.1
Update the Kubernetes API version used to 1.26.1, and start testing
against Kubernetes version 1.26.1 in CI.

Co-authored-by: parth-gr <paarora@redhat.com>
Co-authored-by: Blaine Gardner <blaine.gardner@redhat.com>

Signed-off-by: parth-gr <paarora@redhat.com>
Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2023-02-23 20:18:47 -07:00
zhucan 46c2bef9bc file: check if fs exists before checking dependencies
Signed-off-by: zhucan <zhucan.k8s@gmail.com>
2023-02-20 11:53:59 +08:00
parth-gr a84daf9bf0 core: change io/ioutil package to use io and os package
few functions got change as they were deprecated
for ex: ioutil.Readfile change to os.Readfile
ioutil.TempFile change to os.CreateTemp
And fixed golang-ci-lint-issues

Signed-off-by: parth-gr <paarora@redhat.com>
2023-02-17 20:38:29 +05:30
Travis Nielsen e7320ad63b mon: allow mons on msgr1 even if v2 settings required
Mons that are configured on msgr1 will be using the v1 port
in the csi driver since only one port is allowed in the configmap.
To allow mons to be started on v2 while keeping quorum with the
v1 mons, the v1 mons must continue running on the v1 port.
So even if msgr2 is required, allow existing v1 mons to continue
running on that port.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2023-02-10 09:38:09 -07:00
ausias-armesto f55c4573cf osd: cannot create volumes on pvc based osd with alias dev mapper
It removes the condition that select the devices name prefixed with /dev/mapper as it is causing the ceph-volume command to fail.

Closes: #11301
Signed-off-by: ausias-armesto <ausiasarmesto@gmail.com>
2022-12-15 16:04:29 +01:00
Travis Nielsen d532e27c6c Merge pull request #11399 from travisn/osd-purge-config
core: Allow ceph.conf to be updated if already exists
2022-12-12 07:53:22 -07:00
Travis Nielsen 8a94bb20ae osd: allow mpath_member filesystem for mpath disks
Multipath devices may have an FSTYPE=mpath_member even though
a valid device for creating an OSD. The device will be allowed
in this case when creating the OSD on a PV since it is a device
specifically provisioned for the OSD.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-12-09 09:42:27 -07:00
Rakshith R 24fa9ed935 osd: remove stale dm device during osd-prepare-job
During osd-prepare-job,

The encrypted device is found to be closed in some cases when
the OSD deployment has been removed manually accompanied
by any of following cases:
- node reboot
- csi managed PVC being unmounted etc

while re-opening the block to re-hydrate the OSDInfo,
the dm device `<pvc-name>-block-dmcrypt` clashes with
the one used by OSD pod which is stale by now.
This commit adds cmd to remove this stale dm device.
Error with output "No such device" is ignored.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-12-08 15:57:56 +05:30
Travis Nielsen 2a16cd857c osd: improve error message for osd purge
The OSD purge was printing an incorrect sentence, so this now
fixes the grammar.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-12-07 14:34:01 -07:00
Travis Nielsen 9975e09406 core: allow ceph.conf to be updated if already exist
The ceph.conf was being written with 0x444 permissions, which means
the file could not be updated if it already exists. Specifically, when
an osd is purged, if the operation is retried multiple times, only
the first operation was succeeding. The subsequent requests to purge
an osd were failing due to the config already existing. If we make
the config writeable with 0x644 then the operator can always write the file.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-12-07 14:33:36 -07:00
Rakshith R bde286ef49 osd: re-open encrypted disk during osd-prepare-job if closed
This commit implements this corner case during osd-prepare job.
```
The encrypted block is not opened, this is an extreme corner case
The OSD deployment has been removed manually AND the node rebooted
So we need to re-open the block to re-hydrate the OSDInfo.

Handling this case would mean, writing the encryption key on a
temporary file, then call luksOpen to open the encrypted block and
then call ceph-volume to list against the opened encrypted block.
We don't implement this, yet and return an error.
```
When underlying PVC for osd are CSI provisioned, the encrypted device
is closed when PVC is unmounted due to osd pod being deleted.
Therefore, this may occur more frequently and needs to be handled.
This commit implements the fix for the same.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-11-30 18:54:23 +05:30
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