Commit Graph
3680 Commits
Author SHA1 Message Date
subhamkrai bda24bbc77 operator: fix webhook loggin during deletion
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 30f21e4e7f)
2023-02-01 22:45:33 +00:00
mergify[bot] 34498e0cfc Merge pull request #11582 from rook/mergify/bp/release-1.10/pr-11453
Fix CephFS Status updates (backport #11453)
2023-02-01 08:37:03 +00:00
Arun Kumar Mohan b9056d49ef core: fix CephFS status updates
CephFS object fails to do a initial status update.
Operator shows the following error message in logs,

'Error while updation: Operation cannot be fulfilled on
cephfilesystems.ceph.rook.io "myfs": the object has been
modified; please apply your changes to the latest version
and try again'

Function 'updateStatus' now returns the new/updated
CephFilesystem object if successfully updated or nil.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
(cherry picked from commit 7e87c67536)
2023-01-24 14:57:55 +00:00
Rakshith R 4dac8a2ce4 csi: add default version to images if it is missing
Rook will now append internal default versions to custom
csi image variables passed down if version is missing in
them.
This will enable users using their private registries to
just pass different image names while rook takes care
of adding default versions to them.

Resolves: #10529

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 12fd87f40b)
2023-01-24 14:52:48 +00:00
Madhu Rajanna 8593a5398d core: unset messenger2 configuration
Unset encryption configuration and default
rbd map option when the encryption is not
enabled or it disabled after sometime.

Unset compression option also when the compression
is disabled.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit d1a86f6a63)
2023-01-18 15:52:14 +00:00
Madhu Rajanna 14fd3fbc83 csi: fix custom ceph.conf for csi pods
we need to set the variable in the template
instead of the global variable for the
template rendering.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 436a87ea13)
2023-01-18 14:32:26 +00:00
Jiffin Tony Thottan 8d8b03d189 test: update kv version for rgw-kms tests
The test is getting time out while checking backend version for kv
engines in RGW KMS unit tests.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit c4984208e8)
2023-01-17 20:32:59 +00:00
subhamkrai c861c73219 webhook: disable webhook by default
sadly, we need to disable webhook by default until
we find solution to https://github.com/rook/rook/issues/10719

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit e9e2313126)
2023-01-12 18:18:24 +00:00
Madhu Rajanna d119592974 core: set rbd_default_map_options for encryption
Set rbd_default_map_options to secure when encryption
is enabled or else set it to prefer-crc.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit bc41df4dd8)
2023-01-12 14:35:35 +00:00
Madhu Rajanna 71eb14afb2 csi: update sidecars to latest release
update all the kubernetes sidecars to the latest
release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit f11e65f40c)
2023-01-06 07:59:29 -07:00
parth-gr e8708ed8f8 external: dont call telemetry if the cluster is external
closes: https://github.com/rook/rook/issues/11470
Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit a52e2f1794)
2023-01-03 17:15:15 +00:00
Yuma Ogami 304734cf7d osd: add expand-bluefs init container for host-based cluster
OSD is not resized in host-based clusters even though expanding
the backing block device. It's due to the lack of bluefs-bdev-expand
init container.

