To help with code readability, include daemons from `pkg/daemon/ceph`
as `<dmn>daemon "github.com/rook/rook/pkg/daemon/ceph/<dmn>`. This will
make it easier to understand code lines without needing to scroll up to
check the includes, as there are mon/mds/mgr/osd/rgw packages for
daemons as well as operator and cmd.
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
Create a cephconfig module in Ceph's daemon pkg source, and refactor the
config and keyring generation that exists in the mon package into the
new cephconfig package. The config/keyring generation code is used by
most all daemons and not just mon, so a new package is a more
appropriate place for this.
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
We maybe roundup the size to the next `MB` boundary in some cases
when creating the volume, thus we need to make sure the size of
the PV generated is consistent with the actual one.
Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Current code will truncate the generated RBD image in some cases,
this PR will round up the size to make sure the final RBD image
generated can cover all the required data space.
Also, corresponding unit test cases added to verify the change.
Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Rook no longer supports Kubernetes < 1.7
Remove a workaround for k8s < 1.6.4 where `runAsNonRoot` could not be
explicitly set to false.
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
We don't use volume manager argument in NewClusterController()
and NewFlexvolumeServer() functions, so remove the unused volume
manager parameter from those functions.
Signed-off-by: Dennis Chen <dennis.chen@arm.com>
This has been the correct style since luminous. The
"allow *" version works fine but is more power than
needed.
Signed-off-by: John Spray <john.spray@redhat.com>
While the mgr can mostly do its job with just
mon caps, modules expect to also have access
to OSD and MDS daemons at will (e.g. for the dashboard
to display the MDS session list)
This change matches what other Ceph deployment tools do.
Signed-off-by: John Spray <john.spray@redhat.com>
We don't need to handle other osd(s) related tasks if there's
no valid nodes available in the cluster to run osd(s), log a
warning message to help user identify the cause of the issue.
Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Current Ceph volume manager code doesn't take the builtin
kernel module into the account, so the `modinfo` will fail
in this case. Also, we need to add error handling code to
make sure the volume manager does work when proceeding to
continue, otherwise we will encounter the `rbd` related issue
in the following step even we have an artificial `agent` pod
in running state.
Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Fix some basic spellcheck errors. Also remove trailing spaces and make
sure files have a newline (my editor does automatically).
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
This fixes issues with a new OSD Pod in the same Deployment coming up and
directly entering CrashLoopBackOff because the old OSD Pod hasn't been fully
terminated yet (released it's locks).
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
Previously, if this failed mid-way it would then throw
an exception at the first operation when retrying (because it's
trying to reweight an OSD that might not be in the map any more)
Signed-off-by: John Spray <john.spray@redhat.com>