Commit Graph
2530 Commits
Author SHA1 Message Date
Madhu Rajanna 64641a6ce8 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>
(cherry picked from commit 39825f2302)
2022-01-21 18:30:10 +00:00
mergify[bot] de94acad37 Merge pull request #9629 from rook/mergify/bp/release-1.8/pr-9626
csi: updates the default csi-addons image (backport #9626)
2022-01-21 14:43:19 +00:00
yati1998 aadd5f7ef8 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>
(cherry picked from commit 07c5fc7e46)
2022-01-21 14:17:14 +00:00
Sébastien Han b006674fea 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>
(cherry picked from commit 739abf6662)
2022-01-21 14:13:39 +00:00
Sébastien Han 496fe25b84 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>
(cherry picked from commit 640d30339d)
2022-01-21 14:13:38 +00:00
Sébastien Han 989fb34381 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>
(cherry picked from commit 92ada52610)
2022-01-21 14:13:37 +00:00
Sébastien Han 08dd2b9732 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>
(cherry picked from commit 1208bc1410)
2022-01-20 16:53:40 +00:00
Satoru Takeuchi 638741890c 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>
(cherry picked from commit 5465481e0b)
2022-01-19 17:39:28 +00:00
subhamkrai 2e0c595d33 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>
(cherry picked from commit 02d43e82e0)
2022-01-19 14:51:31 +00:00
yati1998 a399615828 csi: implement csi-addons sidecar
This commit implements the csi-addons sidecar.

Signed-off-by: yati1998 <ypadia@redhat.com>
(cherry picked from commit 2b92dc812c)
2022-01-18 16:55:25 +00:00
Humble Chirammal b94b6cc84d 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>
(cherry picked from commit b7584f3007)
2022-01-18 11:17:07 +00:00
Humble Chirammal 3eb97c8c6b csi: update ceph csi images to release 3.5.0
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
(cherry picked from commit e8d9884f05)
2022-01-18 11:17:07 +00:00
subhamkrai 8064519193 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>
(cherry picked from commit d87be97a50)
2022-01-17 16:33:33 +00:00
Sébastien Han ab35743c4a Merge pull request #9573 from rook/mergify/bp/release-1.8/pr-9545
osd: add ibm key protect kms (backport #9545)
2022-01-17 09:31:51 +01:00
Travis Nielsen be72954b70 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>
(cherry picked from commit 11127f54ca)
2022-01-13 19:21:43 +00:00
Sébastien Han a676a6cf2a 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>
(cherry picked from commit a7acf490b6)
2022-01-13 17:11:57 +00:00
Satoru Takeuchi 1332d7c041 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>
(cherry picked from commit af88b50fc7)
2022-01-06 16:19:49 +00:00
Yuval Lifshitz e13d8c17fc 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>
(cherry picked from commit 11727b1673)
2022-01-04 19:59:17 +00:00
Blaine Gardner 86c2301cfc 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>
(cherry picked from commit c07d89d9ea)
2022-01-04 18:04:06 +00:00
Sébastien Han 78c296589f 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>
(cherry picked from commit dd67b866dc)
2022-01-04 16:54:06 +00:00
mergify[bot] 06ac5cb699 Merge pull request #9481 from rook/mergify/bp/release-1.8/pr-9384
subvolumegroup: add new crd (backport #9384)
2021-12-21 17:51:50 +00:00
Sébastien Han 21c6a89541 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>
(cherry picked from commit 6e9eb33782)
2021-12-21 17:24:36 +00:00
Jiffin Tony Thottan c3db97f83d 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>
(cherry picked from commit 9d9acc2db1)
2021-12-21 17:24:14 +00:00
Sébastien Han 7b1a08d427 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>
(cherry picked from commit 05775b068d)
2021-12-21 15:15:18 +00:00
Sébastien Han eab4073431 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>
(cherry picked from commit da76a772f8)
2021-12-20 16:18:44 +00:00
Sébastien Han bd678416c2 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>
(cherry picked from commit 52ededd151)
2021-12-20 16:18:43 +00:00
Blaine Gardner 769e774719 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>
(cherry picked from commit da61ac1ae8)
2021-12-20 15:42:58 +00:00
Travis Nielsen 8645d241fa 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>
(cherry picked from commit 0c19f62df2)
2021-12-16 16:54:34 +00:00
Travis Nielsen d9fc61c3f2 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>
(cherry picked from commit 7ee9cc9d56)
2021-12-15 23:04:34 +00:00
Sébastien Han 108f566eb9 mgr: run active-watch as root and privileged
For now, we must run the container with UID 0 and privileged for
multiple reasons:

* the rook binary writes ceph config to /var/lib/rook which is owned by
  root
* it's difficult to use /etc/ceph since it will conflict with the
  rook-ceph-override configmap AND is also owned by root since it's a
  mounted configmap.
* using /etc/ceph might be possible but has other issues with rook's
  exec package since the ceph config is built from /var/lib/rook

Closes: https://github.com/rook/rook/issues/9385
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 5c1e459a6a)
2021-12-15 19:21:02 +00:00
Denis Egorenko 07fb393fca 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>
(cherry picked from commit 3ff681e81d)
2021-12-14 18:05:19 +00:00
Blaine Gardner 09b599b4cb pool: file: object: clean up health checkers for force deletion
When CephBlockPool, CephFilesystem, or CephObjectStore resources are
deleted after removing their finalizer, the code path to stop monitoring
was not stopping monitoring since a non-present resource does not have a
name and namespace attached. When the object is deleted, ensure the
internal representation used to stop monitoring has a name and namespace
to fix the issue.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit 0c76be8c38)
2021-12-14 08:16:44 +00:00
Yuichiro Ueno 7715cc45ae core: add context parameter to k8sutil kvstore
This commit adds context parameter to k8sutil kvstore functions. By
this, we can handle cancellation during API call of kvstore resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit 0d8c581aa9)
2021-12-13 10:45:14 +00:00
Sébastien Han b2f04d9e3d Merge pull request #9404 from rook/mergify/bp/release-1.8/pr-9396
core: add context parameter to k8sutil service (backport #9396)
2021-12-13 11:44:27 +01:00
mergify[bot] fd8166efe9 Merge pull request #9408 from rook/mergify/bp/release-1.8/pr-9391
core: add context parameter to k8sutil pvc (backport #9391)
2021-12-13 09:56:50 +00:00
mergify[bot] cbfb85fa2d Merge pull request #9407 from rook/mergify/bp/release-1.8/pr-9392
core: add context parameter to k8sutil prometheus (backport #9392)
2021-12-13 09:50:04 +00:00
mergify[bot] a0fa8aa931 Merge pull request #9406 from rook/mergify/bp/release-1.8/pr-9394
core: add context parameter to k8sutil configMap (backport #9394)
2021-12-13 09:42:17 +00:00
mergify[bot] c8d4ff15e0 Merge pull request #9405 from rook/mergify/bp/release-1.8/pr-9393
core: add context parameter to k8sutil endpoint (backport #9393)
2021-12-13 09:31:19 +00:00
Yuichiro Ueno a538db9138 core: add context parameter to k8sutil pvc
This commit adds context parameter to k8sutil pvc functions. By this, we
can handle cancellation during API call of pvc resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit 5352cf58a7)
2021-12-13 09:07:23 +00:00
Yuichiro Ueno b82061cbf5 core: add context parameter to k8sutil prometheus
This commit adds context parameter to k8sutil prometheus functions. By
this, we can handle cancellation during API call of prometheus resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit c6c8dca0a7)
2021-12-13 09:06:21 +00:00
Yuichiro Ueno 83271a0bb5 core: add context parameter to k8sutil configMap
This commit adds context parameter to k8sutil configMap functions. By
this, we can handle cancellation during API call of configMap resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit 25f784194d)
2021-12-13 09:05:44 +00:00
Yuichiro Ueno 463696e202 core: add context parameter to k8sutil endpoint
This commit adds context parameter to k8sutil endpoint functions. By
this, we can handle cancellation during API call of endpoint resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit d1d252c5c2)
2021-12-13 09:04:30 +00:00
Yuichiro Ueno 9bfd142433 core: add context parameter to k8sutil service
This commit adds context parameter to k8sutil service functions. By
this, we can handle cancellation during API call of service resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit 03e976b52c)
2021-12-13 09:03:48 +00:00
Yuichiro Ueno 1d26abf53b core: add context to k8sutil replicaset and secret
This commit adds context parameter to k8sutil replicaset and secret
functions. By this, we can handle cancellation during API call of
replicaset and secret resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
(cherry picked from commit b6ce262e7f)
2021-12-13 09:02:47 +00:00
Sébastien Han 0f5658f715 osd: cleanup cluster using the root UID
We need to use the root UID to run the cleanup job since ceph-volume
does not support running as non-root in all the versions. We have this
ceph tracker to allow this https://tracker.ceph.com/issues/53511 but
it's not in all ceph's versions. Implementing a version check is tricky
since at this stage the cluster is being deleted and it's hard to catch
it.

