Commit Graph
5960 Commits
Author SHA1 Message Date
Satoru Takeuchi d3ebaedc32 Merge pull request #6696 from leseb/fix-6685
ceph: fix metadata device passed by-id
2020-11-26 07:57:04 +09:00
Sébastien Han 78f22fcf6a Merge pull request #6693 from leseb/abort-reconcile-simple
ceph: ability to abort orchestration
2020-11-25 16:23:01 +01:00
Sébastien Han ad24990473 ceph: ability to abort orchestration
We can now prioritize orchestrations on certain event. Today only two
events will cancel on-going orchestrations (if any):

* request for cluster deletion
* request for cluster upgrade

If one of the two are caught by the watcher we will cancel the on-going
orchestration.
For that we implemented a simple approach based on check points, where
we will check for a cancellation request in certain part of the
orchestration. Mainly before each mons/mgr/osds orchestration loops.

This solution is not perfect, but we are waiting for the
controller-runtime to release its 0.7 version which will embed context
support. With that we will be able to cancel reconciles more precisely
and rapidly.

Operator log example:

```
2020-11-24 13:54:59.499719 I | op-mon: parsing mon endpoints: a=10.109.126.120:6789
2020-11-24 13:54:59.499719 I | op-mon: parsing mon endpoints: a=10.109.126.120:6789
2020-11-25 12:59:12.986264 I | ceph-cluster-controller: done reconciling ceph cluster in namespace "rook-ceph"
2020-11-25 13:07:33.776947 I | ceph-cluster-controller: CR has changed for "rook-ceph". diff=  v1.ClusterSpec{
        CephVersion: v1.CephVersionSpec{
                Image:            "ceph/ceph:v15.2.5",
-               AllowUnsupported: true,
+               AllowUnsupported: false,
        },
        DriveGroups: nil,
        Storage:     {UseAllNodes: true, Selection: {UseAllDevices: &true}},
        ... // 20 identical fields
  }
2020-11-25 13:07:33.777039 I | ceph-cluster-controller: reconciling ceph cluster in namespace "rook-ceph"
2020-11-25 13:07:33.785088 I | op-mon: parsing mon endpoints: a=10.107.242.49:6789,b=10.109.71.30:6789,c=10.98.93.224:6789
2020-11-25 13:07:33.788626 I | ceph-cluster-controller: detecting the ceph image version for image ceph/ceph:v15.2.5...
2020-11-25 13:07:35.280789 I | ceph-cluster-controller: detected ceph image version: "15.2.5-0 octopus"
2020-11-25 13:07:35.280806 I | ceph-cluster-controller: validating ceph version from provided image
2020-11-25 13:07:35.285888 I | op-mon: parsing mon endpoints: a=10.107.242.49:6789,b=10.109.71.30:6789,c=10.98.93.224:6789
2020-11-25 13:07:35.287828 I | cephclient: writing config file /var/lib/rook/rook-ceph/rook-ceph.config
2020-11-25 13:07:35.288082 I | cephclient: generated admin config in /var/lib/rook/rook-ceph
2020-11-25 13:07:35.621625 I | ceph-cluster-controller: cluster "rook-ceph": version "15.2.5-0 octopus" detected for image "ceph/ceph:v15.2.5"
2020-11-25 13:07:35.642688 I | op-mon: start running mons
2020-11-25 13:07:35.646323 I | op-mon: parsing mon endpoints: a=10.107.242.49:6789,b=10.109.71.30:6789,c=10.98.93.224:6789
2020-11-25 13:07:35.654070 I | op-mon: saved mon endpoints to config map map[csi-cluster-config-json:[{"clusterID":"rook-ceph","monitors":["10.107.242.49:6789","10.109.71.30:6789","10.98.93.224:6789"]}] data:a=10.107.242.49:6789,b=10.109.71.30:6789,c=10.98.93.224:6789 mapping:{"node":{"a":{"Name":"minikube","Hostname":"minikube","Address":"192.168.39.3"},"b":{"Name":"minikube","Hostname":"minikube","Address":"192.168.39.3"},"c":{"Name":"minikube","Hostname":"minikube","Address":"192.168.39.3"}}} maxMonId:2]
2020-11-25 13:07:35.868253 I | cephclient: writing config file /var/lib/rook/rook-ceph/rook-ceph.config
2020-11-25 13:07:35.868573 I | cephclient: generated admin config in /var/lib/rook/rook-ceph
2020-11-25 13:07:37.074353 I | op-mon: targeting the mon count 3
2020-11-25 13:07:38.153435 I | op-mon: checking for basic quorum with existing mons
2020-11-25 13:07:38.178029 I | op-mon: mon "a" endpoint is [v2:10.107.242.49:3300,v1:10.107.242.49:6789]
2020-11-25 13:07:38.670191 I | op-mon: mon "b" endpoint is [v2:10.109.71.30:3300,v1:10.109.71.30:6789]
2020-11-25 13:07:39.477820 I | op-mon: mon "c" endpoint is [v2:10.98.93.224:3300,v1:10.98.93.224:6789]
2020-11-25 13:07:39.874094 I | op-mon: saved mon endpoints to config map map[csi-cluster-config-json:[{"clusterID":"rook-ceph","monitors":["10.107.242.49:6789","10.109.71.30:6789","10.98.93.224:6789"]}] data:a=10.107.242.49:6789,b=10.109.71.30:6789,c=10.98.93.224:6789 mapping:{"node":{"a":{"Name":"minikube","Hostname":"minikube","Address":"192.168.39.3"},"b":{"Name":"minikube","Hostname":"minikube","Address":"192.168.39.3"},"c":{"Name":"minikube","Hostname":"minikube","Address":"192.168.39.3"}}} maxMonId:2]
2020-11-25 13:07:40.467999 I | cephclient: writing config file /var/lib/rook/rook-ceph/rook-ceph.config
2020-11-25 13:07:40.469733 I | cephclient: generated admin config in /var/lib/rook/rook-ceph
2020-11-25 13:07:41.071710 I | cephclient: writing config file /var/lib/rook/rook-ceph/rook-ceph.config
2020-11-25 13:07:41.078903 I | cephclient: generated admin config in /var/lib/rook/rook-ceph
2020-11-25 13:07:41.125233 I | op-mon: deployment for mon rook-ceph-mon-a already exists. updating if needed
2020-11-25 13:07:41.327778 I | op-k8sutil: updating deployment "rook-ceph-mon-a" after verifying it is safe to stop
2020-11-25 13:07:41.327895 I | op-mon: checking if we can stop the deployment rook-ceph-mon-a
2020-11-25 13:07:44.045644 I | op-k8sutil: finished waiting for updated deployment "rook-ceph-mon-a"
2020-11-25 13:07:44.045706 I | op-mon: checking if we can continue the deployment rook-ceph-mon-a
2020-11-25 13:07:44.045740 I | op-mon: waiting for mon quorum with [a b c]
2020-11-25 13:07:44.109159 I | op-mon: mons running: [a b c]
2020-11-25 13:07:44.474596 I | op-mon: Monitors in quorum: [a b c]
2020-11-25 13:07:44.478565 I | op-mon: deployment for mon rook-ceph-mon-b already exists. updating if needed
2020-11-25 13:07:44.493374 I | op-k8sutil: updating deployment "rook-ceph-mon-b" after verifying it is safe to stop
2020-11-25 13:07:44.493403 I | op-mon: checking if we can stop the deployment rook-ceph-mon-b
2020-11-25 13:07:47.135524 I | op-k8sutil: finished waiting for updated deployment "rook-ceph-mon-b"
2020-11-25 13:07:47.135542 I | op-mon: checking if we can continue the deployment rook-ceph-mon-b
2020-11-25 13:07:47.135551 I | op-mon: waiting for mon quorum with [a b c]
2020-11-25 13:07:47.148820 I | op-mon: mons running: [a b c]
2020-11-25 13:07:47.445946 I | op-mon: Monitors in quorum: [a b c]
2020-11-25 13:07:47.448991 I | op-mon: deployment for mon rook-ceph-mon-c already exists. updating if needed
2020-11-25 13:07:47.462041 I | op-k8sutil: updating deployment "rook-ceph-mon-c" after verifying it is safe to stop
2020-11-25 13:07:47.462060 I | op-mon: checking if we can stop the deployment rook-ceph-mon-c
2020-11-25 13:07:48.853118 I | ceph-cluster-controller: CR has changed for "rook-ceph". diff=  v1.ClusterSpec{
        CephVersion: v1.CephVersionSpec{
-               Image:            "ceph/ceph:v15.2.5",
+               Image:            "ceph/ceph:v15.2.6",
                AllowUnsupported: false,
        },
        DriveGroups: nil,
        Storage:     {UseAllNodes: true, Selection: {UseAllDevices: &true}},
        ... // 20 identical fields
  }
2020-11-25 13:07:48.853140 I | ceph-cluster-controller: upgrade requested, cancelling any ongoing orchestration
2020-11-25 13:07:50.119584 I | op-k8sutil: finished waiting for updated deployment "rook-ceph-mon-c"
2020-11-25 13:07:50.119606 I | op-mon: checking if we can continue the deployment rook-ceph-mon-c
2020-11-25 13:07:50.119619 I | op-mon: waiting for mon quorum with [a b c]
2020-11-25 13:07:50.130860 I | op-mon: mons running: [a b c]
2020-11-25 13:07:50.431341 I | op-mon: Monitors in quorum: [a b c]
2020-11-25 13:07:50.431361 I | op-mon: mons created: 3
2020-11-25 13:07:50.734156 I | op-mon: waiting for mon quorum with [a b c]
2020-11-25 13:07:50.745763 I | op-mon: mons running: [a b c]
2020-11-25 13:07:51.045108 I | op-mon: Monitors in quorum: [a b c]
2020-11-25 13:07:51.054497 E | ceph-cluster-controller: failed to reconcile. failed to reconcile cluster "rook-ceph": failed to configure local ceph cluster: failed to create cluster: CANCELLING CURRENT ORCHESTATION
2020-11-25 13:07:52.055208 I | ceph-cluster-controller: reconciling ceph cluster in namespace "rook-ceph"
2020-11-25 13:07:52.070690 I | op-mon: parsing mon endpoints: a=10.107.242.49:6789,b=10.109.71.30:6789,c=10.98.93.224:6789
2020-11-25 13:07:52.088979 I | ceph-cluster-controller: detecting the ceph image version for image ceph/ceph:v15.2.6...
2020-11-25 13:07:53.904811 I | ceph-cluster-controller: detected ceph image version: "15.2.6-0 octopus"
2020-11-25 13:07:53.904862 I | ceph-cluster-controller: validating ceph version from provided image
```

