Commit Graph
1285 Commits
Author SHA1 Message Date
Travis Nielsen cebcf0a04e Merge pull request #6353 from leseb/fix-obc-external
ceph: fix obc upgrade from 1.3 to 1.4 external cluster
2020-10-01 07:37:35 -06:00
Sébastien Han d2d1da5970 ceph: fix obc upgrade from 1.3 to 1.4 external cluster
During the 1.3 cycle, we had implemented support for OBC external mode
through an Endpoint in the StorageClass parameter. In 1.4, this is not
the case anymore as we directly use the CephObjectStore external mode.
However, we must maintain backward compatibility with the cluster using
the Endpoint and not fail the upgrade.
Thus checking for a CephObjectStore is invalid and should not always be
assumed, now if we detect an Endpoint we return a simple context which
fixes the upgrade.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-01 11:33:54 +02:00
subhamkrai 0fddfcf307 ceph: handle golangci-lint linter errcheck error
this commit handle golangci-lint linter errcheck.

`errcheck` - Errcheck is a program for checking for
unchecked errors in go programs. These unchecked errors
can be critical bugs in some cases

To see only staticcheck linter output
`golangci-lint run --disable-all -E errcheck`

Signed-off-by: subhamkrai <srai@redhat.com>
2020-09-30 22:24:34 +05:30
Sébastien Han 61b2c6186d Merge pull request #6350 from leseb/fix-luks2-resize
ceph: disable keyring after opening encrypted block
2020-09-30 16:42:51 +02:00
Sébastien Han a7e78858ce ceph: disable keyring after opening encrypted block
On LUKS2 format, the resize operation requires the KEK to be passed. To
maintain a single simple init container for resize, we now open the
encrypted block with  "--disable-keyring" so that further operations
won't require the keyring.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-30 15:53:36 +02:00
Sébastien Han 7852f75418 Merge pull request #6344 from varshar16/create-user-per-nfs-daemon
ceph: create user for each ganesha daemon
2020-09-30 10:49:07 +02:00
Varsha Rao 8d3140c8a0 ceph: create user for each ganesha daemon
Ganesha daemons don't need to acess ceph cluster with admin capabilities.
Instead new user with restricted caps can be used.

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-09-29 22:27:17 +05:30
Travis Nielsen 5351968181 Merge pull request #6330 from travisn/osd-reconcile-perf
ceph: Detect OSDs on PVCs in batches instead of with label selectors individually
2020-09-29 09:24:35 -06:00
Sébastien Han eecfa1b7b0 Merge pull request #6338 from thotz/fixobcdeleteissue
ceph: remove user unlink while deleting OBC
2020-09-29 17:14:04 +02:00
Jiffin Tony Thottan b7bc51ea69 ceph: remove user unlink while deleting OBC
User unlink is performed just before deleting OBC resources.
Since user is internal to OBC and next to remove to delete user,
unlinking user is not necessary.

Fixes: 6300
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-09-29 17:20:54 +05:30
Madhu Rajanna 2fa3e71733 ceph: update cephcsi to v3.1.1
as cephcsi v3.1.1 is released today
with many bug fixes and enhancements,
more details can be found at
https://github.com/ceph/ceph-csi/releases/tag/v3.1.1

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-09-29 14:03:44 +05:30
Travis Nielsen caa51e4cb8 ceph: detect osd deployments on pvcs in a batch
OSD prepare jobs only need to be run if the OSD deployments on PVCs were
not already started. For efficiency, we now query them in a batch instead
of querying them one-by-one with a label selector, which proves to be very
slow in large clusters.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-28 12:52:17 -06:00
Travis Nielsen c73022060a ceph: detect osd pvcs in a batch
The OSD PVCs were being detected one by one with a label selector.
This proves to be slow in large clusters. Instead, we now make this
more efficient by querying for all existing PVCs and looking up their
existing in memory with a map.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-28 12:52:17 -06:00
Mudit Agarwal c547b36aa0 ceph: update csi sidecar images
This PR makes the changes in csi templates and
upgrade documentation required for updating
csi sidecar images.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2020-09-28 18:58:52 +05:30
subhamkrai de8dbbcdcc ceph: handle golangci-lint linter staticcheck error
this commit handle golangci-lint linter staticcheck error.

`staticcheck` - Staticcheck is a go vet on steroids,
applying a ton of static analysis checks.

To see only `staticcheck` linter output

`golangci-lint run --disable-all -E staticcheck`

Signed-off-by: subhamkrai <srai@redhat.com>
2020-09-24 15:04:55 +05:30
Travis Nielsen 2b9e7a5335 ceph: allow osd pvc template name set to any value
The pvc template name has either been require to be empty, or one of the
expected values such as data and metadata. Those who upgrade from 1.1
may find that if they changed it to something else, their upgrade will
fail when not one of these values. If there is only a single template,
always treat it as the data template.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-22 15:20:54 -06:00
subhamkrai 829778f251 ceph: handle golangci-lint linter ineffassign
this commit will enable one more linter ineffassign
in golangci-lint.