Closes: https://github.com/rook/rook/issues/9375
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 1f7536ffab)
2021-12-10 17:26:56 +00:00
Yuval Lifshitz 83529d5cf1 rgw: refactor bucket notification code
this should make sure code reuse between the OBC label controller and
the CephBucketNotification controller.
done as part of the cleanup work from:
https://github.com/rook/rook/pull/8426

this also include adding unit tests for:
- topic controller
- notification controller
- obc label controller

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit f2b065a3ae)
2021-12-08 23:12:31 +00:00
Blaine Gardner 400e39e994 nfs: remove poolConfig
Remove the poolConfig in CephNFS to prevent different CephNFS CRs from
contending to change the replication spec of the default NFS pool.

Resolves #9355

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit aaecc93315)
2021-12-08 22:35:47 +00:00
Sébastien Han e58939a2a0 core: continue and create an initial cluster info or fail
Let's catch the correct error when no cluster info exists yet. If we
have another error, we fail the orchestration and try again. This could
help up catching small API hiccups for example.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit e5ce6abac0)
2021-12-08 17:08:43 +00:00
Sébastien Han 0e28e48c8d core: fix error message
Let's have a more accurate and correct error message that reflects what
the failing function tried to do.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 4f1a2d47a4)
2021-12-08 17:08:42 +00:00
Sébastien Han 60fb7f0ae9 core: always return nil on error
We should always return a nil pointer of clusterInfo if
CreateOrLoadClusterInfo() returns an error.

Closes: https://github.com/rook/rook/issues/9314
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit fdd243d3de)
2021-12-08 17:08:42 +00:00