Closes: https://github.com/rook/rook/issues/6587
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-25 15:32:04 +01:00
Sébastien Han 5d9612c2ae ceph: fix metadata device passed by-id
The code was assuming that devices were passed by the user as
"/dev/sda", this is bad! We all know people should be using paths like
/dev/disk/by-id so we must support them.

Closes: https://github.com/rook/rook/issues/6685
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-25 15:00:47 +01:00
Sébastien Han 4d8af284a0 Merge pull request #6417 from renan-campos/issue_6332
ceph: periodically prune crash entries older than user-provided days
2020-11-25 09:49:09 +01:00
Renan Campos ad9dcb0c05 ceph: periodically prune crash entries older than user-provided days
Rook's crashcollector pod posts entries to the ceph cluster when a crash occurs.
Over time the number cluster may hold crash entries needlessly.
To clean up old crash entries, this PR adds a field to the ceph cluster CR for the user to specify the number of days a crash entry should be kept for.
Providing a value for the field keepXDays creates a cronjob that runs every day at midnight, calling "ceph crash prune <keepXDays>".

Closes: https://github.com/rook/rook/issues/6332
Signed-off-by: Renan Campos <rcampos@redhat.com>
2020-11-24 17:06:18 -05:00
Sébastien Han 70c6752e0e ceph: add dedicated predicate for CephCluster object
Since we want to pass a context to it, let's extract the logic into its
own predicate.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-24 18:21:07 +01:00
Sébastien Han 9b9f45b792 ceph: export isDoNotReconcile function
Since the predicate for the CephCluster object will soon move into its
own predidacte we need to export isDoNotReconcile so that it can be
consummed by the "cluster" package.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-24 18:21:02 +01:00
Sébastien Han 10dd8e1184 ceph: remove "createInstance" function
Since we moved to the controller-runtime, events are processed one by
one and so are reconciles. This means we won't have multiple
orchestrations happening at the same time. Thus removing this code.

