Documentation
¶
Index ¶
- Constants
- func ConfigHash(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL) (string, error)
- func ConfigMapName(prefix string) string
- func Containers(cr *apiv1.PerconaServerMySQL, dataMount, backupLogsMount corev1.VolumeMount) []corev1.Container
- func InitEnv(cr *apiv1.PerconaServerMySQL) []corev1.EnvVar
- func LogDir(dataMountPath string) string
- func MySQLEnv(cr *apiv1.PerconaServerMySQL, dataMountPath string) []corev1.EnvVar
- func Reconcile(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL) error
- func Volumes(cr *apiv1.PerconaServerMySQL) []corev1.Volume
Constants ¶
const ( // ContainerName is the name of the Fluent Bit sidecar. ContainerName = apiv1.LogCollectorContainerName // Component is the last segment of the Fluent Bit tag. Component = "mysql" // EnabledEnvVar tells ps-entrypoint.sh to point log_error at a file on the // data volume instead of leaving it on stderr. EnabledEnvVar = "LOG_COLLECTOR_ENABLED" // LogDirEnvVar holds the directory that mysqld writes its logs to. LogDirEnvVar = "LOG_DIR" // HTTPPort is the port Fluent Bit's HTTP server listens on. HTTPPort = 2020 // LogDirName is the log directory, relative to the MySQL data directory. It // lives on the data volume so the logs survive a pod restart. LogDirName = "log" )
Variables ¶
This section is empty.
Functions ¶
func ConfigHash ¶
func ConfigHash(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL) (string, error)
ConfigHash digests the log collector configuration, including the contents of the ConfigMaps it references.
func ConfigMapName ¶
ConfigMapName returns the name of the ConfigMap holding the custom Fluent Bit configuration.
func Containers ¶
func Containers(cr *apiv1.PerconaServerMySQL, dataMount, backupLogsMount corev1.VolumeMount) []corev1.Container
Containers returns the Fluent Bit and logrotate sidecars for a MySQL pod. dataMount is the MySQL data volume, which holds the logs to tail; backupLogsMount is the xtrabackup sidecar's log volume on the same pod.
func InitEnv ¶
func InitEnv(cr *apiv1.PerconaServerMySQL) []corev1.EnvVar
InitEnv returns the environment the init container needs so it can fail loudly when log collection is on but the init image does not ship the log collector assets, instead of leaving the sidecars to crash-loop on a missing entrypoint.
func MySQLEnv ¶
func MySQLEnv(cr *apiv1.PerconaServerMySQL, dataMountPath string) []corev1.EnvVar
MySQLEnv returns the environment the mysqld container needs so its entrypoint writes the error log to a file the collector can tail.
Types ¶
This section is empty.