naming

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EnvMySQLStateFile    = "MYSQL_STATE_FILE"
	EnvMySQLNotifySocket = "MYSQL_NOTIFY_SOCKET"

	EnvMySQLNotifySocketInternal = "NOTIFY_SOCKET" // should only be set in the entrypoint

	EnvMySQLClusterType = "CLUSTER_TYPE"

	EnvBootstrapReadTimeout = "BOOTSTRAP_READ_TIMEOUT"

	EnvBootstrapCloneTimeout = "BOOTSTRAP_CLONE_TIMEOUT"

	EnvBootstrapCloneStallTimeout = "BOOTSTRAP_CLONE_STALL_TIMEOUT"

	EnvAsyncSourceRetryCount = "ASYNC_SOURCE_RETRY_COUNT"

	EnvAsyncSourceConnectRetry = "ASYNC_SOURCE_CONNECT_RETRY"

	EnvBackupsEnabled = "BACKUPS_ENABLED"

	EnvSSLCertFile = "SSL_CERT_FILE"
)
View Source
const (
	EventStorageClassNotSupportResize = "StorageClassNotSupportResize"
	EventExceededQuota                = "ExceededQuota"

	// EventFailoverWaiting is emitted when a failover starts recovering the
	// transactions stranded on the dead primary, so the wait is visible before
	// the timeout decides anything.
	EventFailoverWaiting = "FailoverWaiting"
	// EventFailoverBlocked is emitted when a failover has spent its whole
	// timeout without recovering the transactions stranded on the dead primary
	// and the configured policy is to leave the cluster without one.
	EventFailoverBlocked = "FailoverBlocked"
	// EventFailoverForced is emitted when the same timeout expires and the
	// configured policy is to promote anyway, giving those transactions up.
	EventFailoverForced = "FailoverForced"
	// EventFailoverFailed is emitted when Orchestrator gives up on a recovery.
	EventFailoverFailed = "FailoverFailed"
	// EventFailoverUnprotected is emitted when a failover runs without
	// backups, which leaves nothing to recover the stranded transactions from
	// and Orchestrator promotes a replica on its own.
	EventFailoverUnprotected = "FailoverUnprotected"
)
View Source
const (

	// The name of the application.
	// This label is used to group all resources associated with the same application, regardless of their role or environment.
	// It should reflect the base application name, not the resource type or instance.
	// Example: "mysql", "haproxy", "orchestrator".
	LabelName = kubernetesPrefix + "name"

	// A unique name identifying the instance of an application
	// This should be set to the ".metadata.name" of the corresponding
	// PerconaServerMySQL, PerconaServerMySQLBackup, or PerconaServerMySQLRestore object.
	LabelInstance = kubernetesPrefix + "instance"

	// The tool being used to manage the operation of an application.
	// This should be set to the operator's official name only if it owns the resource.
	// For example, for cert-manager Certificates, set it to "cert-manager".
	LabelManagedBy = kubernetesPrefix + "managed-by"

	// The name of the higher-level application this resource is a part of.
	// Set this to one of "percona-server", "percona-server-backup", or "percona-server-restore" of the corresponding object.
	// TODO: Would it be better to use "ps", "ps-backup", and "ps-restore" instead?
	LabelPartOf = kubernetesPrefix + "part-of"

	// The role or function of the component within the application architecture.
	// Should match one of the predefined values from the `naming` package.
	LabelComponent = kubernetesPrefix + "component"
)
View Source
const (
	ComponentProxy        = "proxy"
	ComponentDatabase     = "database"
	ComponentOrchestrator = "orchestrator"
	ComponentTLS          = "tls"
	ComponentBackup       = "backup"
	ComponentRestore      = "restore"
	ComponentPITR         = "pitr"
	ComponentPrepare      = "prepare"
)
View Source
const (
	LabelMySQLPrimary = mysqlPerconaPrefix + "primary"
	LabelExposed      = perconaPrefix + "exposed"
)
View Source
const (
	LabelBackupType     = perconaPrefix + "backup-type"
	LabelBackupAncestor = perconaPrefix + "backup-ancestor"
)
View Source
const (
	FinalizerDeleteSSL            = perconaPrefix + "delete-ssl"
	FinalizerDeletePodsInOrder    = perconaPrefix + "delete-mysql-pods-in-order"
	FinalizerDeleteBackup         = perconaPrefix + "delete-backup"
	FinalizerDeleteMySQLPvc       = perconaPrefix + "delete-mysql-pvc"
	FinalizerClusterSetProtection = perconaPrefix + "clusterset-protection"
)
View Source
const (
	TLSCAKey   = "ca.crt"
	TLSCertKey = "tls.crt"
	TLSKeyKey  = "tls.key"

	// AnnotationLogCollectorConfigHash rolls MySQL pods when the log collector
	// configuration changes. That config is mounted from ConfigMaps by a stable
	// name, so content changes do not alter the pod template on their own.
	AnnotationLogCollectorConfigHash AnnotationKey = perconaPrefix + "logcollector-config-hash"
)
View Source
const (
	CredsMountPath     = "/etc/mysql/mysql-users-secret"
	SystemCABundlePath = "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"
)
View Source
const (
	S3CertsInputVolumeName = "s3-certs-in"
	S3CertsInputMountPath  = "/etc/s3/certs-in"
	S3CertsVolumeName      = "s3-certs"
	S3CertsMountPath       = "/etc/s3/certs"
	S3CABundlePath         = S3CertsMountPath + "/ca-bundle.crt"
)
View Source
const ClusterSetRecoveryFile = "/var/lib/mysql/clusterset-recovery"
View Source
const (
	ConditionReasonErrorReconcile = "ErrorReconcile"
)
View Source
const (
	FinalizerClusterSetDissolve = perconaPrefix + "clusterset-dissolve"
)
View Source
const InternalEncryptionKeyVersionFileName = ".version"
View Source
const (
	LabelCluster = perconaPrefix + "cluster"
)

