Commit Graph
798 Commits
Author SHA1 Message Date
giovanism 4974be4b20 rook: Move network util functions to k8sutil
rook: Remove NetworkSelector type alias

rook: Add error return value for multus funcs

Signed-off-by: giovanism <giovanism@outlook.co.id>
2019-08-26 16:17:04 +07:00
giovanism cc62702d39 ceph: Use rook's NetworkSpec with type embedding
ceph: Use the new NetworkSpec api

ceph: Change all tests to use the NetworkSpec

ceph: Remove TypeMeta field from NetworkSpec

ceph: Change IsHost network func signature

Signed-off-by: giovanism <giovanism@outlook.co.id>
2019-08-26 16:17:03 +07:00
giovanism ea14b555d9 edgefs: Replace NetworkSpec with rookv1alpha2 version
edgefs: Change IsHost and IsMultus network func signature

edgefs: Reorder mgr annotations declaration

edgefs: Update cluster CRD docs and example for NetworkSpec

Signed-off-by: giovanism <giovanism@outlook.co.id>
2019-08-26 16:17:03 +07:00
giovanism 6f48eb49e9 cockroachdb: Duplicate rook's NetworkSpec
cockroachdb: Remove TypeMeta and HostNetwork field from NetworkSpec

Signed-off-by: giovanism <giovanism@outlook.co.id>
2019-08-26 16:16:48 +07:00
Dmitry Yusupov 8412bf6b3c edgefs: Initial prototype
fix ApplyMultus

apply multus to target template spec too

Modify NetworkSpec for new proposal

Prevent duplicated multus network annotations

Rename Network "Interfaces" with "Selectors"

Signed-off-by: giovanism <giovanism@outlook.co.id>
2019-08-26 14:45:16 +07:00
Sébastien Han b3f58863e9 Merge pull request #3600 from mvollman/bugfix-osdsPerDevice
ceph: fix osdsPerDevice config
2019-08-22 20:24:01 +02:00
Sébastien Han caa8b9cb2f ceph: external refuse cluster older than Nautilus
The external cluster must run at least on Nautilus. The main reason
being the msgr2 knowledge by the Operator and the Ceph CLI.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 83eca4b7ae ceph: fix various debug messages
Debug was used instead of Debugf so types were not interpreted
correctly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han f25e4a6fbc ceph: re-adapt controller code
Re-adapt controller code with the latest changes. Split External and not
external more accuratly in initializeCluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 300e9c35e6 ceph: remove redundant call
saveMonConfig already calls WriteConnectionConfig so there is no need to
call WriteConnectionConfig again after saveMonConfig is done.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 0785962e09 ceph: update mon configmap for external cluster
With this change, the admin can specify a single mon and the operator
will add any other mons to both ClusterInfo and the configmap of mon
endpoints.

It will periodically check for changes too and update both ClusterInfo
and the configmap accordingly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 2d24065ddb ceph: add check for external cluster spec
Before attempting to do anything let's just make sure the spec is
correctly fulfilled.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 1c50b30e0e ceph: fix condition
If the secret is not found, we create it, but once it was created we
were actually returning an error. The failure for getting the config
secret must be if the error is not that the secret is not found.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 25158d3d2b ceph: purge external cluster metadata
Add code to remove configmap and secret injected and used by Rook to
connect to the external cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han c7174b6b8e ceph: allow deployment of crds on external cluster
We can now deploy all the other Rook's CRDs. They will be deployed in
Kubernetes but will consume the external cluster storage.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 062a885a98 ceph: health check populate cluster spec
When running external clusters we need to populate the cluster spec to
the health methods.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 033a664b56 ceph: controller: enhance external cluster
We now do multiple things:

* write ceph config and key to the operator
* check for the ceph verion and compare it
* set the cluster status

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han e3b2ae5278 ceph: controller rename crd to cr
We are talking about CR ressources (instanciation of CRD) so let's use
the correct word.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 7f98b77b99 ceph: controller: populate clusterInfo
For external clusters, clusterInfo must be populating so that the
heatlh checker can run correctly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 8c8c48e0ac ceph: mon: export 'cluster'
By exporting cluster to Cluster we can now reach it from the controller
health check so that it can be populated with 'cluster' data, see the
next commit for better understanding.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
travisn 0885af771f ceph: handle the external mon status
Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-22 17:19:32 +02:00
travisn 70e4c0ac19 ceph: skip local setup for an external ceph cluster
When configuring an external cluster the orchestration of discover and all the ceph
daemons will be skipped. The operator will still watch for the creation of
crds for this namespace. When a filesystem, object, object user, or
ganesha crd are created, the operator will simply print an error
to the log.

Signed-off-by: travisn <tnielsen@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:32 +02:00
travisn 12979f4259 ceph: wait for external mon connection info
Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-22 17:19:32 +02:00
travisn 7ab689ee8e ceph: skip local setup for an external ceph cluster
When configuring an external cluster the orchestration of discover and all the ceph
daemons will be skipped. The operator will still watch for the creation of
crds for this namespace. When a filesystem, object, object user, or
ganesha crd are created, the operator will simply print an error
to the log.

Signed-off-by: travisn <tnielsen@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:32 +02:00
Travis Nielsen 1d28489c4a Merge pull request #3633 from ashishranjan738/fixsds
fix(storageClassDeviceSet): fixes resource limits and placements not getting applied to osds
2019-08-20 17:38:47 -06:00
Ashish Ranjan 8d852359b9 fix ceph cluster namespace not showing in the logs
This commit fixes cluster namespace not showing in the rook operator logs.

