enable rbd mirror daemon in the cluster crd
Signed-off-by: travisn <tnielsen@redhat.com>
This commit is contained in:
27 files changed
+685
-99
No files matched your search
@@ -188,12 +188,13 @@ func (h *CephInstaller) CreateK8sRookToolbox(namespace string) (err error) {
|
||||
func (h *CephInstaller) CreateK8sRookCluster(namespace, systemNamespace string, storeType string) (err error) {
|
||||
return h.CreateK8sRookClusterWithHostPathAndDevices(namespace, systemNamespace, storeType, false,
|
||||
cephv1beta1.MonSpec{Count: 3, AllowMultiplePerNode: true}, true, /* startWithAllNodes */
|
||||
1, /* rbd workers */
|
||||
LuminousVersion)
|
||||
}
|
||||
|
||||
//CreateK8sRookCluster creates rook cluster via kubectl
|
||||
func (h *CephInstaller) CreateK8sRookClusterWithHostPathAndDevices(namespace, systemNamespace, storeType string,
|
||||
useAllDevices bool, mon cephv1beta1.MonSpec, startWithAllNodes bool, cephVersion cephv1beta1.CephVersionSpec) error {
|
||||
useAllDevices bool, mon cephv1beta1.MonSpec, startWithAllNodes bool, rbdMirrorWorkers int, cephVersion cephv1beta1.CephVersionSpec) error {
|
||||
|
||||
dataDirHostPath, err := h.initTestDir(namespace)
|
||||
if err != nil {
|
||||
@@ -216,7 +217,7 @@ func (h *CephInstaller) CreateK8sRookClusterWithHostPathAndDevices(namespace, sy
|
||||
}
|
||||
|
||||
logger.Infof("Starting Rook Cluster with yaml")
|
||||
settings := &ClusterSettings{namespace, storeType, dataDirHostPath, useAllDevices, mon.Count, cephVersion}
|
||||
settings := &ClusterSettings{namespace, storeType, dataDirHostPath, useAllDevices, mon.Count, rbdMirrorWorkers, cephVersion}
|
||||
rookCluster := h.Manifests.GetRookCluster(settings)
|
||||
if _, err := h.k8shelper.KubectlWithStdin(rookCluster, createFromStdinArgs...); err != nil {
|
||||
return fmt.Errorf("Failed to create rook cluster : %v ", err)
|
||||
@@ -230,6 +231,12 @@ func (h *CephInstaller) CreateK8sRookClusterWithHostPathAndDevices(namespace, sy
|
||||
return err
|
||||
}
|
||||
|
||||
if rbdMirrorWorkers > 0 {
|
||||
if err := h.k8shelper.WaitForPodCount("app=rook-ceph-rbd-mirror", namespace, rbdMirrorWorkers); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
logger.Infof("Rook Cluster started")
|
||||
err = h.k8shelper.WaitForLabeledPodsToRun("app=rook-ceph-osd", namespace)
|
||||
return err
|
||||
@@ -272,7 +279,7 @@ func (h *CephInstaller) GetNodeHostnames() ([]string, error) {
|
||||
|
||||
//InstallRookOnK8sWithHostPathAndDevices installs rook on k8s
|
||||
func (h *CephInstaller) InstallRookOnK8sWithHostPathAndDevices(namespace, storeType string,
|
||||
helmInstalled, useDevices bool, mon cephv1beta1.MonSpec, startWithAllNodes bool) (bool, error) {
|
||||
helmInstalled, useDevices bool, mon cephv1beta1.MonSpec, startWithAllNodes bool, rbdMirrorWorkers int) (bool, error) {
|
||||
|
||||
var err error
|
||||
//flag used for local debuggin purpose, when rook is pre-installed
|
||||
@@ -321,6 +328,7 @@ func (h *CephInstaller) InstallRookOnK8sWithHostPathAndDevices(namespace, storeT
|
||||
//Create rook cluster
|
||||
err = h.CreateK8sRookClusterWithHostPathAndDevices(namespace, onamespace, storeType,
|
||||
useDevices, cephv1beta1.MonSpec{Count: mon.Count, AllowMultiplePerNode: mon.AllowMultiplePerNode}, startWithAllNodes,
|
||||
rbdMirrorWorkers,
|
||||
h.cephVersion)
|
||||
if err != nil {
|
||||
logger.Errorf("Rook cluster %s not installed, error -> %v", namespace, err)
|
||||
|
||||
@@ -42,12 +42,13 @@ type CephManifests interface {
|
||||
}
|
||||
|
||||
type ClusterSettings struct {
|
||||
Namespace string
|
||||
StoreType string
|
||||
DataDirHostPath string
|
||||
UseAllDevices bool
|
||||
Mons int
|
||||
CephVersion cephv1beta1.CephVersionSpec
|
||||
Namespace string
|
||||
StoreType string
|
||||
DataDirHostPath string
|
||||
UseAllDevices bool
|
||||
Mons int
|
||||
RBDMirrorWorkers int
|
||||
CephVersion cephv1beta1.CephVersionSpec
|
||||
}
|
||||
|
||||
//CephManifestsMaster wraps rook yaml definitions
|
||||
@@ -451,6 +452,8 @@ spec:
|
||||
allowMultiplePerNode: true
|
||||
dashboard:
|
||||
enabled: true
|
||||
rbdMirroring:
|
||||
workers: ` + strconv.Itoa(settings.RBDMirrorWorkers) + `
|
||||
metadataDevice:
|
||||
storage:
|
||||
useAllNodes: true
|
||||
|
||||
Reference in new issue
Block a user