Commit Graph
2572 Commits
Author SHA1 Message Date
subhamkrai 16a2eef1de core: fix golangci linter
fix golangci linter

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 24802c559e)
2022-04-04 10:27:39 -06:00
Sébastien Han fc9278c040 core: reload go routine after CR is edited
Previously, the struct maintaining the list of cluster was still
initialized with a cluster item. Then the monitoring check will see that
the cluster is part of the struct already and thus won't run the
monitoring go routine again.
Now each time we cancel the context, we also remove the cluster item
from the map so that when the controller runs again, the monitoring
struct is re-populated and the go routine runs and statuses are updated.

Closes: https://github.com/rook/rook/issues/9911
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 05506e7a68)
2022-03-31 16:23:38 +02:00
Jiffin Tony Thottan edd8c83a55 object: use us-east-1 for aws go lang sdk
The aws go lang sdk needs value for region, it is set differently in
various part of current code. With PR the value is always `us-east-1` so
that it will work RGW server without any issues.

This reverts commit 280c29f330.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit fc2b8012c6)
2022-03-29 11:44:01 +05:30
Blaine Gardner ae1eab91fc core: rework usage of ReportReconcileResult
ReportReconcileResult should never be given an object that is nil. It is
impossible to force compile-time checking for this because the object's
type is an interface. We can't force this, but we can rework the
function definition to handle more cases where the object may not be
returned fully-complete, and we can rework callers to return structs
(not pointers-to-structs) so it is less likely a caller will pass nil
to the function.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit c92c6fbc36)
2022-03-11 17:03:08 +00:00
Travis Nielsen e1ef97372a csi: populate mon endpoints even if driver not enabled
If the csi driver was enabled at a later time, the mon endpoints
would not be populated. The populate the csi config, either a new
cluster reconcile or restarting the operator would be necessary.
It is simpler just to update the csi configmap with every reconcile
even if the csi driver is not enabled.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 8bce38fadb)
2022-03-11 14:36:59 +00:00
Travis Nielsen 884294952c csi: log a warning if pod namespace env var not found
If the pod namespace was not found by the csi helper to update
the mon endpoints configmap, the reconcile was failing. To allow
for the update to continue in unit tests and ignore the env var,
we only log the warning instead of failing the reconcile.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 76b349d808)
2022-03-11 14:36:59 +00:00
Travis Nielsen 87f9e81c8a mon: disable startup probe on canary pods
The canary pods are very short-lived pods and are not
running ceph in any form. The startup probe was mistakenly
enabled for the canary pod, which could cause the pod
to fail unexpectedly if the startup probe was triggered
after the delay timeout.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 22dea0a1ef)
2022-03-10 19:54:24 +00:00
mergify[bot] 17a64b61f4 Merge pull request #9876 from rook/mergify/bp/release-1.8/pr-9847
core: sync ceph fsid on cephcluster status (backport #9847)
2022-03-10 08:27:19 +00:00
mergify[bot] a2a2dc3651 Merge pull request #9877 from rook/mergify/bp/release-1.8/pr-9868
core: fix empty string bug for applying csi resources (backport #9868)
2022-03-09 18:20:00 +00:00
Tom Hellier 1cef5ea75d core: fix empty string bug
This function was always using an empty string, instead of the extracted resources

Closes: #9867
Signed-off-by: Tom Hellier <me@tomhellier.com>
(cherry picked from commit 59b4c57406)
2022-03-09 17:40:28 +00:00
parth-gr d07feea223 core: sync ceph fsid on cephcluster status
FSID will be updated with cephcluster CR status
when monitoring check get start

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 2e89ff0fd9)
2022-03-09 17:37:38 +00:00
Blaine Gardner a7d78401ba nfs: remove secret, configmap when downscaling CephNFS
When downscaling CephNFS clusters, be sure to remove secrets and
configmaps. Also be sure to only downscale for the currently-reconciling
CephNFS cluster.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit b640969a64)
2022-03-09 16:32:16 +00:00
Travis Nielsen a6f342b6a0 core: disruption controller log ceph errors in debug level
The controller for disruption budgets is verbose at cluster creation
when the cluster is not yet created, which generates a lot of noise
in the log that makes the cluster look unhealthy. This is an expected
condition, so we can change this logging to debug level.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit bc6381169e)
2022-03-04 01:07:41 +00:00
Travis Nielsen 9285c2dd84 osd: purge job will remove all pvcs for the osd
The purge job is intended to clean up all the resources
related to an OSD that is to be removed. An OSD with
a metadata, wal, and data PVC was only cleaning up the
data PVC. Now the metadata and wal PVCs will also be
cleaned up.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit b3ca0f1b87)
2022-02-28 18:09:03 +00:00
Travis Nielsen 2dc4fb2759 file: allow filesystem removal even with failures
If the filesystem is in a bad state such as never being
created successfully in the first place, the filesystem
removal will continuously fail and prevent the CR from
being removed. Thus, we treat the filesystem removal
as a best effort and log the issue instead of failing
the uninstall reconcile.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 1f8f71b396)
2022-02-24 17:16:27 +00:00
Satoru Takeuchi 5b1e6763c7 core: eliminate unnecessary code
We can eliminate the OSD creation code for Ceph < v15.2.0 because Nautilus(v14.2.z)
is no longer supported. In other words, we can now expect that all newly-created
OSDs on PVC are raw mode.

Please note that the existing lvm mode OSDs on PVCs still be supported after this change.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
(cherry picked from commit 2d8f9b67c6)
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-02-24 08:42:15 +00:00
Sébastien Han 6722d697f8 core: remove unnecessary secret validation
We don't need to validate the name of Ceph-CSI secret, simply because
the names can be different. The default example have default names but
since the secret can be created by the administrator we should not
assume anything. This check will fail if the secret names are different
for whatever reason. This is especially true for external mode. In
converged mode Rook creates the secrets on its own if needed to ease the
integration with the default StorageClass examples.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 0143a8f8ee)
2022-02-17 15:44:57 +00:00
Sébastien Han 793f999887 core: move clusterInfo discovery in converged cluster
The external code has its own mechanism to look up the clusterInfo so
let's move this to the non-external condition to clarify the code.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 47b8bb989e)
2022-02-17 15:44:57 +00:00
Sébastien Han 48feb7d4aa core: check for canceled context in external mode
This is fixing a potential race where the context is canceled and the
external cluster is trying to fetch the cluster info. If the context is
canceled then the loop will be stuck forever. Now we check for the
canceled context and return appropriately.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit fdcad15b87)
2022-02-17 15:44:56 +00:00
Madhu Rajanna 37ca1255ae core: remove rbd_default_features setting
Instead of setting the default values in the Rook
we should use the defaults provided by the ceph
it self. This configuration is causing problem
for the rbd image creation, this is not allowing
the rbd images to have default image features
which comes with librbd.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit f482b1ceba)
2022-02-17 14:30:40 +00:00
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
Travis Nielsen 4c41b5ea07 Merge pull request #9662 from rook/mergify/bp/release-1.8/pr-9658
osd: Merge all osd resources including custom (backport #9658)
2022-01-27 13:10:44 -07: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
Travis Nielsen 83f627a2e3 osd: merge all osd resources including custom
The merging of OSD resource limits and requests assumed
that only the cpu and memory resources needed to be merged.
It is also possible to set custom resource properties such
as intel.com/sriov_net_in: '1' for use with multus, so
the merging needs to be more general.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit f9ac966048)
2022-01-27 09:09:51 +00: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