Also removing one unused variable.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-24 18:20:37 +01:00
Sébastien Han 0d1d9d423f Merge pull request #6697 from leseb/fix-codespell
bot: fix codespell issue
2020-11-24 11:59:15 +01:00
Sébastien Han 3da9f2212f bot: fix codespell issue
Make the bot happy.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-24 11:41:09 +01:00
Sébastien Han f86f8300f9 Merge pull request #6568 from aruniiird/upgrade-dependencies-for-operator-sdk-1.x
Bump Controller Runtime version to 0.6
2020-11-19 17:45:18 +01:00
Travis Nielsen b7140be523 Merge pull request #6676 from Madhu-1/csi-v3.1.2
ceph: update cephcsi to latest v3.1.2 release
2020-11-19 09:06:10 -07:00
Travis Nielsen 21293021e3 Merge pull request #6664 from subhamkrai/update-jenkins
ceph: update Jenkins to skip Ceph tests
2020-11-19 08:52:00 -07:00
Sébastien Han d276705904 Merge pull request #6582 from leseb/mergify-auto-merge
bot: auto-merge pull request under conditions and do not run ci when no code changes
2020-11-19 16:09:50 +01:00
Madhu Rajanna ca3e23853e ceph: update cephcsi to latest release
updating cephcsi to v3.1.2 which is a latest
bugfix release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-11-19 12:20:11 +05:30
subhamkrai 4895ced365 ci: update Jenkins to skip Ceph tests
we now run our ceph test or ceph suite
using GitHub actions, we can skip
Jenkins test for the same.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-19 10:36:34 +05:30
Travis Nielsen 54560250e9 Merge pull request #6497 from sp98/osd-pdb-reconciler
ceph: OSD PDB reconciler changes
2020-11-18 17:30:24 -07:00
Sébastien Han cd08296f08 ci: skip codespell on go.sum
We don't need to lint go.sum since it's auto generated.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 18:37:56 +01:00
Sébastien Han 97be23e374 ceph: apply finalizer before updating object status
We must add the finalizer right after the object creation otherwise the
seerver will later return an error on update that the object has been
modified. Indeed, it has been by the task that updates the status when
the object is first created.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 18:16:59 +01:00
Arun Kumar Mohan f5fc08b8e6 ceph: changes after the latest multus CSI updates
Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 22:11:08 +05:30
Arun Kumar Mohan ded16f779d ceph: changes for 'sigs.k8s.io/sig-storage-lib-external-provisioner/v6'
Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:14:03 +05:30
Arun Kumar Mohan 65d16bfc94 ceph: manual changes needed for kubernetes api updates
Fetched latest lib-bucket-provisioner changes as well.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:14:01 +05:30
Arun Kumar Mohan 9ff98995a3 ceph: changes made by running make codegen target
Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:03:40 +05:30
Arun Kumar Mohan 421f340c1c ceph: updating the dependencies for operator SDK v1.0.0
Updating the dependencies' versions to match with the newer Operator SDK
version v1.x

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:03:40 +05:30
Sébastien Han 4545ddc11f Merge pull request #6666 from leseb/fix-6580
ci: fix device intermittent failure
2020-11-18 15:39:15 +01:00
Sébastien Han a08e08104b Merge pull request #6553 from leseb/mirroring-snap-sched
ceph: add snapshot scheduling for mirrored pools
2020-11-18 15:34:55 +01:00
Santosh Pillai 8602b9c116 ceph: osd pdb reconciler changes
-creates a single PDB (max-unavailable=1) for all OSDs.  This PDB allows one OSD to go down at a given time.
-When a drain is detected, blocking PDBs (max-unavailable=0) will be created for each failure domain that is not being drained and the main PDB (max-unavilable=1) will be deleted. This will allow all the OSDs in the currently drained failure domain to be removed while blocking the deletion  of OSDs in other failure domains.
-Once the PGs are healthy again, the blocking PDBs will be deleted and the main PDB will be restored.
-Add PG healthcheck timeout
-Delete any legacy node drain pods and blocking OSD PDBs

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-11-18 18:25:07 +05:30
Sébastien Han 38e475601b ci: probe the device and wait for udev
When we are done creating the partitions it's good to give the kernel
some time to reprobe the device and for udev to finish syncing up.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 12:16:14 +01:00
Sébastien Han dcd84e63ac ci: use sudo test if the device is a block
Permissions on the disk might changed due to the partitions being
created. So the CI user is not able to read the device correctly.