Signed-off-by: Ashish Ranjan <aranjan@redhat.com>
2019-08-20 17:30:17 +05:30
Michael Vollman 33711b7d36 ceph: fix osdsPerDevice config
Fix variable scoping issue that is ignoring osdsPerDevice config
setting.  Ensure that in all scenarios both the global and per OSD
osdsPerDevice setting are honored.  When both are set the more specific
setting will be used. (#3599)

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-20 07:09:12 -04:00
Alexander Trost f09441f1e4 Merge pull request #3645 from galexrt/fix_3136
mgr: set public-addr flag for MGR
2019-08-19 18:26:52 +02:00
Alexander Trost 6daf4087c7 mgr: set public-addr flag for MGR
This fixes that the MGR is binding to the gateway IP instead of the
actual Pod IP, as seen in #3136.
When hostNetwork: true is set the public-addrr is not set so custom
network configs can be used.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-08-19 15:59:45 +02:00
Sébastien Han d11e051163 Merge pull request #3641 from odinuge/delete-mds-deploy
ceph: properly propagate errors when deleting mds deployment
2019-08-19 15:30:18 +02:00
Odin Ugedal 7bd1ff1049 ceph: remove duplicated code
Signed-off-by: Odin Ugedal <odin@ugedal.com>
2019-08-18 11:10:28 +02:00
Odin Ugedal 43baf63b86 ceph: properly propagate errors when deleting mds
When deleting mds deployment the error is logged, but not propagated
further down (it always returns nil). The two places using the function
checks the error, and acts upon it.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
2019-08-17 14:48:17 +02:00
Odin Ugedal 0e73bbe2f3 ceph: set osd mem target correctly
Previously, the value was set to commonArgs, resulting in dead code,
since common arg isn't used after the append.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
2019-08-16 17:29:38 +02:00
Dmitry Yusupov bfe867e16c Merge pull request #3628 from sabbot/useHostLocalTime
Add useHostLocalTime option
2019-08-15 14:33:03 -07:00
Ashish Ranjan a8827f3652 fix(storageClassDeviceSet): fixes resource limits and placements for osds
This commit fixes resource limits and placements not getting applied to osd pods provisioned using storageClassDeviceSets

Signed-off-by: Ashish Ranjan <aranjan@redhat.com>
2019-08-16 02:44:37 +05:30
Anton Skriptsov e99df703c5 Add useHostLocalTime option
Signed-off-by: Anton Skriptsov <sabbotagge@gmail.com>
2019-08-14 11:26:42 -07:00
Dmitry Yusupov d7e319af45 Merge pull request #3609 from ethan-daocloud/patch-4
edgefs: cleanup pod.go comment, fix typos
2019-08-14 10:17:51 -07:00
travisn be391de73c resolve changes from merge conflict in upgrade changes
The upgrade changes for #2901 added the check for the correct version
of the ceph image before continuing with an upgrade. This commit is
to refactor that change to work with the new code path to validate
the ceph version.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 98d0a59c91 ceph: create cluster during onUpdate event if needed
If the cluster is not successfully initialized during the onAdd event,
the cluster will not be in a properly initialized state. The admin
will likely need to update the CR, in which case the onUpdate event would
be triggered. In this case we need to call the same code path as the
onAdd event to properly initialize the cluster.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 9a3dc52a11 ceph: minimum version allowed is mimic 13.2.4
With the 1.1 release we should not be creating bluestore OSDs
with rook's legacy partitioning scheme. All new bluestore OSDs
should be created with ceph-volume. Therefore, the miminum
version allowed is a version of mimic supporting ceph-volume.

This commit also adds consistent version checking between
the Add and Update methods for the operator handling the
CR events.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:22:59 -06:00
travisn 258a66554f ceph: remove unnecessary CR validation
Range checks for CR values are done statically in the CRD
for the number of mons. There is no need to check in the code
if the mon count is out of range.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:17:38 -06:00
Guangming Wang adf975c3c2 edgefs: cleanup pod.go comment, fix typos
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-13 21:00:54 +08:00
John Mulligan 521680d100 ceph csi: disable csi if server version is too low
Previously, if csi was not supported by the k8s version the csi set-up
code was skipped but csi was "left on". This change ensures that if
csi is not supported the csi enablement flags are set to false so
that other code that needs csi support will not run.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 55b871060f ceph csi: add additional error handling for csi related functions
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 7c5bd58878 ceph csi: ensure the required namespace env var is set
Return an error if the function that updates the csi config map
can not determine a valid namespace for the config map.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 12c48ba375 ceph: refactor csi related code into a new file in csi package
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 9f6c0ba2c5 csi: prevent trivial conflicts between ceph csi instances with a prefix
Add a prefix to the csi drivername when ceph csi is deployed by rook.
This aims to prevent trivial conflict between csi instances when two
rook operators are deployed into the same cluster. By default the
prefix is the "<rook-namespace>." but can by customized on the cli
and via environment vars.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 2b1ae54b84 ceph csi: clean up how templates are expressed
Avoid using global values that are not used anywhere in the code.
Split the object used to express the ceph csi templates into two
so only values that are set globally need to be managed globally,
all other values can be stored in the temporary local struct.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 08219a4492 ceph: update a cross-cluster csi configmap when mons change
Instead of requring csi instances for every ceph cluster that rook
manages, maintain one config map for all ceph clusters. This allows
for one set of csi drivers per rook operator.
The config is intialized as empty when Ceph CSI components are first
created and then updated every time a cluster's mons change.
As before clusters are identified by the k8s namespace the ceph cluster
is running in.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 17fad8e958 ceph: plumb a mutex for csi config map updates through the application
Create a mutex at the rook operator level that will be used when
updating the shared-between-clusters config map that Ceph CSI consumes.
Pass the mutex down to the function that will update the CM.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00