Merge pull request #2770 from leseb/allow_standby_replay

ceph: filesystem: deprecate flags and updates for Nautilus
This commit is contained in:
Travis Nielsen authored and GitHub committed 2019-03-07 09:35:41 -07:00
commit cdeeeb84ae
3 files changed
+38 -7

No files matched your search

+11
View File
@@ -108,6 +108,17 @@ func GetFilesystem(context *clusterd.Context, clusterName string, fsName string)
return &fs, nil
}
// AllowStandbyReplay gets detailed status information about a Ceph filesystem.
func AllowStandbyReplay(context *clusterd.Context, clusterName string, fsName string, allowStandbyReplay bool) error {
args := []string{"fs", "set", fsName, "allow_standby_replay", strconv.FormatBool(allowStandbyReplay)}
_, err := ExecuteCephCommand(context, clusterName, args)
if err != nil {
return fmt.Errorf("failed to set allow_standby_replay to filesystem %s: %+v", fsName, err)
}
return nil
}
// CreateFilesystem performs software configuration steps for Ceph to provide a new filesystem.
func CreateFilesystem(context *clusterd.Context, clusterName, name, metadataPool string, dataPools []string) error {
if len(dataPools) == 0 {
+9
View File
@@ -73,6 +73,15 @@ func createFilesystem(
return fmt.Errorf("failed to get filesystem %s: %+v", fs.Name, err)
}
// As of Nautilus, allow_standby_replay is a fs property so we need to apply it
if cephv1.VersionAtLeast(clusterInfo.CephVersionName, cephv1.Nautilus) {
if fs.Spec.MetadataServer.ActiveStandby {
if err = client.AllowStandbyReplay(context, fs.Namespace, fs.Name, fs.Spec.MetadataServer.ActiveStandby); err != nil {
return fmt.Errorf("failed to set allow_standby_replay to filesystem %s: %v", fs.Name, err)
}
}
}
// set the number of active mds instances
if fs.Spec.MetadataServer.ActiveCount > 1 {
if err = client.SetNumMDSRanks(context, fs.Namespace, fs.Name, fs.Spec.MetadataServer.ActiveCount); err != nil {
+18 -7
View File
@@ -20,6 +20,7 @@ import (
"fmt"
"strconv"
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
"github.com/rook/rook/pkg/clusterd"
"github.com/rook/rook/pkg/operator/ceph/config"
opspec "github.com/rook/rook/pkg/operator/ceph/spec"
@@ -78,17 +79,25 @@ func (c *Cluster) makeDeployment(mdsConfig *mdsConfig) *apps.Deployment {
}
func (c *Cluster) makeMdsDaemonContainer(mdsConfig *mdsConfig) v1.Container {
return v1.Container{
args := append(
opspec.DaemonFlags(c.clusterInfo, config.MdsType, mdsConfig.DaemonID),
"--foreground",
)
// These flags are obsoleted as of Nautilus
if !cephv1.VersionAtLeast(c.cephVersion.Name, cephv1.Nautilus) {
args = append(
args,
config.NewFlag("mds-standby-for-fscid", c.fsID),
config.NewFlag("mds-standby-replay", strconv.FormatBool(c.fs.Spec.MetadataServer.ActiveStandby)))
}
container := v1.Container{
Name: "mds",
Command: []string{
"ceph-mds",
},
Args: append(
opspec.DaemonFlags(c.clusterInfo, config.MdsType, mdsConfig.DaemonID),
"--foreground",
config.NewFlag("mds-standby-for-fscid", c.fsID),
config.NewFlag("mds-standby-replay", strconv.FormatBool(c.fs.Spec.MetadataServer.ActiveStandby)),
),
Args: args,
Image: c.cephVersion.Image,
VolumeMounts: opspec.DaemonVolumeMounts(mdsConfig.DataPathMap, mdsConfig.ResourceName),
Env: append(
@@ -96,6 +105,8 @@ func (c *Cluster) makeMdsDaemonContainer(mdsConfig *mdsConfig) v1.Container {
),
Resources: c.fs.Spec.MetadataServer.Resources,
}
return container
}
func (c *Cluster) podLabels(mdsConfig *mdsConfig) map[string]string {