Commit Graph
2554 Commits
Author SHA1 Message Date
Sébastien Han 287d9a3fbe Merge pull request #9647 from rzarzynski/wip-extra-env-vars-2
osd: allow for injecting extra env. variables via ConfigMap
2022-01-26 17:27:19 +01:00
Radoslaw Zarzynski 17ca41f557 osd: allow for injecting extra env. variables via ConfigMap
This patch brings a mechanism to define arbitrary environment
variables in OSD containers (both prepare and main ones).
It bases on idea proposed by Sebastien Han to use an optional
`ConfigMap` instance named `aook-ceph-daemon-env-override`
as the source of these settings.

The need for the patch comes from the fact that, although
crimson finally exposes the same CLI interface as the classical
OSD, the broadly used development builds have ASan built in.
As ASan, by default, complains if it isn't the very first loaded
DSO, we need a way to set the `ASAN_OPTIONS` environment variable
to `verify_asan_link_order=0` to mitigate the early aborts.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2022-01-26 15:17:27 +00:00
Travis Nielsen e0cfb4fce6 pool: check for application already being set
If the pool application is already set, skip setting it again
to avoid a warning message being logged that it is already
set.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-01-25 15:05:18 -07:00
Blaine Gardner 18c1397bcc Merge pull request #9565 from thotz/rgw-tls-cert-fix-bucket-notifications
rgw: inject tls certs for bucket notification and topic operations
2022-01-24 11:56:09 -07:00
Jiffin Tony Thottan a97747cece rgw: inject tls certs for bucket notification and topic operations
The certs for accessing TLS enabled RGW is saved as secrets and inject
them if controllers for notification and topics if request is sent to
TLS enabled RGW endpoint.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2022-01-24 22:39:57 +05:30
Eng Zer Jun ed63571530 test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir()` and is automatically removed when
the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-01-24 23:52:54 +08:00
Madhu Rajanna 39825f2302 csi: update cephcsi to 3.5.1 release
This PR updates the cephcsi version from
3.5.0 to 3.5.1 which includes minor fixes

fixes: #9619

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-01-21 23:26:07 +05:30
Travis Nielsen 4ad99d6533 Merge pull request #9603 from cybozu-go/fix-issue-9494
rgw: handle the non-existence of the bucket correctly when removing bucket
2022-01-21 09:55:44 -07:00
Travis Nielsen 6ff9e5330d Merge pull request #9626 from yati1998/cleanup
csi: updates the default csi-addons image
2022-01-21 07:17:04 -07:00
yati1998 07c5fc7e46 csi: updates the default csi-addons image
This commit updates the csi-addons image version
from v0.1.0 to v0.2.1.
Also, this updates the staging path from
{{ .KubeletDirPath }}/plugins/kubernetes.io/csi/pv/ to
{{ .KubeletDirPath }}/plugins/kubernetes.io/csi/.

This changes is done as the reclaimspace on block mode
was not working.
For more details:
 https://github.com/csi-addons/kubernetes-csi-addons/pull/97

Signed-off-by: yati1998 <ypadia@redhat.com>
2022-01-21 17:09:59 +05:30
Yuma Ogami c4ee218da1 rgw: handle the non-existence of the bucket correctly when removing bucket
ceph might return NoSuchKey than NoSuchBucket when the target bucket does not exist.
then we can use GetBucketInfo() to judge the existence of the bucket.

see: https://github.com/ceph/ceph/pull/44413

Closes: https://github.com/rook/rook/issues/9494
Signed-off-by: Yuma Ogami <yuma-ogami@cybozu.co.jp>
2022-01-21 09:29:17 +00:00
Sébastien Han 739abf6662 csi: change rook-ceph-csi-config to expose clusterID for subvolume
The rook-ceph-csi-config config map now includes CephFS subvolumegroups
when a subvolumegroup CR is created. It is useful for ceph-csi to
understand which subvolumegroup to use for a given cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-21 10:12:56 +01:00
Sébastien Han 640d30339d subvolumegroup: fix code deletion
We want to log properly when ENOTEMPTY is caught during deletion, so
fixing the condition.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-20 18:16:41 +01:00
Sébastien Han 92ada52610 nfs: use hashing function from existing k8sutil package
We have a function to hash a string so let's use it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-20 18:16:41 +01:00
Sébastien Han 1208bc1410 core: reconcile operator configuration with env var
Previously, we were ignoring configuration changes coming from the
operator's pod env variables. We were assuming most users were using the
operator configmap "rook-ceph-operator-config" but most Helm users
don't. Now we will reconcile if a cephcluster is found during a CREATE
event (can be an operator restart or a cephcluster creation) AND no
"rook-ceph-operator-config" is found which means the operator's pod env
var are used.
Also, unit tests have been added (long due) for the predicate!

Closes: #9602, #9487, #9579
Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-20 16:13:11 +01:00
Blaine Gardner d0d83edc5f Merge pull request #9502 from cybozu-go/core-support-priority-class-for-crashcollector
core: support priority class for crashcollector
2022-01-19 10:38:29 -07:00
Satoru Takeuchi 5465481e0b core: support priority class for crashcollector
Support priorityClass to crashcollectors as mons, mgrs, and osds.

https://rook.io/docs/rook/v1.8/ceph-cluster-crd.html#priority-class-names-configuration-settings

The main use case is applying the high priority to crashcollectors to preempt normal pods
under heavy load. Without this feature, we might lose crash information.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-01-19 13:54:03 +00:00
subhamkrai 02d43e82e0 mon: add annotation to mon secret and cm
add annotations to secrets and configmaps to use
different tools to sync secrets and configmap.
Currently, these annotation is applied only on
the `rook-ceph-mon-endpoints` configmap and
the secrets `rook-ceph-mon` and `rook-ceph-admin-keyring`.

Closes: https://github.com/rook/rook/issues/8999
Signed-off-by: subhamkrai <srai@redhat.com>
2022-01-19 10:15:17 +05:30
yati1998 2b92dc812c csi: implement csi-addons sidecar
This commit implements the csi-addons sidecar.

Signed-off-by: yati1998 <ypadia@redhat.com>
2022-01-18 21:52:01 +05:30
Sébastien Han b2050b0f00 Merge pull request #9581 from humblec/release-3.5
Update ceph csi release 3.5 image and sidecars
2022-01-18 12:16:53 +01:00
Humble Chirammal b7584f3007 csi: update sidecar to the latest releases
Below sidecars are updated to the latest releases with this commit.

csi-provisioner      : 3.1.0
csi-attacher         : 3.4.0
node-driver-registrar: 2.4.0

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-01-17 23:32:48 +05:30
Humble Chirammal e8d9884f05 csi: update ceph csi images to release 3.5.0
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-01-17 23:32:45 +05:30
subhamkrai d87be97a50 osd: correct bluestore compression min blob size for ssd
Update bluestore compression min blob size for ssd to 8192.
It was typo which was added long time back.

Signed-off-by: subhamkrai <srai@redhat.com>
2022-01-17 15:13:15 +05:30
Travis Nielsen f3246228d8 Merge pull request #9467 from travisn/update-mgr-service
mgr: Update services when active mgr changes
2022-01-13 12:21:03 -07:00
Sébastien Han cf5f68f378 Merge pull request #9545 from rook/kms-hpcs
osd: add ibm key protect kms
2022-01-13 18:11:15 +01:00
Blaine Gardner 3b415ea15a Merge pull request #9482 from yuvalif/ceph-cloudevent-topic
rgw: add HTTP CloudEvent endpoints to CephBucketNotification CR
2022-01-13 08:40:07 -07:00
Sébastien Han a7acf490b6 osd: add ibm key protect kms
The cluster-wide encryption feature now has a new supported key
management system: IBM Key protect. More information about the backend
can be found in Rook documentation under the

Today's implementation stores OSD encryption keys has "Standard" keys.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-13 16:02:10 +01:00
Travis Nielsen 11127f54ca mgr: update services when active mgr changes
When the active mgr changes, there may be user-created services
that also need to have their selector updated to point to the
new active mgr. Now the operator will update any service in the
rook operator namespace that has the label app=rook-ceph-mgr
to point to the active mgr.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-01-13 07:25:24 -07:00
Yuval Lifshitz c99e2a37fd rgw: add HTTP CloudEvent endpoints to CephBucketNotification CR
this add a configuration parameter that allows an RGW, from
Ceph Quincy (v17) and on, to send bucket notifications to an HTTP CloudEvents
endpoint.
Header format:
https://github.com/cloudevents/spec/blob/main/cloudevents/adapters/aws-s3.md

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-01-13 12:08:40 +02:00
Satoru Takeuchi af88b50fc7 rgw: fix startup probe
It's better to set the same handler to startupProbe as livenessProbe.
Otherwise, we might hit the following problem.

https://github.com/rook/rook/issues/6304

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-01-06 06:20:53 +00:00
Blaine Gardner 5b26cb1b22 Merge pull request #9400 from yuvalif/ceph-notification-events
rgw: add events to CephBucketNotification CR
2022-01-04 12:58:20 -07:00
Blaine Gardner 5b9ac16670 Merge pull request #9468 from BlaineEXE/startup-probes
core: rgw: allow specifying daemon startup probes
2022-01-04 11:03:12 -07:00
Sébastien Han dd67b866dc core: run discover daemonset as root uid
So that the tool inside the container has the permission to run
correctly, e.g: sgdisk.

Clsoes: https://github.com/rook/rook/issues/9493
Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-03 12:36:23 +01:00
Yuval Lifshitz 11727b1673 rgw: add events to CephBucketNotification CR
the events are used to mark the start/success/failure of the reconciliation
and also to log the bucket names on which the CephbucketNotification is
created

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2021-12-26 16:58:49 +02:00
Blaine Gardner c07d89d9ea core: rgw: allow specifying daemon startup probes
Allow specifying daemon startup probes where we also allow configuring
liveness probes. Startup probes allow Rook to tolerate when Ceph daemons
occasionally take a long time to start up while not also making
Kubernetes liveness probes slower to detect runtime failures of daemons.

Startup probes are beta in Kubernetes 1.18, so we should not enable
probes by default for earlier Kubernetes versions.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-21 15:12:41 -07:00
Blaine Gardner bb0d0d39f6 Merge pull request #9384 from leseb/fix-7036
subvolumegroup: add new crd
2021-12-21 10:24:23 -07:00
Blaine Gardner cb1b063e13 Merge pull request #9365 from thotz/bucketnotificationadditionimprovement
object: fix handling for notifications for OBC
2021-12-21 10:23:32 -07:00
Sébastien Han 6e9eb33782 subvolumegroup: add new crd
This introduces a new CRD to add the ability to create subvolumegroup
for a given ceph filesystem volume. Typically the name of the volume is
the name of the filesystem created by rook.

Closes: https://github.com/rook/rook/issues/7036
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-21 16:28:38 +01:00
Sébastien Han 05775b068d osd: handle removal of encrypted osd deployment
This is handling a tricky scenario where the OSD deployment is manually
removed and the OSD never reconvers. This is unlikely to happen, but
still OSD should be able to run after that action. Essentially after a
manual deletion, we need to run the prepare job again to re-hydrate the
OSD information so that the OSD deployment can be deployed.
On encryption, it is a little bit tricky since ceph-volume list again
the main block won't return anything, so we need to target the encrypted
block to list.
There is another case this PR does not handle, which is the removal of
the OSD deployment and then the node is restarted. This means that the
encrypted container is not opened anymore. However, opening it requires
more work like writing the key on the filesystem (if not coming from the
Kubernete secret, eg,. KMS vault) and then run luksOpen. This is an
extreme corner case probably not worth worrying about for now.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-21 10:51:09 +01:00
Sébastien Han fffb862956 Merge pull request #9457 from leseb/fix-9452
core: disallow multiple clusters in the same namespace
2021-12-20 17:18:10 +01:00
Blaine Gardner 9dc41f5796 Merge pull request #9427 from BlaineEXE/always-report-reconcile-events
operator: always report events
2021-12-20 08:42:08 -07:00
Jiffin Tony Thottan 9d9acc2db1 object: fix handling for notifications for OBC
Current approach is to delete all the existing notifcations from bucket
and re-add the notification from the labels.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-12-17 16:29:27 +05:30
Sébastien Han da76a772f8 core: disallow multiple clusters in the same namespace
Rook does not support running multiple clusters in the same namespace,
so the operator should not reconcile if a new cluster is added.
The scenario where a cluster is added while the operator is down is also
handled. CR updates are also handled.
When the operator detects more than one cluster it will refuse to
reconcile the CephCluster, and child CRDs will block too until the
operator is ready.
The user must remove one of the clusters before can continue to perform
any reconcile.

Closes: https://github.com/rook/rook/issues/9452
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-17 10:56:15 +01:00
Sébastien Han 52ededd151 core: do not log create event as info
Let's use debug not to clutter logs.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-17 10:55:31 +01:00
Travis Nielsen 0c19f62df2 mds: skip sanity check during upgrades to 16.2.7
The mons need to be configured to skip the mds sanity check
during upgrade to 16.2.7 or the mons may crash during that
upgrade.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-16 08:07:02 -07:00
Travis Nielsen 7ee9cc9d56 pool: allow configuration of built-in pools with non-k8s names
The built-in pools device_health_metrics and .nfs created by ceph
need to be configured for replicas, failure domain, etc.
To support this, we allow the pool to be created as a CR.
Since K8s does not support underscores in the resource names
the operator must translate this special pool name into
the name expected by ceph.

This also sets the basis for allowing filesystem data
pools to specify the desired pool name instead of requiring
a generated name.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-15 15:32:02 -07:00
Blaine Gardner da61ac1ae8 operator: always report events
The original PR which added event reporting unnecessarily "optimized" to
prevent spamming the API controller[1].

It is sometimes important to get events as they happen and not hide new
events behind preexisting older events. For example, in integration
tests, we may often want to wait for a controller to finish processing
an update, and the best way to do that is to wait for the
"ReconcileSucceeded" event. In order for this to be useful, the events
must be reported each time.

If we begin having problems with events being reported too often, then
we should fix the underlying issue of reconciles happening too often
instead of relying on a time-based "optimization" that hides recent
event reports that may be useful.

[1]: https://github.com/rook/rook/pull/7222

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-15 15:24:17 -07:00
Travis Nielsen 7a6a62f43b Merge pull request #9386 from leseb/mgr-active-side-car-permissions
mgr: run the watch side car config on /etc/ceph
2021-12-15 12:20:28 -07:00
Blaine Gardner 24a77d4fa1 Merge pull request #9296 from degorenko/cephfs-datapools
file: allow to create CephFS dataPools with predefined names
2021-12-14 11:04:49 -07:00
Denis Egorenko 3ff681e81d file: allow to create CephFS data pools with predefined names
Add an ability to create data pools for CephFS with predefined
names.

Related-Issue: rook#9295
Signed-off-by: Denis Egorenko <degorenko@mirantis.com>
2021-12-14 12:52:19 +04:00