Closes: https://github.com/rook/rook/issues/10930
Signed-off-by: Yuma Ogami <yuma-ogami@cybozu.co.jp>
(cherry picked from commit 7599f1bc6b)
2023-01-03 06:36:10 +00:00
Yuma Ogami a9a8517086 osd: add unit test for chown-container-data-dir init container
Signed-off-by: Yuma Ogami <yuma-ogami@cybozu.co.jp>
(cherry picked from commit c6c264df84)
2023-01-03 06:36:09 +00:00
subhamkrai 544219d3de operator: adding logs for debugging
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit de604d3689)
2022-12-16 05:19:53 +00:00
Travis Nielsen 671210eeab 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>
(cherry picked from commit 2a16cd857c)
2022-12-16 02:16:14 +00:00
Travis Nielsen db4a16fd10 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>
(cherry picked from commit 9975e09406)
2022-12-16 02:16:14 +00:00
mergify[bot] 553379f91f Merge pull request #11445 from rook/mergify/bp/release-1.10/pr-11301
OSD prepare job cannot create vols with /dev/mapper alias on PVCs (backport #11301)
2022-12-16 00:43:25 +00:00
mergify[bot] 1ea6cde404 Merge pull request #11426 from rook/mergify/bp/release-1.10/pr-11414
osd: Replace dot with dash in storageClassDeviceSet names since used as volume names (backport #11414)
2022-12-16 00:17:30 +00:00
Travis Nielsen 0c27d65f81 core: read mon secret from file instead of env var
Environment variables are not recommended for secrets in pods since
they can be easily leaked if the environemnt variables are logged.
By mounting the mon secret as a file, the mgr and osd prepare pods
can read the mon secret from a file for better security.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 403335177a)
2022-12-15 11:06:06 -07:00
Travis Nielsen 89aa70996b core: remove unnecessary env vars from pod specs
The fsid, username, and user secrets were from legacy and no
longer needed on the osd daemon or mon pods. This removes the
unnecessary env vars from the pod specs.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 33e824a323)
2022-12-15 17:28:22 +00:00
ausias-armesto 9ed945156e 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>
(cherry picked from commit f55c4573cf)
2022-12-15 17:06:21 +00:00
subhamkrai 70f4447575 operator: disable webhook by default
disable webhook in downstream cluster.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 159fe3ae6f)
2022-12-15 16:26:25 +00:00
Travis Nielsen 32ae0529d2 osd: replace dot with dash in pvc names
The volume names of a pod must follow the standard naming convention
which does not allow periods in the name. Since the device set name
is used as the pvc name and then the volume name to attach to the osd
prepare job, we must sanitize the name for the invalid character
and replace it.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 4a70d3489d)
2022-12-12 16:57:56 +00:00
Travis Nielsen 080c7a0049 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>
(cherry picked from commit 8a94bb20ae)
2022-12-12 09:13:59 +00:00
Rakshith R 69d628ce9b 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>
(cherry picked from commit 24fa9ed935)
2022-12-08 18:26:46 +00:00
Jiffin Tony Thottan da9a5d7553 rgw: remove rgw_rados_pool_pg_num_min for metadata pool creation
rgw_rados_pool_pg_num_min is deprecated and no longer valid in qunicy
with https://github.com/ceph/ceph/pull/46234, remove that option from
cephobject-controller as well

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit 5f1b443662)
2022-12-06 14:37:43 +00:00
Travis Nielsen d0dc21efd9 core: set env var for ceph msgr to use random nonce
Ceph will use a random nonce for the msgr daemons as long as
they are running as PID 1 or have the environment variable
CEPH_USE_RANDOM_NONCE set to indicate running in a containerized
environment. While the Ceph daemons in Rook are expected to
run in PID 1, there are some environments where the container
runtime may choose to run something else such as
/usr/bin/pod as PID 1. The side effect then is that ceph uses
the pid as the nonce and causes problems when the daemons
restart with the same PID.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 31a8fb1e6a)
2022-12-02 04:13:20 +00:00
Rakshith R 61a38020a7 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>
(cherry picked from commit bde286ef49)
2022-12-01 16:08:22 +00:00
Satoru Takeuchi db2d875fe7 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>
(cherry picked from commit 36f8074938)
2022-11-29 02:19:41 +00:00
Santosh Pillai f80f53e51b core: parse peer pool ouput with --out-file flag
When mirror logs are enabled, `ceph osd pool get <poolname> all` command returns peer pool info along
with the debug logs. This causes error while parsing the logs for json
data. Using --out-file flag saves the json data in the file which can be
parsed easily while logging will still be written to stdout/stderr.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
(cherry picked from commit 4f3cd1d030)
2022-11-28 16:02:38 +00:00
Shinya Hayashi c424b3c42e csi: add a parameter to modify the maxUnavailable value of rbd daemonset
The default value of maxUnavailable of daemonset is 1.
Sometimes the upgrade can be slow due to this setting.
So I add a parameter to change the value for rbd daemonset.

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
Co-authored-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Co-authored-by: Yuji Ito <llamerada.jp@gmail.com>
(cherry picked from commit ac4b47d71a)

