constants

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BackupSubcommand  = "backup"
	RestoreSubcommand = "restore"

	BackupTimeFormat = "20060102-150405"
	DumpFilename     = "dump.tar"
	BinlogFilename   = "binlog.tar.zst"
)

moco-backup related constants

View Source
const (
	// MySQLDataPath is the path of MySQL data dir.
	MySQLDataPath = "/var/lib/mysql"

	// MySQLConfPath is the path of MySQL conf dir.
	MySQLConfPath = "/etc/mysql"

	// MySQLInitConfPath is the path of MySQL conf dir generated by moco-init.
	MySQLInitConfPath = "/etc/mysql-conf.d"

	// MySQLConfName is the filename of my.cnf.
	MySQLConfName = "my.cnf"

	// RunPath is the path of variable files which concerns MySQLd.
	RunPath = "/run"

	// LogDirPath is the path of /var/log/mysql.
	LogDirPath = "/var/log/mysql"

	// MySQLSlowLogName is the filename of slow query log for MySQL.
	MySQLSlowLogName = "mysql.slow"

	// TmpPath is the path for /tmp.
	TmpPath = "/tmp"

	// MyCnfSecretPath is the path for my.cnf formated credentials for CLI
	MyCnfSecretPath = "/mysql-credentials"

	// SharedPath is the path for shared dir.
	SharedPath = "/shared"
)
View Source
const (
	// FluentBitConfigName is a filename for fluent-bit conf.
	FluentBitConfigName = "fluent-bit.conf"

	// FluentBitConfigPath is the path for fluent-bit config directory.
	FluentBitConfigPath = "/fluent-bit/etc"
)
View Source
const (
	PodNameEnvKey      = "POD_NAME"
	PodNamespaceEnvKey = "POD_NAMESPACE"
	ClusterNameEnvKey  = "CLUSTER_NAME"
)

Environment variables

View Source
const (
	CloneSourceHostKey         = "HOST"
	CloneSourcePortKey         = "PORT"
	CloneSourceUserKey         = "USER"
	CloneSourcePasswordKey     = "PASSWORD"
	CloneSourceInitUserKey     = "INIT_USER"
	CloneSourceInitPasswordKey = "INIT_PASSWORD"
)

Secret keys to clone data from an external mysqld

View Source
const (
	// MocoInitLowerCaseTableNamesFlag is flag for initialize mysqld with 'lower-case-table-names=1'
	MocoInitLowerCaseTableNamesFlag = "--lower-case-table-names"
	// MocoInitDataDirFlag is flag for data dir.
	MocoInitDataDirFlag = "--data-dir"
	// MocoInitConfDirFlag is flag for conf dir.
	MocoInitConfDirFlag = "--conf-dir"
)

moco-init flags

View Source
const (
	AgentContainerName             = "agent"
	InitContainerName              = "moco-init"
	CopyInitContainerName          = "copy-moco-init"
	MysqldContainerName            = "mysqld"
	SlowQueryLogAgentContainerName = "slow-log"
	ExporterContainerName          = "mysqld-exporter"
)

container names

View Source
const (
	AgentContainerCPURequest = "100m"
	AgentContainerCPULimit   = "100m"
	AgentContainerMemRequest = "100Mi"
	AgentContainerMemLimit   = "100Mi"

	InitContainerCPURequest = "100m"
	InitContainerCPULimit   = "100m"
	InitContainerMemRequest = "300Mi"
	InitContainerMemLimit   = "300Mi"

	SlowQueryLogAgentCPURequest = "100m"
	SlowQueryLogAgentCPULimit   = "100m"
	SlowQueryLogAgentMemRequest = "20Mi"
	SlowQueryLogAgentMemLimit   = "20Mi"

	ExporterContainerCPURequest = "200m"
	ExporterContainerCPULimit   = "200m"
	ExporterContainerMemRequest = "100Mi"
	ExporterContainerMemLimit   = "100Mi"
)

container resources

View Source
const (
	MySQLDataVolumeName               = "mysql-data"
	MySQLConfVolumeName               = "mysql-conf"
	MySQLInitConfVolumeName           = "mysql-conf-d"
	MySQLConfSecretVolumeName         = "my-cnf-secret"
	GRPCSecretVolumeName              = "grpc-cert"
	RunVolumeName                     = "run"
	VarLogVolumeName                  = "var-log"
	TmpVolumeName                     = "tmp"
	SlowQueryLogAgentConfigVolumeName = "slow-fluent-bit-config"
	SharedVolumeName                  = "shared"
)

volume names

View Source
const (
	ContainerUID = 10000
	ContainerGID = 10000
)

UID/GID

View Source
const (
	LabelAppInstance  = "app.kubernetes.io/instance"
	LabelAppNamespace = "app.kubernetes.io/instance-namespace"
	LabelAppName      = "app.kubernetes.io/name"
	AppNameMySQL      = "mysql"
	AppNameBackup     = "mysql-backup"
	LabelAppCreatedBy = "app.kubernetes.io/created-by"
	AppCreator        = "moco"

	LabelMocoRole = "moco.cybozu.com/role"
	RolePrimary   = "primary"
	RoleReplica   = "replica"
)

label keys and values

View Source
const (
	AnnDemote        = "moco.cybozu.com/demote"
	AnnSecretVersion = "moco.cybozu.com/secret-version"
)

annotation keys and values

View Source
const (
	// MySQLPort is the port number for MySQL
	MySQLPort     = 3306
	MySQLPortName = "mysql"

	// MySQLXPort is the port number for MySQL XProtocol
	MySQLXPort     = 33060
	MySQLXPortName = "mysqlx"

	// MySQLAdminPort is the port number for MySQL Admin
	MySQLAdminPort     = 33062
	MySQLAdminPortName = "mysql-admin"

	// MySQLHealthPort is the port number to check readiness and liveness of mysqld.
	MySQLHealthPort     = 9081
	MySQLHealthPortName = "health"

	// AgentPort is the port number for agent container
	AgentPort     = 9080
	AgentPortName = "agent"

	// AgentMetricsPort is the port number for agent container
	AgentMetricsPort     = 8080
	AgentMetricsPortName = "agent-metrics"

	// ExporterPort is the port number for mysqld_exporter
	ExporterPort     = 9104
	ExporterPortName = "mysqld-metrics"
)
View Source
const (
	AdminUser       = "moco-admin"
	AgentUser       = "moco-agent"
	ReplicationUser = "moco-repl"
	CloneDonorUser  = "moco-clone-donor"
	ExporterUser    = "moco-exporter"
	BackupUser      = "moco-backup"
	ReadOnlyUser    = "moco-readonly"
	WritableUser    = "moco-writable"
)

MySQL user names for MOCO

View Source
const (
	AdminMyCnf    = AdminUser + "-my.cnf"
	ExporterMyCnf = ExporterUser + "-my.cnf"
	BackupMyCnf   = BackupUser + "-my.cnf"
	ReadOnlyMyCnf = ReadOnlyUser + "-my.cnf"
	WritableMyCnf = WritableUser + "-my.cnf"
)

my.cnf filenames for different kind of users.

View Source
const (
	InitCommand = "moco-init"
)

command names

View Source
const LowerCaseTableNamesConfKey = "lower_case_table_names"
View Source
const MySQLClusterFinalizer = "moco.cybozu.com/mysqlcluster"

MySQLClusterFinalizer is the finalizer specifier for MySQLCluster.

View Source
const PreStopSeconds = "20"

PreStop sleep duration

Variables

MocoSystemUsers is a map to hold system users. This does not include moco-readonly and moco-writable as they are for end users.

MocoUsers is a list of all users created for MOCO.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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