Documentation ¶
Index ¶
Constants ¶
View Source
const ( PasswordLen = 8 DefaultPort = 27017 DefaultPortStr = "27017" DefaultDBPath = "/data/db" ContainerName = "mongo" SuffixSecretName = "-keyfile-secret" SuffixKeyfileVolume = "-keyfile-secret-volume" KeyfileMountPath = "/etc/keyfile-secret" KeyfileSecretKey = "mongo-keyfile" SuffixConfigVolume = "-config-volume" ConfigMountPath = "/etc/mongo-config" ConfigMongodKey = "mongod.yaml" LabelKeyInstance = "app.kubernetes.io/instance" LabelKeyClusterVIP = "app.multicloudmongodb.io/vip" LabelKeyApp = "app" LabelKeyRole = "role" LabelKeyReplsetName = "replSetName" LabelKeyArbiter = "arbiter" LabelKeyData = "data" LabelKeyRevisionHash = "mongodb.k8s.io/revision-hash" LabelValIndex = "index" LabelValStandalone = "standalone" LabelValReplset = "replset" LabelValConfigsvr = "configsvr" LabelValShardsvr = "shardsvr" LabelValMongos = "mongos" LabelValTrue = "true" LabelValExporter = "exporter" // exporter default value DefaultMetricsPort = 9216 DefaultMetricsPortName = "metrics" ExporterContainerName = "metrics-exporter" HostnameTopologyKey = "kubernetes.io/hostname" )
Variables ¶
View Source
var (
DefaultLabels = map[string]string{
"app.kubernetes.io/managed-by": "multicloud-mongo-operator",
}
)
View Source
var ( PodSorterById podSorter = func(i, j *corev1.Pod) bool { return StaticPodUtil.GetOrdinal(i) < StaticPodUtil.GetOrdinal(j) } )
View Source
var StaticConfigMapUtil = new(configMapUtil)
View Source
var StaticLabelUtil = new(labelUtil)
View Source
var StaticMongoInfoUtil = new(mongoInfo)
View Source
var StaticPodUtil = new(podUtil)
View Source
var StaticReplSetUtil = new(replSetUtil)
View Source
var StaticSecretUtil = new(secretUtil)
View Source
var StaticStatusUtil = &statusUtil{ ConditionCheckerExistAndTrue: func(c *middlewarev1alpha1.MongoCondition) bool { return c != nil && c.Status == middlewarev1alpha1.ConditionStatusTrue }, ConditionCheckerExistAndFalse: func(c *middlewarev1alpha1.MongoCondition) bool { return c != nil && c.Status == middlewarev1alpha1.ConditionStatusFalse }, }
Functions ¶
func NewResourceBuilder ¶
func NewResourceBuilder(cr *middlewarev1alpha1.MongoDB) *resourceBuilder
Types ¶
type ConditionChecker ¶
type ConditionChecker func(c *middlewarev1alpha1.MongoCondition) bool
type MongoBase ¶
type MongoBase struct {
Base *base // 封装通用逻辑,区别interface方法
}
func NewMongoBase ¶
func NewMongoBase(mgr manager.Manager, cr *middlewarev1alpha1.MongoDB, log *zap.SugaredLogger) *MongoBase
func (*MongoBase) GetCr ¶
func (s *MongoBase) GetCr() *middlewarev1alpha1.MongoDB
Click to show internal directories.
Click to hide internal directories.