# Conflicts:
#	Documentation/Helm-Charts/operator-chart.md
2022-11-24 10:53:08 +00:00
Sebastian Hasler 1835ee4802 operator: fix a bug where crash collectors in wrong namespaces were deleted
Fixes #11321

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
(cherry picked from commit 120c7dddcb)
2022-11-17 18:43:31 +00:00
Travis Nielsen e566124b2c Merge pull request #11285 from rook/mergify/bp/release-1.10/pr-11280
core: include userID/userKey to secret generated from CephClient (backport #11280)
2022-11-11 14:53:44 -07:00
Travis Nielsen a52a8820a5 Merge pull request #11288 from rook/mergify/bp/release-1.10/pr-10887
mon: Remove out of quorum mons from ceph.conf (backport #10887)
2022-11-11 14:53:20 -07:00
Nitin Goyal 86b09e8058 object: mark endpoint as a optional field
Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
2022-11-11 16:32:30 +05:30
Shinya Hayashi 13b63c4a08 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>
(cherry picked from commit 05875a3f4f)
2022-11-10 18:31:43 +00:00
parth-gr 063196d344 core: add ability to add resources on discovery daemon set
Closes: https://github.com/rook/rook/issues/11265

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 9f432b4ecb)
2022-11-10 15:00:19 +00:00
Travis Nielsen 96aef8a1ae 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>
(cherry picked from commit b6e8ea2b50)
2022-11-09 17:16:46 +00:00
Avan Thakkar afb58cfb5e core: include userID/userKey to secret generated from CephClient
Adding two new entries(userID/userKey) in the cephClient secret, so that the csi driver can easily consume

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit 47df5c37cd)
2022-11-09 14:27:36 +00:00
Blaine Gardner ecb0a92577 object: allow new status endpoints to be null
For the upgrade case, allow the status endpoints to have null slices.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-11-08 13:33:31 -07:00
Blaine Gardner cb10fe35fa object: do not create service for external object stores
External CephObjectStores already have endpoints defined by
spec.gateway.externalRgwEndpoints, and if the external store is
configured with TLS (HTTPS), the store's certificates will likely not
accept connections intended for the Service endpoint Rook creates. Some
users might not be able to easily add the service endpoint to their
certificates. Therefore, don't even bother creating a Service for
external clusters.

This does introduce a few issues. The Service seems to have been
initially created to allow multiple external RGW endpoints to be
addressable via a single address in Rook. For all connections to an
external CephObjectStore with multiple endpoints, simply choose an
endpoint at random. Random selection will prevent Rook from failing to
create buckets or users on an external store if one of the external
store's endpoints fails.

The latest OBC library (lib-bucket-provisioner) allows updating the
endpoints on ObjectBuckets after they are created. This allows Rook
users to change endpoints on external CephObjectStores without breaking
all existing OBCs. It requires implementation of the new GetUserID()
library call, requires updating Provision() and Grant() calls to be
idempotent, and it requires removing the Update() call.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit a777b1d7d1)

# Conflicts:
#	pkg/apis/ceph.rook.io/v1/types.go
2022-11-07 14:30:58 -07:00
Travis Nielsen d56d722fe4 mon: use the assimilate mode for setall commands
The monstore has a SetAll method for applying multiple settings
that was applying them individually. Now we use the assimilate
config option to make this more efficient.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 1291885501)
2022-11-04 16:57:13 +00:00
Travis Nielsen 4e0e3f62fc mon: refactor helper to assimilate mon store settings
More settings can use the assimilate command if refactored
to a different go package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 0514547d56)
2022-11-04 16:57:13 +00:00
Travis Nielsen c9506ed826 Merge pull request #11264 from rook/mergify/bp/release-1.10/pr-11233
core: validate crd name size from admission controller  (backport #11233)
2022-11-03 14:06:37 -06:00
parth-gr 3673c110c2 core: validate crd name size from admission controller
Closes: https://github.com/rook/rook/issues/11212

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 7bd863d5ab)
2022-11-03 16:48:34 +00:00
parth-gr 36981a161e osd: add deviceType label to an OSD
Closes: https://github.com/rook/rook/issues/11059

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 3bcc29e1ff)
2022-11-03 14:56:36 +00:00
Travis Nielsen fd397caf77 Merge pull request #11144 from rook/mergify/bp/release-1.10/pr-10721
pool: add timeout to ceph cmd (backport #10721)
2022-10-31 13:25:45 -06:00
Travis Nielsen ec226e6c68 security: run the crash collector as ceph user
The crash collector does not have the command line arguments
to run as ceph user id 167, so we set the security context
to run as the ceph user in the main crash collector
container.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit df6d7af355)
2022-10-31 17:14:39 +00:00
Travis Nielsen a809631456 mon: the mon daemons maintain host network settings
If the host network setting is changed in the cluster CR,
the existing mons must continue using the same network
settings or else the operator would update their pod
specs with the incorrect settings and cause mon quorum
to go down. Now the network setting is preserved so
the admin could switch between host and non-host network
configuration without reinstalling.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 61840324be)
2022-10-27 17:34:59 +00:00
Travis Nielsen d73e4f90e8 core: remove finalizer from cluster cr last
Removing the finalizers from cluster resources can intermittently fail
in the CI if other updates are made at similar times. The controller
runtime will retry after the failure, but if something external
removes the finalizer on the cephcluster CR, the deletion will not
continue with the removal of finalizers from the other configmap
and secret critical resources.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 0ede2946a8)
2022-10-26 21:15:26 +00:00