Documentation ¶
Index ¶
- Constants
- func AddPMMContainer(cr *api.PerconaServerMongoDB, usersSecretName string, pmmsec corev1.Secret, ...) (corev1.Container, error)
- func EntrypointInitContainer(initImageName string, pullPolicy corev1.PullPolicy) corev1.Container
- func ExternalService(m *api.PerconaServerMongoDB, replset *api.ReplsetSpec, podName string) *corev1.Service
- func GetAddr(m *api.PerconaServerMongoDB, pod, replset string) string
- func GetExportedServices(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) (*mcsv1alpha1.ServiceExportList, error)
- func GetMCSAddr(m *api.PerconaServerMongoDB, pod string) string
- func GetMongosAddrs(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) ([]string, error)
- func GetMongosPods(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) (corev1.PodList, error)
- func GetMongosServices(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) (*corev1.ServiceList, error)
- func GetPrimaryPod(ctx context.Context, client *mgo.Client) (string, error)
- func GetRSPods(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, ...) (corev1.PodList, error)
- func GetReplsetAddrs(ctx context.Context, cl client.Client, m *api.PerconaServerMongoDB, ...) ([]string, error)
- func GetServiceMeshAddr(m *api.PerconaServerMongoDB, pod, replset string) string
- func InitContainers(cr *api.PerconaServerMongoDB, initImage string) []corev1.Container
- func InternalKey(cr *api.PerconaServerMongoDB) string
- func IsServiceImported(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, ...) (bool, error)
- func MongoClient(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, ...) (*mgo.Client, error)
- func MongoHost(ctx context.Context, cl client.Client, m *api.PerconaServerMongoDB, ...) (string, error)
- func MongodCustomConfigName(clusterName, replicaSetName string) string
- func MongosClient(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, ...) (*mgo.Client, error)
- func MongosCustomConfigName(clusterName string) string
- func MongosDeployment(cr *api.PerconaServerMongoDB) *appsv1.Deployment
- func MongosDeploymentSpec(cr *api.PerconaServerMongoDB, template corev1.PodTemplateSpec) appsv1.DeploymentSpec
- func MongosHost(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB, ...) (string, error)
- func MongosService(cr *api.PerconaServerMongoDB, name string) corev1.Service
- func MongosServiceSpec(cr *api.PerconaServerMongoDB, podName string) corev1.ServiceSpec
- func MongosStatefulset(cr *api.PerconaServerMongoDB) *appsv1.StatefulSet
- func MongosStatefulsetSpec(cr *api.PerconaServerMongoDB, template corev1.PodTemplateSpec) appsv1.StatefulSetSpec
- func MongosTemplateSpec(cr *api.PerconaServerMongoDB, initImage string, log logr.Logger, ...) (corev1.PodTemplateSpec, error)
- func NewStatefulSet(name, namespace string) *appsv1.StatefulSet
- func PMMAgentScript() []corev1.EnvVar
- func PMMContainer(cr *api.PerconaServerMongoDB, secrets string, customLogin bool, ...) corev1.Container
- func PersistentVolumeClaim(name, namespace string, spec *corev1.PersistentVolumeClaimSpec) corev1.PersistentVolumeClaim
- func PodAffinity(cr *api.PerconaServerMongoDB, af *api.PodAffinity, labels map[string]string) *corev1.Affinity
- func PodDisruptionBudget(spec *api.PodDisruptionBudgetSpec, labels map[string]string, namespace string) *policyv1beta1.PodDisruptionBudget
- func Service(m *api.PerconaServerMongoDB, replset *api.ReplsetSpec) *corev1.Service
- func StandaloneClient(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, ...) (*mgo.Client, error)
- func StatefulSpec(m *api.PerconaServerMongoDB, replset *api.ReplsetSpec, containerName string, ...) (appsv1.StatefulSetSpec, error)
- type Credentials
- type CustomConfig
- type HashableObject
- type ServiceAddr
- type VolumeSourceType
Constants ¶
const ( // MongodDataVolClaimName is a PVC Claim name MongodDataVolClaimName = "mongod-data" // MongodContainerDataDir is a mondo data path in container MongodContainerDataDir = "/data/db" )
const ( PMMUserKey = "PMM_SERVER_USER" PMMPasswordKey = "PMM_SERVER_PASSWORD" )
Variables ¶
This section is empty.
Functions ¶
func AddPMMContainer ¶ added in v1.6.0
func AddPMMContainer(cr *api.PerconaServerMongoDB, usersSecretName string, pmmsec corev1.Secret, customAdminParams string) (corev1.Container, error)
AddPMMContainer creates the container object for a pmm-client
func EntrypointInitContainer ¶ added in v1.5.0
func EntrypointInitContainer(initImageName string, pullPolicy corev1.PullPolicy) corev1.Container
func ExternalService ¶
func ExternalService(m *api.PerconaServerMongoDB, replset *api.ReplsetSpec, podName string) *corev1.Service
ExternalService returns a Service object needs to serve external connections
func GetAddr ¶ added in v1.6.0
func GetAddr(m *api.PerconaServerMongoDB, pod, replset string) string
GetAddr returns replicaSet pod address in cluster
func GetExportedServices ¶ added in v1.12.0
func GetExportedServices(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) (*mcsv1alpha1.ServiceExportList, error)
func GetMCSAddr ¶ added in v1.12.0
func GetMCSAddr(m *api.PerconaServerMongoDB, pod string) string
GetMCSAddr returns ReplicaSet pod address using MultiCluster FQDN
func GetMongosAddrs ¶ added in v1.12.0
func GetMongosAddrs(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) ([]string, error)
GetMongosAddrs returns a slice of mongos addresses
func GetMongosPods ¶ added in v1.12.0
func GetMongosServices ¶ added in v1.12.0
func GetMongosServices(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB) (*corev1.ServiceList, error)
func GetPrimaryPod ¶ added in v1.10.0
func GetReplsetAddrs ¶ added in v1.4.0
func GetReplsetAddrs(ctx context.Context, cl client.Client, m *api.PerconaServerMongoDB, rsName string, rsExposed bool, pods []corev1.Pod) ([]string, error)
GetReplsetAddrs returns a slice of replset host:port addresses
func GetServiceMeshAddr ¶ added in v1.12.0
func GetServiceMeshAddr(m *api.PerconaServerMongoDB, pod, replset string) string
GetAddr returns replicaSet pod address in a service mesh
func InitContainers ¶ added in v1.6.0
func InitContainers(cr *api.PerconaServerMongoDB, initImage string) []corev1.Container
func InternalKey ¶ added in v1.6.0
func InternalKey(cr *api.PerconaServerMongoDB) string
func IsServiceImported ¶ added in v1.12.0
func MongoClient ¶ added in v1.10.0
func MongoClient(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, rs api.ReplsetSpec, c Credentials) (*mgo.Client, error)
func MongoHost ¶ added in v1.4.0
func MongoHost(ctx context.Context, cl client.Client, m *api.PerconaServerMongoDB, rsName string, rsExposed bool, pod corev1.Pod) (string, error)
MongoHost returns the mongo host for given pod
func MongodCustomConfigName ¶ added in v1.9.0
func MongosClient ¶ added in v1.10.0
func MongosClient(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB, c Credentials) (*mgo.Client, error)
func MongosCustomConfigName ¶ added in v1.9.0
func MongosDeployment ¶ added in v1.6.0
func MongosDeployment(cr *api.PerconaServerMongoDB) *appsv1.Deployment
func MongosDeploymentSpec ¶ added in v1.6.0
func MongosDeploymentSpec(cr *api.PerconaServerMongoDB, template corev1.PodTemplateSpec) appsv1.DeploymentSpec
func MongosHost ¶ added in v1.12.0
func MongosHost(ctx context.Context, cl client.Client, cr *api.PerconaServerMongoDB, pod *corev1.Pod) (string, error)
MongosHost returns the mongos host for given pod
func MongosService ¶ added in v1.6.0
func MongosService(cr *api.PerconaServerMongoDB, name string) corev1.Service
func MongosServiceSpec ¶ added in v1.6.0
func MongosServiceSpec(cr *api.PerconaServerMongoDB, podName string) corev1.ServiceSpec
func MongosStatefulset ¶ added in v1.12.0
func MongosStatefulset(cr *api.PerconaServerMongoDB) *appsv1.StatefulSet
func MongosStatefulsetSpec ¶ added in v1.12.0
func MongosStatefulsetSpec(cr *api.PerconaServerMongoDB, template corev1.PodTemplateSpec) appsv1.StatefulSetSpec
func MongosTemplateSpec ¶ added in v1.12.0
func MongosTemplateSpec(cr *api.PerconaServerMongoDB, initImage string, log logr.Logger, customConf CustomConfig, cfgInstances []string) (corev1.PodTemplateSpec, error)
func NewStatefulSet ¶
func NewStatefulSet(name, namespace string) *appsv1.StatefulSet
NewStatefulSet returns a StatefulSet object configured for a name
func PMMAgentScript ¶ added in v1.6.0
func PMMContainer ¶
func PMMContainer(cr *api.PerconaServerMongoDB, secrets string, customLogin bool, clusterName string, v120OrGreater bool, v160OrGreater bool, customAdminParams string) corev1.Container
PMMContainer returns a pmm container from given spec
func PersistentVolumeClaim ¶
func PersistentVolumeClaim(name, namespace string, spec *corev1.PersistentVolumeClaimSpec) corev1.PersistentVolumeClaim
PersistentVolumeClaim returns a Persistent Volume Claims for Mongod pod
func PodAffinity ¶
func PodAffinity(cr *api.PerconaServerMongoDB, af *api.PodAffinity, labels map[string]string) *corev1.Affinity
PodAffinity returns podAffinity options for the pod
func PodDisruptionBudget ¶
func PodDisruptionBudget(spec *api.PodDisruptionBudgetSpec, labels map[string]string, namespace string) *policyv1beta1.PodDisruptionBudget
func Service ¶
func Service(m *api.PerconaServerMongoDB, replset *api.ReplsetSpec) *corev1.Service
Service returns a core/v1 API Service
func StandaloneClient ¶ added in v1.12.0
func StatefulSpec ¶
func StatefulSpec(m *api.PerconaServerMongoDB, replset *api.ReplsetSpec, containerName string, ls map[string]string, customLabels map[string]string, multiAZ api.MultiAZ, size int32, ikeyName string, initContainers []corev1.Container, log logr.Logger, customConf CustomConfig, resources corev1.ResourceRequirements, podSecurityContext *corev1.PodSecurityContext, containerSecurityContext *corev1.SecurityContext, livenessProbe *api.LivenessProbeExtended, readinessProbe *corev1.Probe, configName string) (appsv1.StatefulSetSpec, error)
StatefulSpec returns spec for stateful set TODO: Unify Arbiter and Node. Shoudn't be 100500 parameters
Types ¶
type Credentials ¶ added in v1.10.0
type CustomConfig ¶ added in v1.10.0
type CustomConfig struct { Type VolumeSourceType HashHex string }
type HashableObject ¶ added in v1.10.0
func VolumeSourceTypeToObj ¶ added in v1.9.0
func VolumeSourceTypeToObj(s VolumeSourceType) HashableObject
type ServiceAddr ¶
func GetServiceAddr ¶
func (ServiceAddr) String ¶
func (s ServiceAddr) String() string
type VolumeSourceType ¶ added in v1.9.0
type VolumeSourceType int
const ( VolumeSourceNone VolumeSourceType = iota VolumeSourceConfigMap VolumeSourceSecret )
func (VolumeSourceType) IsUsable ¶ added in v1.9.0
func (s VolumeSourceType) IsUsable() bool
func (VolumeSourceType) String ¶ added in v1.9.0
func (s VolumeSourceType) String() string
func (VolumeSourceType) VolumeSource ¶ added in v1.9.0
func (s VolumeSourceType) VolumeSource(name string) corev1.VolumeSource