This linter throws an error when variable is assigned and never used.

`golangci-lint run --disable-all -E ineffassign` is used detects ineffassign
errors only.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-21 14:31:18 +05:30
Travis Nielsen 02fa0eb921 Merge pull request #6228 from Madhu-1/fix-ownerref
ceph: remove owner reference set by rook on csidriver
2020-09-18 10:09:36 -06:00
Travis Nielsen bbb59d4949 Merge pull request #6274 from alimaredia/object-zonegroup-testing
ceph: add unit tests for zone group
2020-09-18 09:56:47 -06:00
subhamkrai 1e9bb8e6e2 ceph: handle golangci-lint linter deadcode
this commit will enable one more linter `deadcode`
in golangci-lint .

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-18 16:53:49 +05:30
Sébastien Han d118bd38a6 Merge pull request #6278 from subhamkrai/golanci-lint-unused
ceph: handle golangci-lint linter unused
2020-09-18 12:44:37 +02:00
Sébastien Han 204ffd4065 Merge pull request #6250 from leseb/mirroring-config
ceph: add rbd-mirror configuration
2020-09-18 09:16:08 +02:00
Ali Maredia 2ffb4ab057 ceph: add unit tests for zone group
Add unit tests for CephObjectZoneGroup, with
minor fixes to the realm unit tests.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-09-17 23:57:40 -04:00
Travis Nielsen 524362f9e4 ceph: avoid duplicating env vars in the osd deployments
The OSD deployments have some env vars duplicated in the pod spec for
the daemon container, which may cause the detection for patch changes
to fail. Now we ensure the env vars are not duplicated in the OSD pod
spec.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-17 13:43:05 -06:00
subhamkrai f9fafe62d4 ceph: handle golangci-lint linter unused
this commit will enable one more linter
in golangci-lint.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-17 22:53:24 +05:30
Sébastien Han 451622a955 ceph: add rbd-mirror configuration
Rook is now capable of configuring mirroring between sites. The
implementation works at different levels:

* CephBlockPool: which introduces a new `mirroring` configuration as well
as `statusCheck`. When turned on, Rook will enable mirroring on the
pool. It will also create a bootstrap peer token and store it in a
Kubernetes Secret. The name of that Secret can be found in the Status
field of the CephBlockPool CRD. This token can be fetched and used by
other clusters to configure the site as a peer. Mirroring can be
configured either at the pool or the image level.

* CephRBDMirror: which introduces a new `peers` configuration allowing
Rook to connect to peers by passing a Secret name. The administrator will
create a Kubernetes Secret with 2 keys: 'token' for the bootstrap peer
token and 'pool' for the name of pool. Once detected the rbd-mirror
controller will go ahead and import the peer configuration.

Pool mirroring status example:

```
status:
  info:
    rbdMirrorBootstrapPeerSecretName: pool-peer-token-test
  mirroringInfo:
    lastChanged: "2020-09-17T14:47:27Z"
    lastChecked: "2020-09-17T14:48:27Z"
    summary:
      summary:
        mode: image
        peers:
        - client_name: client.rbd-mirror-peer
          direction: rx-tx
          mirror_uuid: ""
          site_name: rhcs
          uuid: c50522a4-28a4-4bd3-ba68-e11780308882
        site_name: 91eae0dd-06b1-4d2c-91f3-1311c9df382b-rook-ceph
  mirroringStatus:
    lastChecked: "2020-09-17T14:48:27Z"
    summary:
      summary:
        daemon_health: OK
        health: OK
        image_health: OK
        states:
          replaying: 1
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-17 19:05:04 +02:00
Sébastien Han a9aad94570 Merge pull request #6276 from leseb/mgr-check-version
ceph: only run version check for monitoring
2020-09-17 16:53:25 +02:00
Sébastien Han 6f894a6de8 ceph: only run version check for monitoring
We only need to read the ceph cluster version if the cluster external
has external monitoring enabled.
This avoids any issue during upgrades from 1.3 to 1.4 when monitoring is
enabled and ceph caps have not been updated.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-17 15:20:46 +02:00
subhamkrai 25c116a4bd ceph: handle golangci-lint linter gosimple
this commit handles all the errors  check for
golangci-lint linter gosimple.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-17 15:10:27 +05:30
Varsha Rao 195dee9bc2 ceph: set ROOK_CEPH_CLUSTER_CRD_NAME with cluster name
ROOK_CEPH_CLUSTER_CRD_NAME is incorrectly set to cluster namespace value

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-09-16 23:53:52 +05:30
Travis Nielsen 00e6398fe8 Merge pull request #6235 from fanjunwei/user_truncated_node_name
ceph: Use truncated node name
2020-09-15 13:19:49 -06:00
Madhu Rajanna a1024ebc75 ceph: remove owner reference set by rook on csidriver
currently, we are setting the rook operator as owner
on the csidriver objects,  as csidriver is cluster
scoped object we should not set namespaced object as
owner on cluster scoped object

fixes #6162

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-09-15 11:39:27 +05:30
Travis Nielsen da863e4156 ceph: do not change selector labels during upgrade
The selector labels used for mons cannot change during upgrade
or else the upgrade will hang when the cluster is checking
for mon status immediately after the upgrade begins.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-14 21:43:25 -06:00
Travis Nielsen 4df34f4bf4 Merge pull request #6226 from leseb/fix-6217
ceph: allow running rgw in rook with external mode
2020-09-14 11:18:53 -06:00
Travis Nielsen 2052d5e657 Merge pull request #6225 from subhamkrai/add-label-osd
ceph: add storageClassDeviceSet label to osd pods
2020-09-11 09:15:13 -06:00
Sébastien Han 61dea11de3 Merge pull request #6234 from subhamkrai/fix-dns-suffix
ceph: fixed DNS suffix breaks in custom DNS suffix clusters
2020-09-11 15:06:59 +02:00
fanjunwei f013add62e ceph: use truncated node name
Signed-off-by: fanjunwei <fanjunwei@t2cloud.net>
2020-09-11 19:48:38 +08:00
subhamkrai 209dc6251d ceph: fixed DNS suffix breaks in custom DNS suffix clusters
By addding ".svc" to the endpoint of the object store,
will fix the custom DNS suffix cluster.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-11 13:29:53 +05:30
Sébastien Han a51b76889a ceph: allow running rgw in rook with external mode
We don't fail anymore if the cluster is external and user wants to
bootstrap rgw gateways in Kubernertes.

Closes: https://github.com/rook/rook/issues/6217
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-11 09:28:40 +02:00
Madhu Rajanna b88373f9f3 ceph: dont set ownerRef when creating csidriver object
currently, we are setting the rook operator as the
owner on the csidriver objects, as csidriver is cluster
the scoped object we should not set a namespaced object
as owner on cluster scoped object.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-09-11 11:59:44 +05:30
subhamkrai 6d08d94948 ceph: add storageClassDeviceSet label to osd pods
this commit will add a new flag to the osd pods
which will be named according to the name of the
storageClassDeviceSet. This will help in differentiate
pods immediately.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-11 07:26:40 +05:30
Travis Nielsen 7a6620f2c0 ceph: remove orphaned mon pvc after failed failover
If the mon failover fails, if the mon is on a pvc, the pvc could remain
orphaned. This is likely to happen if there is not a node available
for scheduling the mon. Therefore, the operator will ensure after a failover
that any orphaned mon pvc is cleaned up.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-10 10:21:33 -06:00
Travis Nielsen 2e36913dad ceph: set the pvc name label on mon deployments
When the mons are based on pvcs, the pvc_name label was not being set
as expected. Now the label will always be set on both the canary and
the daemon pods.

The mon pvcs were also never being deleted during canary cleanup. This
code is now removed since we must be very careful when the pvcs are
removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-09 16:08:07 -06:00
subhamkrai 34d27d55d5 ceph: update cephobjectstore monitoring logic
currently, cephobjectstore monitoring is never
stopped for the following flow:
 1. objectstore is deleted
 2. go routine is stopped
 3. objectstore is created
 4. objectstore is deleted
so, removing clusterResourceDeleted flag and
working with the map only.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-03 15:58:48 +05:30
Varsha Rao a0dab8faab ceph: remove NParts and Cache_Size from MDCACHE block
As setting them to small value affects the performance and they are not related
to metadata caching. https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/495185

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-09-02 16:41:15 +05:30
Sébastien Han 152ebf618d ceph: only enable init container if dash is enabled
If the dashboard module is not enabled we don't need to run the
"dashboard-server-addr" init container.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-01 11:42:40 +02:00
Sébastien Han 96b4a56a57 ceph: silence aws s3 sdk logs on healthcheck
We don't need to activate the debug logs on the objectstore
healthchecks.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-01 09:32:15 +02:00
Sébastien Han af72502fe4 ceph: do not use label selector on external svc
When the cluster is external there are no running pods so setting a
Selector on the Service Spec does not make sense, even worse, it makes
Kubernetes reconciling and overriding the configured endpoint.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-01 09:32:15 +02:00
Sébastien Han bd90f9afe9 ceph: add more error handling and debug logging
The predicate was lacking from very useful errors as well as logging
messages.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-01 09:32:15 +02:00
Sébastien Han e7043edbd8 ceph: reconcile if cm is config override
Earlier, we were returning only when the object was not the config
override configmap, we want the opposite.
Also, this was blocking all subsequent conditions and add the correct
check to avoid cm to reconcile.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-01 09:32:15 +02:00