2019-01-08 17:12:36 -07:00
|
|
|
/*
|
|
|
|
|
Copyright 2019 The Rook Authors. All rights reserved.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Package config provides default configurations which Rook will set in Ceph clusters.
|
|
|
|
|
package config
|
|
|
|
|
|
2019-08-05 15:06:47 -06:00
|
|
|
import (
|
|
|
|
|
"github.com/rook/rook/pkg/operator/ceph/version"
|
|
|
|
|
)
|
2019-02-14 09:16:21 -07:00
|
|
|
|
2019-01-08 17:12:36 -07:00
|
|
|
// DefaultFlags returns the default configuration flags Rook will set on the command line for all
|
|
|
|
|
// calls to Ceph daemons and tools. Values specified here will not be able to be overridden using
|
|
|
|
|
// the mon's central KV store, and that is (and should be) by intent.
|
2020-07-06 14:35:59 -06:00
|
|
|
func DefaultFlags(fsid, mountedKeyringPath string) []string {
|
2019-08-05 15:06:47 -06:00
|
|
|
flags := []string{
|
2019-01-08 17:12:36 -07:00
|
|
|
// fsid unnecessary but is a safety to make sure daemons can only connect to their cluster
|
2019-08-05 15:06:47 -06:00
|
|
|
NewFlag("fsid", fsid),
|
|
|
|
|
NewFlag("keyring", mountedKeyringPath),
|
2020-07-06 14:35:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flags = append(flags, LoggingFlags()...)
|
|
|
|
|
flags = append(flags, StoredMonHostEnvVarFlags()...)
|
|
|
|
|
|
|
|
|
|
return flags
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func LoggingFlags() []string {
|
|
|
|
|
return []string{
|
2019-01-08 17:12:36 -07:00
|
|
|
// For containers, we're expected to log everything to stderr
|
2023-05-30 11:52:26 -06:00
|
|
|
NewFlag("default-log-to-stderr", "true"),
|
|
|
|
|
NewFlag("default-err-to-stderr", "true"),
|
|
|
|
|
NewFlag("default-mon-cluster-log-to-stderr", "true"),
|
2019-08-05 15:06:47 -06:00
|
|
|
// differentiate debug text from audit text, and the space after 'debug' is critical
|
2023-05-30 11:52:26 -06:00
|
|
|
NewFlag("default-log-stderr-prefix", "debug "),
|
2020-02-11 17:20:06 +01:00
|
|
|
NewFlag("default-log-to-file", "false"),
|
|
|
|
|
NewFlag("default-mon-cluster-log-to-file", "false"),
|
2019-08-05 15:06:47 -06:00
|
|
|
}
|
2019-01-08 17:12:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DefaultCentralizedConfigs returns the default configuration options Rook will set in Ceph's
|
2019-08-05 15:06:47 -06:00
|
|
|
// centralized config store.
|
2022-10-28 15:05:54 -06:00
|
|
|
func DefaultCentralizedConfigs(cephVersion version.CephVersion) map[string]string {
|
|
|
|
|
overrides := map[string]string{
|
|
|
|
|
"mon allow pool delete": "true",
|
|
|
|
|
"mon cluster log file": "",
|
|
|
|
|
"mon allow pool size one": "true",
|
2020-03-13 14:11:42 +01:00
|
|
|
}
|
|
|
|
|
|
2019-08-05 15:06:47 -06:00
|
|
|
return overrides
|
2019-01-08 17:12:36 -07:00
|
|
|
}
|
|
|
|
|
|
2021-05-06 18:25:44 +02:00
|
|
|
// LegacyConfigs represents old configuration that were applied to a cluster and not needed anymore
|
|
|
|
|
func LegacyConfigs() []Option {
|
|
|
|
|
return []Option{
|
|
|
|
|
{Who: "global", Option: "log file"},
|
|
|
|
|
}
|
|
|
|
|
}
|