Commit Graph
2050 Commits
Author SHA1 Message Date
Jiffin Tony Thottan 54ae1b1789 object: fix backend path for transit engine for rgw kms
The backend path was added with additional `transit` to it.
Also added PR test case to check transit engine

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit 0b4cdb992b)
2022-02-16 09:21:49 +00:00
Travis Nielsen 27a2d34b39 osd: write log message when node is being skipped
When a node is being skipped for creation of OSDs, log a message
that indicates whether it was from the node being unschedulable,
the node is not ready, or the node does not meet the placement
criteria specified in the cluster CR.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 4570204a1d)
2022-02-15 15:15:19 +00:00
Rakshith R 2027e7f8ef csi: cleanup csi driver resources when zero cephclusters exist
This commit modifies ceph-csi controller to be able to cleanup
ceph-csi deployment,daemonset,services & csidriver objects
when no cephcluster exists.

It makes the following changes:
- redundant check for tp.DriverNamePrefix is removed.
- retry to start drivers within reconcile loop is removed,
  controller will retry in case of error now.
- stopDrivers() will now return error in case of failure.
- predicate delete func will now respond to cephcluster deletion.
- CSI resources will be cleaned up when cephcluster does not exist.

Fixes: #9697

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 1e9920fb85)
2022-02-14 20:31:41 +00:00
Sébastien Han d233fd2293 rgw: fix variable assignment
We need to explicitly assign the ceph version within each scope since
one function returns a pointer and one is not.
Previously, the `desiredCephVersion` was recreated in the scope of the
`else` and thus a new variable `desiredCephVersion` was initialized (see
the `:=`).
Now, each scope creates and assign to clusterInfo a `desiredCephVersion`
value.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 7f32461b8f)
2022-02-14 14:18:55 +00:00
Sébastien Han dfe0601005 object: do not check for upgrade on external mode
The object child controller should not compare versions if the object
store is external. The current version comparison is using the
cmdreporter to check the ceph version of the image in the CephCluster spec.
In external mode, this image is not set so the cmdreporter fails.
Also, this check is only valid for converged mode, so external mode
should be skipped.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 856b14e60a)
2022-02-11 08:33:44 +00:00
Travis Nielsen 34971277a4 Merge pull request #9723 from rook/mergify/bp/release-1.8/pr-9702
csi: bump registar image to v2.5.0 (backport #9702)
2022-02-10 10:26:36 -07:00
Sébastien Han 6cfe02e0e3 core: do not dereference a non-pointer
In this case `oldMappingToGo` and `newMappingToGo` were not pointers so
there is nothing to dereference.
This happens when the monitors endpoints configmap is updated, but only
on the pool and file controllers. They are watching for changes on that
configmap so that they can reconcile and upate the bootstrap peers token
when replication is enabled.

Closes: https://github.com/rook/rook/issues/9714
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 32998cbda4)
2022-02-10 16:56:49 +00:00
Mathieu Parent 6c7235943a csi: bump registar image to v2.5.0
Upgrades image:

- k8s.gcr.io/sig-storage/csi-node-driver-registrar: v2.4.0 -> v2.5.0

Detailed changelog:

- https://github.com/kubernetes-csi/node-driver-registrar/blob/v2.5.0/CHANGELOG/CHANGELOG-2.5.md

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
(cherry picked from commit 405dcaadac)
2022-02-10 15:59:48 +00:00
Travis Nielsen f2f7dc7bad object: update pool properties during reconcile
The reconcile was skipping updating most pool properties for
object stores. The implementation of pools between the file,
object, and pool controllers had some duplicate code, so
this change also factors out the common code for better
reuse in a single place. Anytime a pool is created or updated,
it will now consistently update all the pool properties
that are expected to be modifiable.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 221b3dfb72)
2022-02-07 14:34:48 +00:00
Sébastien Han fccec1af0b subvolumegroup: handle external mode
If the cluster is external, users might still want to take advantage of
the ceph-csi configmap configuration for ceph filesystem subvolume
group. This configuration is handled by the controller whenever a
cephFilesystemSubVolumeGroup CR is created or deleted.
If the present cluster CephCluster is external, the controller
(cephFilesystemSubVolumeGroup) won't handle creation nor deletion of sub volume groups.
It just assumes that the given name is correct and the controller goes ahead with the
ceph-csi configuration.

Closes: #9551
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 49f75c8ec3)
2022-02-03 17:00:37 +00:00
Travis Nielsen 8fc67f7dbb Merge pull request #9677 from rook/mergify/bp/release-1.8/pr-9578
rgw: gateway deployment strategy RollingUpdate on Pacific (backport #9578)
2022-02-01 13:22:51 -07:00
micalgenus e3e070ca51 rgw: gateway deployment strategy rolling on Pacific
When the strategy type of deployment is Recreate, from the moment the end is
started until the new pod is normally running, there is no pod in the
kubernetes service endpoints, so it goes to the service unavailable state.

Therefore, it is necessary to change it to `type: RollingUpdate` instead of
`type: Recreate` so that rolling updates can be made without downtime.

Before Pacific, creating a deployment as much as the instance was okay,
but after Pacific, the replicas was increased in one deployment, so rolling
updates were set up one by one as in the previous version.

Signed-off-by: micalgenus <micalgenus@gmail.com>
(cherry picked from commit a68151e2f2)
2022-01-28 15:12:57 +00:00
Sébastien Han ce9b3ee2f2 core: dereference pointer before trying to compare with deepequal
Prior to this, we were comparing a pointer (the memory address) with a
struct. This was obviously always failing and returned false. We must
dereference the pointer to access the data contained at that memory
location.

Closes: https://github.com/rook/rook/issues/9544
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 5404ec13a2)
2022-01-28 10:20:40 +00:00
Madhu Rajanna 1d7fea8f52 csi: bump csi snapshotter image to v5
updating the csi-snapshotter and dependencies
to v5.0.1 released version.

Co-authored-by: Mathieu Parent <mathieu.parent@insee.fr>
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit cf46615688)
2022-01-27 09:32:45 -07:00
Mathieu Parent 2cd55d7bd6 csi: bump csi resizer and volume replication images
Upgraded images:

- k8s.gcr.io/sig-storage/csi-resizer: v1.3.0 -> v1.4.0
- quay.io/csiaddons/volumereplication-operator: v0.1.0 -> v0.3.0

Detailed changelogs:

- https://github.com/kubernetes-csi/external-resizer/blob/release-1.4/CHANGELOG/CHANGELOG-1.4.md
- https://github.com/csi-addons/volume-replication-operator/tree/v0.2.0
- https://github.com/csi-addons/volume-replication-operator/tree/v0.3.0

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
(cherry picked from commit 88a449d09c)
2022-01-27 09:05:16 -07:00
Radoslaw Zarzynski 98e9fe0fbc 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>
(cherry picked from commit 17ca41f557)
2022-01-26 16:27:51 +00:00
Travis Nielsen f35da8d9c4 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>
(cherry picked from commit e0cfb4fce6)
2022-01-25 22:39:48 +00:00
Jiffin Tony Thottan 0a8140463d 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>
(cherry picked from commit a97747cece)
2022-01-24 18:56:39 +00:00
Satoru Takeuchi b2937fbe98 Merge pull request #9631 from rook/mergify/bp/release-1.8/pr-9603
rgw: handle the non-existence of the bucket correctly when removing bucket (backport #9603)
2022-01-22 05:51:32 +09:00
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
Yuma Ogami daa636b9f1 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>
(cherry picked from commit c4ee218da1)
2022-01-21 16:56:26 +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
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