Closes: https://github.com/rook/rook/issues/6580
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 12:15:57 +01:00
Sébastien Han aac0e5fdf8 Merge pull request #6506 from subhamkrai/gh-test
ci: run integration test on github actions
2020-11-18 10:37:01 +01:00
Sébastien Han f121e95625 Merge pull request #6658 from travisn/restore-mon-endpoint
ceph: Restore mon clusterIP if the service is missing
2020-11-18 10:33:39 +01:00
Sébastien Han 2686f4e23e Merge pull request #6592 from sp98/update-cleanupPolicy-design
ceph: update cleanupPolicy design doc
2020-11-18 10:01:50 +01:00
Sébastien Han afc7ecff31 ceph: add snapshot scheduling for mirrored pools
Now, we can schedule snapshots on pools from the CephBlockPool CR when
the pool is mirrored.
It can be enabled like this:

```
mirroring:
  enabled: true
  mode: pool
  snapshotSchedules:
    - interval: 24h # daily snapshots
      startTime: 14:00:00-05:00
```

Multiple schedules are supported since snapshotSchedules is a list.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 09:50:09 +01:00
Travis Nielsen 66de535a8a ceph: restore mon clusterIP if missing
In a disaster recovery scenario, the mon service may have been
accidentally deleted, while the expected mon endpoint is still
found in the mon endpoints configmap. In this case, we create
the mon service with the same endpoint as previously.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-17 22:54:19 -07:00
subhamkrai 49a3511532 ci: manifests changes to run gh action
to run the integration test there needs
to be a few changes in manifests like using
`deviceFilter` and other related changes.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-18 09:31:07 +05:30
subhamkrai c240e70f55 ci: run integration test on github actions
as we are planning to move toward Github actions
for integration test. This commit runs ceph
suites using Github action.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-18 09:11:48 +05:30
Travis Nielsen 6ffd778a18 Merge pull request #6655 from travisn/helm-crd-warning
docs: Clarify helm warning that could delete cluster
2020-11-17 16:47:21 -07:00
Travis Nielsen ba534ce285 docs: clarify helm warning that could delete cluster
In the helm chart the CRDs are installed if crds.enabled is set to
true. If false, the helm chart will not install them. If changed
to false during an upgrade, the CRDs will be removed and the cluster
is destroyed. There is no way to prevent this while still being flexible
about CRD management, so we make the warnings as clear as possible.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-17 15:45:33 -07:00
Travis Nielsen 41ca374e9f Merge pull request #6396 from rohan47/multus-csi
ceph: support ceph cluster and CSI on multus in different namespace
2020-11-17 10:41:05 -07:00
Travis Nielsen dbba7d70ed Merge pull request #6648 from leseb/fix-6644
ceph: add external script to the container image
2020-11-17 09:16:49 -07:00
Travis Nielsen 8c7a8ff942 Merge pull request #6646 from sp98/update-quickstart-doc
ceph: update ceph quick start doc to use new crds.yaml file
2020-11-17 08:19:13 -07:00
Santosh Pillai fcd07f099a ceph: update ceph quick start doc to use new crds.yaml file
crds were factored out from the common.yaml file and helm chart. This PR updates the quick start guide to use crds.yaml file.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-11-17 20:39:01 +05:30
rohan47 5b5059ec2f ceph: support NAD from diffrent namespaces
Added the support of NAD from diffrent namespaces.
they can be referrenced as <namespace>/<name-of-nad> e.g.,
default/public-nw.
Updated the multus doc to explain the same.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2020-11-17 20:34:58 +05:30
Sébastien Han 43484cb96b ceph: add external script to the container image
We now ship the Rook container image with our external cluster scripts.

Closes: https://github.com/rook/rook/issues/6644
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-17 12:06:27 +01:00
Santosh Pillai cd936b64db ceph: update cleanupPolicy design doc
Cleanup Policy design doc is not up to date to with respect to latest implementation. This PR updates the design doc.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-11-17 12:59:32 +05:30
Sébastien Han 5c87f0f331 bot: add rule to auto-merge on no code changes
On pull request with no code changes, the canary and integration tests
won't run. This means they won't appear in the status and mergify cannot
validate them.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-16 18:05:11 +01:00
Sébastien Han b011fd579b ci: add build job
Run the build **only** when no go files have changed since the other job
will build Rook anyway.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-16 18:05:11 +01:00
Sébastien Han 2d1cf09d8d ci: only run the canary test on code changes
If no Go files changed we do not run the CI.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-16 18:05:07 +01:00
rohan47 cb9f947c3b ceph: support ceph cluster and CSI on multus in diffrent namespace
Support ceph cluster and CSI on multus deployed in diffrent namespace.
Previously csi was looking for multus config from the cluster deployed
in the namespace in which rook-ceph-operator/csi was deployed.
Now it will look for multus configuration from ceph clusters from all
the namespaces.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2020-11-16 20:47:09 +05:30