Variables

This section is empty.

Functions

func BackupLeaseName added in v1.2.0

func BackupLeaseName(clusterName string) string

func EncryptionKeyInternalSecretName added in v1.2.0

func EncryptionKeyInternalSecretName(clusterName string) string

func InternalEncryptionKeyFileName added in v1.2.0

func InternalEncryptionKeyFileName(clusterName, storageName string) string

func InternalHAProxyConfigMapName added in v1.2.0

func InternalHAProxyConfigMapName(clusterName string) string

func Labels added in v0.10.0

func Labels(name, instance, partOf, component string) map[string]string

func LeaseHolderName added in v1.2.0

func LeaseHolderName(name, uid string) string

func ParseLeaseHolder added in v1.2.0

func ParseLeaseHolder(holder string) (string, types.UID)

func RestoreLeaseName added in v1.2.0

func RestoreLeaseName(clusterName string) string

func TruncateNameWithHash added in v1.3.0

func TruncateNameWithHash(name string, maxLength int, hashPrefix string) string

TruncateNameWithHash shortens a name and adds a hash when it exceeds maxLength

Types

type AnnotationKey

type AnnotationKey string
const (
	AnnotationSecretHash               AnnotationKey = perconaPrefix + "last-applied-secret"
	AnnotationConfigHash               AnnotationKey = perconaPrefix + "configuration-hash"
	AnnotationTLSHash                  AnnotationKey = perconaPrefix + "last-applied-tls"
	AnnotationPasswordsUpdated         AnnotationKey = perconaPrefix + "passwords-updated"
	AnnotationLastConfigHash           AnnotationKey = perconaPrefix + "last-config-hash"
	AnnotationRescanNeeded             AnnotationKey = perconaPrefix + "rescan-needed"
	AnnotationPVCResizeInProgress      AnnotationKey = perconaPrefix + "pvc-resize-in-progress"
	AnnotationBaseBackupName           AnnotationKey = perconaPrefix + "base-backup-name"
	AnnotationClusterSetRecoveryNeeded AnnotationKey = perconaPrefix + "clusterset-recovery-needed"
	AnnotationClusterSetRejoinCluster  AnnotationKey = perconaPrefix + "clusterset-rejoin-cluster"
	AnnotationLastAppliedConfig        AnnotationKey = perconaPrefix + "last-applied-config"
	AnnotationLastReloadedTLS          AnnotationKey = perconaPrefix + "last-reloaded-tls"
	AnnotationLastPodTemplateHash      AnnotationKey = perconaPrefix + "last-pod-template-hash"

	// AnnotationForcePromote asks the operator to promote a replica even though
	// the transactions stranded on the dead primary could not be recovered. Its
	// value is a MySQL pod name, or "true" to let the operator pick one. It is
	// refused while the cluster has a writable primary.
	AnnotationForcePromote AnnotationKey = perconaPrefix + "force-promote-with-possible-data-loss"
)

func (AnnotationKey) String

func (s AnnotationKey) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL