Commit Graph
2509 Commits
Author SHA1 Message Date
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
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
Sébastien Han af30b0a5b8 Merge pull request #9417 from BlaineEXE/fix-health-checker-when-force-deleted
pool: file: object: clean up health checkers for force deletion
2021-12-14 09:16:04 +01:00
Blaine Gardner 0c76be8c38 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>
2021-12-13 16:07:01 -07:00
Sébastien Han 5c1e459a6a 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>
2021-12-13 14:02:33 +01:00
Sébastien Han 200fb569f4 Merge pull request #9395 from y1r/add-context-k8sutil-kvstore
core: add context parameter to k8sutil kvstore
2021-12-13 11:44:58 +01:00
Sébastien Han 97b41eacdc Merge pull request #9391 from y1r/add-context-k8sutil-pvc
core: add context parameter to k8sutil pvc
2021-12-13 10:07:11 +01:00
Sébastien Han 9d345cafdf Merge pull request #9392 from y1r/add-context-k8sutil-prometheus
core: add context parameter to k8sutil prometheus
2021-12-13 10:06:09 +01:00
Sébastien Han ba8c6e061f Merge pull request #9394 from y1r/add-context-k8sutil-configmap
core: add context parameter to k8sutil configMap
2021-12-13 10:05:31 +01:00
Sébastien Han 870114fc91 Merge pull request #9393 from y1r/add-context-k8sutil-endpoint
core: add context parameter to k8sutil endpoint
2021-12-13 10:04:19 +01:00
Sébastien Han 0ffb22faa3 Merge pull request #9396 from y1r/add-context-k8sutil-service
core: add context parameter to k8sutil service
2021-12-13 10:03:37 +01:00
Yuichiro Ueno b6ce262e7f 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>
2021-12-11 11:42:31 +09:00
Yuichiro Ueno 03e976b52c 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>
2021-12-11 11:40:28 +09:00
Yuichiro Ueno 5352cf58a7 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>
2021-12-11 11:32:46 +09:00
Yuichiro Ueno c6c8dca0a7 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>
2021-12-11 11:29:24 +09:00
Yuichiro Ueno d1d252c5c2 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>
2021-12-11 11:26:21 +09:00
Yuichiro Ueno 25f784194d 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>
2021-12-11 11:21:55 +09:00
Yuichiro Ueno 0d8c581aa9 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>
2021-12-11 11:17:12 +09:00
Sébastien Han 1f7536ffab 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>
2021-12-10 10:14:15 +01:00
Blaine Gardner aaecc93315 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>
2021-12-08 13:56:28 -07:00
Blaine Gardner a99f8985b0 Merge pull request #9150 from yuvalif/ceph-notifications-refactor
ceph: bucket notifications refactoring work
2021-12-08 11:30:15 -07:00
Sébastien Han e5ce6abac0 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>
2021-12-08 17:31:44 +01:00
Sébastien Han 4f1a2d47a4 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>
2021-12-08 17:30:49 +01:00
Sébastien Han fdd243d3de 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>
2021-12-08 17:30:07 +01:00
Travis Nielsen c953032d09 Merge pull request #8678 from parth-gr/Recommended-labels
core: create rook resources with k8s recommended labels
2021-12-07 11:53:33 -07:00
Yuval Lifshitz f2b065a3ae 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>
2021-12-07 18:24:46 +02:00
parth-gr 0a86d26b2e core: create rook resources with k8s recommended labels
Adding Recommended Labels on the resources created by rook
    and using Recommended Labels in the helm chart,
    for better visuals and management of k8s object

Closes: https://github.com/rook/rook/issues/8400
Signed-off-by: parth-gr <paarora@redhat.com>
2021-12-07 18:16:44 +05:30
Travis Nielsen 9d2aa1f6bd test: generate long node name depending on test suite
The generation of a long node name in the integration tests was
being done based on the k8s version. In the past, older K8s versions
did not support the changing name. Now it's more maintainable if
we generate the long name depending on the test suite.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-06 08:03:56 -07:00
Travis Nielsen ee83ca74af osd: truncate osd prepare job names further
In K8s 1.22 there is a bug in the job name generation that
the job name is truncated an additional 10 characters. This can cause an issue
in the generated pod name if it then ends in a non-alphanumeric character. In that case,
we more aggressively generate a hashed job name.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-06 08:02:04 -07:00
Travis Nielsen d55669293a mon: set stretch tiebreaker reliably during failover
The failover of the arbiter mon in a stretch cluster was sometimes
failing due to the new tiebreaker not being set in ceph.
Rook would repeatedly try to remove the old tiebreaker mon
and keep failing because the new tiebreaker had not been set.
Now we make setting the tiebreaker idempotent in case the operator
restarts in the middle of the operation or some other corner
case causes the expected tiebreaker to be set. In that case,
the next reconcile will also ensure the tiebreaker mon is
set as expected.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-02 12:50:07 -07:00
Travis Nielsen 32a884ac18 osd: honor skipUpgradeChecks for osds
Skipping upgrade checks was not being honored for OSDs.
Now the flag will be checked and allow the OSDs to be upgraded
without checking for the ok-to-stop condition.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-01 14:41:53 -07:00
Humble Chirammal e5f5d9be9f csi: mount host's /etc/selinux in node plugins
This commit introduces a new configuration option for
ceph csi driver to enable hostpath mounting of /etc/selinux
directory from the cluster node where csi plugin pods are
running, which inturn help the csi driver to specify
selinux-related mount options like context.

Ref# https://github.com/ceph/ceph-csi/issues/2295

The default value for this configuration is true and if cluster
nodes are running without selinux enabled, an admin can deploy
csi pods by specifying this option to `false` which skip the
host path mounting for the csi pods.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-12-01 11:13:26 +05:30
Sébastien Han 4a5ba05777 Merge pull request #9272 from olivierbouffet/fix9100
object: fix search user in objectstore
2021-11-30 16:23:30 +01:00
Sébastien Han decc481d40 Merge pull request #8740 from leseb/examples-layout
core: change directory layout
2021-11-30 16:02:37 +01:00
Sébastien Han c890710b63 core: change directory layout
As per discussion, proposing a new layout for the charts/yaml/olm files.

./deploy
├── charts
│   ├── rook-ceph
│   │   └── templates
│   └── rook-ceph-cluster
│       └── templates
├── examples
│   ├── csi
│   │   ├── cephfs
│   │   └── rbd
│   ├── flex
│   ├── monitoring
│   ├── pre-k8s-1.16
└── olm
    └── assemble

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-30 09:12:53 +01:00
Olivier Bouffet 5edeff4df8 object: fix search user in objectstore
avoid failed reconcile when multiple multisite objectstore are configured

Signed-off-by: Olivier Bouffet <olivier.bouffet@infomaniak.com>
2021-11-29 20:38:22 +01:00
Sébastien Han 83f7c2be87 Merge pull request #9259 from parth-gr/deviceClass
osd: update existing OSDs with deviceClass
2021-11-29 18:06:08 +01:00
parth-gr cbe505d122 osd: update existing OSDs with deviceClass
If we apply useAllNodes to false for the current deployment,
the OSDs should get updated with the individual nodes values and config,
The deviceClass was not updating to the existing OSDs because there was
bug in the check.
The check osdInfo.DeviceClass == "" which should be
checked like this osdInfo.DeviceClass == "None"

Updated the code so OSDs can make use of the devices present

Signed-off-by: parth-gr <paarora@redhat.com>
2021-11-29 21:40:02 +05:30
Sébastien Han bd962e3e85 Merge pull request #9104 from BlaineEXE/nfs-restart-with-configmap
nfs: restart nfs servers when configmap is updated
2021-11-26 17:06:16 +01:00
Olivier 561cede1ef object: fix rgw ceph config
use Zone and ZoneGroup instead of storename for rgw_zone and rgw_zonegroup

Signed-off-by: Olivier Bouffet <olivier.bouffet@infomaniak.com>
(cherry picked from commit c92270cd66)
2021-11-25 18:38:42 +01:00
Mara Sophie Grosch 733878b1eb monitoring: update label on prometheus resources
Updating the promethes reources (PrometheusRule and ServiceMonitor) is
done by fetching the current resource from the server and updating the
spec on it. This commit makes it also apply the labels, so users can
update them via rook CRDs.

Closes: https://github.com/rook/rook/issues/9241
Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
2021-11-24 17:17:02 +01:00
Sébastien Han e008464327 Merge pull request #9224 from leseb/fix-9205
nfs: only set the pool size when it exists and always run default pool creation
2021-11-24 14:36:14 +01:00
Sébastien Han f3142847d3 nfs: always run default pool creation
Previously, if the pool was present we would not run the pool creation
again. This is a problem if the pool spec changes, the new settings will
never be applied.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-24 14:04:19 +01:00
Travis Nielsen 801b5d65a7 Merge pull request #9180 from LittleFox94/8502-monitoring-labels
#8502: Make monitoring object labels overridable
2021-11-23 09:44:06 -07:00
Sébastien Han e9f9a40138 Merge pull request #9212 from travisn/admin-test-cluster
core: Ensure cluster name is available on cluster info
2021-11-22 11:50:55 +01:00
Blaine Gardner 03ba7dec64 pool: file: object: clean up stop health checkers
Clean up the code used to stop health checkers for all controllers
(pool, file, object). Health checkers should now be stopped when
removing the finalizer for a forced deletion when the CephCluster does
not exist. This prevents leaking a running health checker for a resource
that is going to be imminently removed.

Also tidy the health checker stopping code so that it is similar for all
3 controllers. Of note, the object controller now uses namespace and
name for the object health checker, which would create a problem for
users who create a CephObjectStore with the same name in different
namespaces.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-19 10:29:12 -07:00
Travis Nielsen 1afd322650 core: ensure cluster name is available on cluster info
The cluster info is important context for the cluster controller to
create the cluster, and all the fields must be properly set.
A test cluster name was being set temporarily, resulting in
mons incorrectly getting the wrong cluster CR name. There is no
known issue from the temporary value, it was just exposed by
https://github.com/rook/rook/pull/8678 setting the value to a label.

Now the functions are more clearly named so only unit and
integration tests should be using the test value for the cluster
name where it is not important.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-11-18 15:30:26 -07:00