Documentation
¶
Index ¶
- func ConfigMap(cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec) (*corev1.ConfigMap, error)
- func InjectMongodConfig(userConfig string, cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec) (string, error)
- func InjectMongosConfig(userConfig string, cr *api.PerconaServerMongoDB) (string, error)
- func Service(cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec) *corev1.Service
- func StatefulSet(cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec, ...) *appsv1.StatefulSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigMap ¶
func ConfigMap(cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec) (*corev1.ConfigMap, error)
ConfigMap returns the ConfigMap that holds the operator-rendered mongot.conf for the given replset/shard. The single data key is ConfigFileName ("mongot.conf").
func InjectMongodConfig ¶
func InjectMongodConfig(userConfig string, cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec) (string, error)
InjectMongodConfig overlays the operator-managed `setParameter` block onto the user-supplied mongod configuration. The four keys the operator owns:
- mongotHost
- searchIndexManagementHostAndPort
- useGrpcForSearch
- searchTLSMode (only when cluster TLS is enabled or the user pinned `spec.search.tls.mode`)
always win on conflict.
Returns the user config unchanged when search is disabled or when the replset is the config server.
func InjectMongosConfig ¶
func InjectMongosConfig(userConfig string, cr *api.PerconaServerMongoDB) (string, error)
InjectMongosConfig overlays the operator-managed `setParameter` block onto a sharded cluster's mongos configuration. mongos needs a cluster-wide view of the search-index catalog: createSearchIndex / dropSearchIndex / listSearchIndexes issued through mongos must reach the matching shard's mongot.
Returns the user config unchanged when search is disabled or the cluster is not sharded.
func Service ¶
func Service(cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec) *corev1.Service
Service returns the headless ClusterIP Service that fronts the mongot pod for the given replset (or shard). The Service name equals StatefulSetName(cr, rs) — `<cluster>-<rs>-search` — so mongod's `mongotHost` setParameter resolves to the pod IP directly, preserving long-lived gRPC streams across kube-proxy.
Headless (ClusterIP=None) matches the pattern used for the mongod replset Service and is forward-compatible with the future size>1 L7 LB path: an L7 gateway can pick up the per-pod endpoints without a separate per-pod Service.
func StatefulSet ¶
func StatefulSet(cr *api.PerconaServerMongoDB, rs *api.ReplsetSpec, initImage, configHash string, sslHashes map[string]string) *appsv1.StatefulSet
StatefulSet returns the StatefulSet object that runs the mongot group for the given replset. configHash is set as a pod-template annotation so a ConfigMap content change rolls the pods.
Types ¶
This section is empty.