Documentation
¶
Index ¶
- Constants
- Variables
- func MariaDBPort(svc *corev1.Service) (*corev1.ServicePort, error)
- func ValidateServicePorts(ports []corev1.ServicePort) error
- type Builder
- func (b *Builder) BuildBackupCronJob(key types.NamespacedName, backup *mariadbv1alpha1.Backup, ...) (*batchv1.CronJob, error)
- func (b *Builder) BuildBackupJob(key types.NamespacedName, backup *mariadbv1alpha1.Backup, ...) (*batchv1.Job, error)
- func (b *Builder) BuildBackupStagingPVC(key types.NamespacedName, pvcSpec *mariadbv1alpha1.PersistentVolumeClaimSpec, ...) (*corev1.PersistentVolumeClaim, error)
- func (b *Builder) BuildBackupStoragePVC(key types.NamespacedName, pvcSpec *mariadbv1alpha1.PersistentVolumeClaimSpec, ...) (*corev1.PersistentVolumeClaim, error)
- func (b *Builder) BuildCertificate(certOpts ...CertOpt) (*certmanagerv1.Certificate, error)
- func (b *Builder) BuildClusterRoleBinding(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, ...) (*rbacv1.ClusterRoleBinding, error)
- func (b *Builder) BuildConfigMap(opts ConfigMapOpts, owner metav1.Object) (*corev1.ConfigMap, error)
- func (b *Builder) BuildConnection(opts ConnectionOpts, owner metav1.Object) (*mariadbv1alpha1.Connection, error)
- func (b *Builder) BuildDatabase(key types.NamespacedName, owner metav1.Object, opts DatabaseOpts) (*mariadbv1alpha1.Database, error)
- func (b *Builder) BuildEndpointSlice(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, ...) (*discoveryv1.EndpointSlice, error)
- func (b *Builder) BuildExporterDeployment(mariadb *mariadbv1alpha1.MariaDB, podAnnotations map[string]string) (*appsv1.Deployment, error)
- func (b *Builder) BuildGaleraInitJob(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB) (*batchv1.Job, error)
- func (b *Builder) BuildGaleraRecoveryJob(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, pod *corev1.Pod) (*batchv1.Job, error)
- func (b *Builder) BuildGrant(key types.NamespacedName, owner metav1.Object, opts GrantOpts) (*mariadbv1alpha1.Grant, error)
- func (b *Builder) BuildMariadbStatefulSet(mariadb *mariadbv1alpha1.MariaDB, key types.NamespacedName, ...) (*appsv1.StatefulSet, error)
- func (b *Builder) BuildMaxScale(key types.NamespacedName, mdb *mariadbv1alpha1.MariaDB, ...) (*mariadbv1alpha1.MaxScale, error)
- func (b *Builder) BuildMaxScaleExporterDeployment(mxs *mariadbv1alpha1.MaxScale, podAnnotations map[string]string) (*appsv1.Deployment, error)
- func (b *Builder) BuildMaxScaleServiceMonitor(mxs *mariadbv1alpha1.MaxScale) (*monitoringv1.ServiceMonitor, error)
- func (b *Builder) BuildMaxscaleStatefulSet(maxscale *mariadbv1alpha1.MaxScale, key types.NamespacedName, ...) (*appsv1.StatefulSet, error)
- func (b *Builder) BuildPhysicalBackupJob(key types.NamespacedName, backup *mariadbv1alpha1.PhysicalBackup, ...) (*batchv1.Job, error)
- func (b *Builder) BuildPhysicalBackupRestoreJob(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, podIndex *int, ...) (*batchv1.Job, error)
- func (b *Builder) BuildPodDisruptionBudget(opts PodDisruptionBudgetOpts, owner metav1.Object) (*policyv1.PodDisruptionBudget, error)
- func (b *Builder) BuildReplicaRecoveryPhysicalBackup(key types.NamespacedName, tpl *mariadbv1alpha1.PhysicalBackup, ...) (*mariadbv1alpha1.PhysicalBackup, error)
- func (b *Builder) BuildRestore(mariadb *mariadbv1alpha1.MariaDB, key types.NamespacedName) (*mariadbv1alpha1.Restore, error)
- func (b *Builder) BuildRestoreJob(key types.NamespacedName, restore *mariadbv1alpha1.Restore, ...) (*batchv1.Job, error)
- func (b *Builder) BuildRole(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, ...) (*rbacv1.Role, error)
- func (b *Builder) BuildRoleBinding(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, ...) (*rbacv1.RoleBinding, error)
- func (b *Builder) BuildSecret(opts SecretOpts, owner metav1.Object) (*corev1.Secret, error)
- func (b *Builder) BuildService(key types.NamespacedName, owner metav1.Object, opts ServiceOpts) (*corev1.Service, error)
- func (b *Builder) BuildServiceAccount(key types.NamespacedName, owner metav1.Object, meta *mariadbv1alpha1.Metadata) (*corev1.ServiceAccount, error)
- func (b *Builder) BuildServiceMonitor(mariadb *mariadbv1alpha1.MariaDB) (*monitoringv1.ServiceMonitor, error)
- func (b *Builder) BuildSqlCronJob(key types.NamespacedName, sqlJob *mariadbv1alpha1.SqlJob, ...) (*batchv1.CronJob, error)
- func (b *Builder) BuildSqlJob(key types.NamespacedName, sqlJob *mariadbv1alpha1.SqlJob, ...) (*batchv1.Job, error)
- func (b *Builder) BuildStoragePVC(key types.NamespacedName, tpl *mariadbv1alpha1.VolumeClaimTemplate, ...) (*corev1.PersistentVolumeClaim, error)
- func (b *Builder) BuildUser(key types.NamespacedName, owner metav1.Object, opts UserOpts) (*mariadbv1alpha1.User, error)
- func (b *Builder) BuildVolumeSnapshot(key types.NamespacedName, backup *mariadbv1alpha1.PhysicalBackup, ...) (*volumesnapshotv1.VolumeSnapshot, error)
- type CertOpt
- func WithDNSnames(names []string) CertOpt
- func WithIssuerRef(issuerRef cmmeta.ObjectReference) CertOpt
- func WithKey(key types.NamespacedName) CertOpt
- func WithLifetime(lifetime time.Duration) CertOpt
- func WithOwner(owner metav1.Object) CertOpt
- func WithRenewBeforePercentage(percentage int32) CertOpt
- func WithUsages(usages ...certmanagerv1.KeyUsage) CertOpt
- type CertOpts
- type ConfigMapOpts
- type ConnectionOpts
- type DatabaseOpts
- type GrantOpts
- type PVCOption
- type PhysicalBackupRestoreOpt
- type PhysicalBackupRestoreOpts
- type PodDisruptionBudgetOpts
- type SecretOpts
- type ServiceOpts
- type UserOpts
Constants ¶
View Source
const ( StorageVolume = "storage" MariadbStorageMountPath = "/var/lib/mysql" MaxscaleStorageMountPath = "/var/lib/maxscale" StorageVolumeRole = "storage" MariadbConfigVolume = "mariadb-config" MariadbConfigMountPath = "/etc/mysql/mariadb.conf.d" ConfigVolume = "config" ConfigMountPath = "/etc/mysql/conf.d" MaxscaleConfigMountPath = "/etc/config" ConfigVolumeRole = "config" AgentAuthVolume = "agent-auth" AgentAuthVolumeMount = "/var/run/secrets/mariadb-operator/agent" RunVolume = "run" MaxScaleRunMountPath = "/var/run/maxscale" LogVolume = "log" MaxScaleLogMountPath = "/var/log/maxscale" CacheVolume = "cache" MaxScaleCacheMountPath = "/var/cache/maxscale" InitVolume = "init" InitConfigPath = "/init" InitLibKey = "lib.sh" InitEntrypointKey = "entrypoint.sh" ServiceAccountVolume = "serviceaccount" ServiceAccountMountPath = "/var/run/secrets/kubernetes.io/serviceaccount" )
View Source
const (
MetricsPortName = "metrics"
)
Variables ¶
View Source
var ( MariadbContainerName = "mariadb" MariadbPortName = "mariadb" MaxScaleContainerName = "maxscale" MaxScaleAdminPortName = "admin" InitContainerName = "init" AgentContainerName = "agent" )
Functions ¶
func MariaDBPort ¶
func MariaDBPort(svc *corev1.Service) (*corev1.ServicePort, error)
func ValidateServicePorts ¶
func ValidateServicePorts(ports []corev1.ServicePort) error
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(scheme *runtime.Scheme, env *environment.OperatorEnv, discovery *discovery.Discovery) *Builder
func (*Builder) BuildBackupCronJob ¶
func (b *Builder) BuildBackupCronJob(key types.NamespacedName, backup *mariadbv1alpha1.Backup, mariadb interfaces.MariaDBObject) (*batchv1.CronJob, error)
func (*Builder) BuildBackupJob ¶
func (b *Builder) BuildBackupJob(key types.NamespacedName, backup *mariadbv1alpha1.Backup, mariadb interfaces.MariaDBObject) (*batchv1.Job, error)
func (*Builder) BuildBackupStagingPVC ¶
func (b *Builder) BuildBackupStagingPVC(key types.NamespacedName, pvcSpec *mariadbv1alpha1.PersistentVolumeClaimSpec, meta *mariadbv1alpha1.Metadata, owner metav1.Object) (*corev1.PersistentVolumeClaim, error)
func (*Builder) BuildBackupStoragePVC ¶
func (b *Builder) BuildBackupStoragePVC(key types.NamespacedName, pvcSpec *mariadbv1alpha1.PersistentVolumeClaimSpec, meta *mariadbv1alpha1.Metadata) (*corev1.PersistentVolumeClaim, error)
func (*Builder) BuildCertificate ¶
func (b *Builder) BuildCertificate(certOpts ...CertOpt) (*certmanagerv1.Certificate, error)
func (*Builder) BuildClusterRoleBinding ¶
func (b *Builder) BuildClusterRoleBinding(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, sa *corev1.ServiceAccount, roleRef rbacv1.RoleRef) (*rbacv1.ClusterRoleBinding, error)
func (*Builder) BuildConfigMap ¶
func (*Builder) BuildConnection ¶
func (b *Builder) BuildConnection(opts ConnectionOpts, owner metav1.Object) (*mariadbv1alpha1.Connection, error)
func (*Builder) BuildDatabase ¶
func (b *Builder) BuildDatabase(key types.NamespacedName, owner metav1.Object, opts DatabaseOpts) (*mariadbv1alpha1.Database, error)
func (*Builder) BuildEndpointSlice ¶
func (b *Builder) BuildEndpointSlice(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, addressType discoveryv1.AddressType, endpoints []discoveryv1.Endpoint, ports []discoveryv1.EndpointPort, serviceName string) (*discoveryv1.EndpointSlice, error)
func (*Builder) BuildExporterDeployment ¶
func (b *Builder) BuildExporterDeployment(mariadb *mariadbv1alpha1.MariaDB, podAnnotations map[string]string) (*appsv1.Deployment, error)
func (*Builder) BuildGaleraInitJob ¶
func (b *Builder) BuildGaleraInitJob(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB) (*batchv1.Job, error)
func (*Builder) BuildGaleraRecoveryJob ¶
func (b *Builder) BuildGaleraRecoveryJob(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, pod *corev1.Pod) (*batchv1.Job, error)
func (*Builder) BuildGrant ¶
func (b *Builder) BuildGrant(key types.NamespacedName, owner metav1.Object, opts GrantOpts) (*mariadbv1alpha1.Grant, error)
func (*Builder) BuildMariadbStatefulSet ¶
func (b *Builder) BuildMariadbStatefulSet(mariadb *mariadbv1alpha1.MariaDB, key types.NamespacedName, podAnnotations map[string]string) (*appsv1.StatefulSet, error)
func (*Builder) BuildMaxScale ¶
func (b *Builder) BuildMaxScale(key types.NamespacedName, mdb *mariadbv1alpha1.MariaDB, mdbmxs *mariadbv1alpha1.MariaDBMaxScaleSpec) (*mariadbv1alpha1.MaxScale, error)
func (*Builder) BuildMaxScaleExporterDeployment ¶
func (b *Builder) BuildMaxScaleExporterDeployment(mxs *mariadbv1alpha1.MaxScale, podAnnotations map[string]string) (*appsv1.Deployment, error)
func (*Builder) BuildMaxScaleServiceMonitor ¶
func (b *Builder) BuildMaxScaleServiceMonitor(mxs *mariadbv1alpha1.MaxScale) (*monitoringv1.ServiceMonitor, error)
func (*Builder) BuildMaxscaleStatefulSet ¶
func (b *Builder) BuildMaxscaleStatefulSet(maxscale *mariadbv1alpha1.MaxScale, key types.NamespacedName, podAnnotations map[string]string) (*appsv1.StatefulSet, error)
func (*Builder) BuildPhysicalBackupJob ¶
func (b *Builder) BuildPhysicalBackupJob(key types.NamespacedName, backup *mariadbv1alpha1.PhysicalBackup, mariadb *mariadbv1alpha1.MariaDB, pod *corev1.Pod, backupFile string) (*batchv1.Job, error)
func (*Builder) BuildPhysicalBackupRestoreJob ¶
func (b *Builder) BuildPhysicalBackupRestoreJob(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, podIndex *int, restoreOpts ...PhysicalBackupRestoreOpt) (*batchv1.Job, error)
func (*Builder) BuildPodDisruptionBudget ¶
func (b *Builder) BuildPodDisruptionBudget(opts PodDisruptionBudgetOpts, owner metav1.Object) (*policyv1.PodDisruptionBudget, error)
func (*Builder) BuildReplicaRecoveryPhysicalBackup ¶ added in v25.10.0
func (b *Builder) BuildReplicaRecoveryPhysicalBackup(key types.NamespacedName, tpl *mariadbv1alpha1.PhysicalBackup, mariadb *mariadbv1alpha1.MariaDB) (*mariadbv1alpha1.PhysicalBackup, error)
func (*Builder) BuildRestore ¶
func (b *Builder) BuildRestore(mariadb *mariadbv1alpha1.MariaDB, key types.NamespacedName) (*mariadbv1alpha1.Restore, error)
func (*Builder) BuildRestoreJob ¶
func (b *Builder) BuildRestoreJob(key types.NamespacedName, restore *mariadbv1alpha1.Restore, mariadb interfaces.MariaDBObject) (*batchv1.Job, error)
func (*Builder) BuildRole ¶
func (b *Builder) BuildRole(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, rules []rbacv1.PolicyRule) (*rbacv1.Role, error)
func (*Builder) BuildRoleBinding ¶
func (b *Builder) BuildRoleBinding(key types.NamespacedName, mariadb *mariadbv1alpha1.MariaDB, sa *corev1.ServiceAccount, roleRef rbacv1.RoleRef) (*rbacv1.RoleBinding, error)
func (*Builder) BuildSecret ¶
func (*Builder) BuildService ¶
func (b *Builder) BuildService(key types.NamespacedName, owner metav1.Object, opts ServiceOpts) (*corev1.Service, error)
func (*Builder) BuildServiceAccount ¶
func (b *Builder) BuildServiceAccount(key types.NamespacedName, owner metav1.Object, meta *mariadbv1alpha1.Metadata) (*corev1.ServiceAccount, error)
func (*Builder) BuildServiceMonitor ¶
func (b *Builder) BuildServiceMonitor(mariadb *mariadbv1alpha1.MariaDB) (*monitoringv1.ServiceMonitor, error)
func (*Builder) BuildSqlCronJob ¶
func (b *Builder) BuildSqlCronJob(key types.NamespacedName, sqlJob *mariadbv1alpha1.SqlJob, mariadb interfaces.MariaDBObject) (*batchv1.CronJob, error)
func (*Builder) BuildSqlJob ¶
func (b *Builder) BuildSqlJob(key types.NamespacedName, sqlJob *mariadbv1alpha1.SqlJob, mariadb interfaces.MariaDBObject) (*batchv1.Job, error)
func (*Builder) BuildStoragePVC ¶
func (b *Builder) BuildStoragePVC(key types.NamespacedName, tpl *mariadbv1alpha1.VolumeClaimTemplate, mariadb *mariadbv1alpha1.MariaDB, opts ...PVCOption) (*corev1.PersistentVolumeClaim, error)
func (*Builder) BuildUser ¶
func (b *Builder) BuildUser(key types.NamespacedName, owner metav1.Object, opts UserOpts) (*mariadbv1alpha1.User, error)
func (*Builder) BuildVolumeSnapshot ¶
func (b *Builder) BuildVolumeSnapshot(key types.NamespacedName, backup *mariadbv1alpha1.PhysicalBackup, pvcKey types.NamespacedName, meta *mariadbv1alpha1.Metadata) (*volumesnapshotv1.VolumeSnapshot, error)
type CertOpt ¶
type CertOpt func(*CertOpts)
func WithDNSnames ¶
func WithIssuerRef ¶
func WithIssuerRef(issuerRef cmmeta.ObjectReference) CertOpt
func WithKey ¶
func WithKey(key types.NamespacedName) CertOpt
func WithLifetime ¶
func WithUsages ¶
func WithUsages(usages ...certmanagerv1.KeyUsage) CertOpt
type CertOpts ¶
type CertOpts struct {
Key *types.NamespacedName
Owner metav1.Object
DNSNames []string
Lifetime *time.Duration
RenewBeforePercentage *int32
Usages []certmanagerv1.KeyUsage
IssuerRef *cmmeta.ObjectReference
}
type ConfigMapOpts ¶
type ConfigMapOpts struct {
Metadata *mariadbv1alpha1.Metadata
Key types.NamespacedName
Data map[string]string
}
type ConnectionOpts ¶
type ConnectionOpts struct {
Metadata *mariadbv1alpha1.Metadata
MariaDB *mariadbv1alpha1.MariaDB
ExternalMariaDB *mariadbv1alpha1.ExternalMariaDB
MaxScale *mariadbv1alpha1.MaxScale
Key types.NamespacedName
Username string
PasswordSecretKeyRef *mariadbv1alpha1.SecretKeySelector
Database *string
Template *mariadbv1alpha1.ConnectionTemplate
}
type DatabaseOpts ¶
type DatabaseOpts struct {
Name string
Metadata *mariadbv1alpha1.Metadata
MariaDBRef mariadbv1alpha1.MariaDBRef
}
type GrantOpts ¶
type GrantOpts struct {
Privileges []string
Database string
Table string
Username string
Host string
GrantOption bool
CleanupPolicy *mariadbv1alpha1.CleanupPolicy
Metadata *mariadbv1alpha1.Metadata
MariaDBRef mariadbv1alpha1.MariaDBRef
}
type PVCOption ¶
type PVCOption func(*corev1.PersistentVolumeClaimSpec)
type PhysicalBackupRestoreOpt ¶ added in v25.10.0
type PhysicalBackupRestoreOpt func(*PhysicalBackupRestoreOpts) error
func WithBootstrapFrom ¶ added in v25.10.0
func WithBootstrapFrom(bootstrapFrom *mariadbv1alpha1.BootstrapFrom) PhysicalBackupRestoreOpt
func WithPhysicalBackup ¶ added in v25.10.0
func WithPhysicalBackup(pb *mariadbv1alpha1.PhysicalBackup, targetRecoveryTime time.Time, restoreJob *mariadbv1alpha1.Job, restoreCommandOpts ...command.MariaDBBackupRestoreOpt) PhysicalBackupRestoreOpt
func WithReplicaRecovery ¶ added in v25.10.0
func WithReplicaRecovery(podToRecover *corev1.Pod) PhysicalBackupRestoreOpt
type PhysicalBackupRestoreOpts ¶ added in v25.10.0
type PhysicalBackupRestoreOpts struct {
TargetRecoveryTime *time.Time
Volume *mariadbv1alpha1.StorageVolumeSource
S3 *mariadbv1alpha1.S3
RestoreJob *mariadbv1alpha1.Job
RestoreCommandOpts []command.MariaDBBackupRestoreOpt
MariaDBLabels *bool
Affinity *bool
NodeSelector map[string]string
}
type PodDisruptionBudgetOpts ¶
type PodDisruptionBudgetOpts struct {
Metadata *mariadbv1alpha1.Metadata
Key types.NamespacedName
MinAvailable *intstr.IntOrString
SelectorLabels map[string]string
}
type SecretOpts ¶
type SecretOpts struct {
Metadata []*mariadbv1alpha1.Metadata
Key types.NamespacedName
Data map[string][]byte
}
type ServiceOpts ¶
type ServiceOpts struct {
mariadbv1alpha1.ServiceTemplate
SelectorLabels map[string]string
ExcludeSelectorLabels bool
Ports []corev1.ServicePort
Headless bool
ExtraMeta *mariadbv1alpha1.Metadata
}
type UserOpts ¶
type UserOpts struct {
Name string
Host string
PasswordSecretKeyRef *mariadbv1alpha1.SecretKeySelector
PasswordHashSecretKeyRef *mariadbv1alpha1.SecretKeySelector
PasswordPlugin *mariadbv1alpha1.PasswordPlugin
MaxUserConnections int32
CleanupPolicy *mariadbv1alpha1.CleanupPolicy
Metadata *mariadbv1alpha1.Metadata
MariaDBRef mariadbv1alpha1.MariaDBRef
}
Source Files
¶
- batch_builder.go
- batch_container_builder.go
- builder.go
- certificate_builder.go
- configmap_builder.go
- connection_builder.go
- container_builder.go
- deployment_builder.go
- endpoints_builder.go
- maxscale_builder.go
- persistentvolumeclaim_builder.go
- physicalbackup_builder.go
- pod_builder.go
- poddisruptionbudget_builder.go
- rbac_builder.go
- restore_builder.go
- secret_builder.go
- securitycontext_builder.go
- service_builder.go
- servicemonitor_builder.go
- sql_builder.go
- statefulset_builder.go
- volumesnapshot_builder.go
Click to show internal directories.
Click to hide internal directories.