orchestrator

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "orchestrator"

	ConfigFileName = "orchestrator.conf.json"

	CredsMountPath = "/etc/orchestrator/orchestrator-users-secret"
)

Variables

View Source
var (
	ErrEmptyResponse          = errors.New("empty response")
	ErrUnableToGetClusterName = errors.New("unable to determine cluster name")
	ErrUnauthorized           = errors.New("unauthorized")
	ErrBadConn                = errors.New("bad connection")
	ErrNoSuchHost             = errors.New("mysql host not found")
)

Functions

func AddPeer added in v0.2.0

func AddPeer(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, peer string) error

func BeginDowntime added in v0.12.0

func BeginDowntime(
	ctx context.Context,
	cliCmd clientcmd.Client,
	pod *corev1.Pod,
	host string,
	port int,
	owner string,
	reason string,
	durationSeconds int,
) error

func ConfigMap added in v0.2.0

func ConfigMap(cr *apiv1.PerconaServerMySQL, data map[string]string) *corev1.ConfigMap

func ConfigMapData added in v0.2.0

func ConfigMapData(cr *apiv1.PerconaServerMySQL) (map[string]string, error)

func ConfigMapName added in v0.2.0

func ConfigMapName(cr *apiv1.PerconaServerMySQL) string

func Discover added in v0.4.0

func Discover(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, host string, port int) error

func EndDowntime added in v0.12.0

func EndDowntime(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, host string, port int) error

func EnsureNodeIsPrimary added in v0.3.0

func EnsureNodeIsPrimary(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, clusterHint, host string, port int) error

func FQDN added in v0.2.0

func FQDN(cr *apiv1.PerconaServerMySQL, idx int) string

func ForgetInstance added in v0.8.0

func ForgetInstance(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, host string, port int) error

func GetReadyPod added in v0.12.0

func GetReadyPod(
	ctx context.Context,
	cl client.Client,
	cluster *apiv1.PerconaServerMySQL,
) (*corev1.Pod, error)

func Labels

func Labels(cr *apiv1.PerconaServerMySQL) map[string]string

Labels returns labels of orchestrator

func MatchLabels

func MatchLabels(cr *apiv1.PerconaServerMySQL) map[string]string

func Name

Name returns component name

func PodName added in v0.2.0

func PodName(cr *apiv1.PerconaServerMySQL, idx int) string

func PodService added in v0.2.0

func PodService(cr *apiv1.PerconaServerMySQL, t corev1.ServiceType, podName string) *corev1.Service

func RBAC added in v0.8.0

func RaftNodes added in v0.2.0

func RaftNodes(cr *apiv1.PerconaServerMySQL) []string

func RemovePeer added in v0.2.0

func RemovePeer(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, peer string) error

func Service

func Service(cr *apiv1.PerconaServerMySQL) *corev1.Service

func ServiceName

func ServiceName(cr *apiv1.PerconaServerMySQL) string

func SetWriteable added in v0.8.0

func SetWriteable(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, host string, port int) error

func StartReplication

func StartReplication(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, host string, port int32) error

func StatefulSet

func StatefulSet(cr *apiv1.PerconaServerMySQL, initImage, configHash, tlsHash string) *appsv1.StatefulSet

func StopReplication

func StopReplication(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, host string, port int32) error

Types

type Component added in v0.12.0

type Component apiv1.PerconaServerMySQL

func (*Component) Labels added in v0.12.0

func (c *Component) Labels() map[string]string

func (*Component) MatchLabels added in v0.12.0

func (c *Component) MatchLabels() map[string]string

func (*Component) Name added in v0.12.0

func (c *Component) Name() string

func (*Component) Object added in v0.12.0

func (c *Component) Object(ctx context.Context, cl client.Client) (client.Object, error)

func (*Component) PerconaServerMySQL added in v0.12.0

func (c *Component) PerconaServerMySQL() *apiv1.PerconaServerMySQL

func (*Component) PodSpec added in v0.12.0

func (c *Component) PodSpec() *apiv1.PodSpec

type Exposer added in v0.2.0

type Exposer apiv1.PerconaServerMySQL

func (*Exposer) Exposed added in v0.2.0

func (e *Exposer) Exposed() bool

func (*Exposer) MatchLabels added in v0.12.0

func (e *Exposer) MatchLabels() map[string]string

func (*Exposer) Name added in v0.2.0

func (e *Exposer) Name(index string) string

func (*Exposer) SaveOldMeta added in v0.4.0

func (e *Exposer) SaveOldMeta() bool

func (*Exposer) Service added in v0.2.0

func (e *Exposer) Service(name string) *corev1.Service

func (*Exposer) Size added in v0.2.0

func (e *Exposer) Size() int32

type Instance

type Instance struct {
	Key                  InstanceKey   `json:"Key"`
	Alias                string        `json:"InstanceAlias"`
	MasterKey            InstanceKey   `json:"MasterKey"`
	Replicas             []InstanceKey `json:"Replicas"`
	ReadOnly             bool          `json:"ReadOnly"`
	Problems             []string      `json:"Problems"`
	IsDowntimed          bool          `json:"IsDowntimed"`
	DowntimeReason       string        `json:"DowntimeReason"`
	DowntimeOwner        string        `json:"DowntimeOwner"`
	DowntimeEndTimestamp string        `json:"DowntimeEndTimestamp"`
	ElapsedDowntime      time.Duration `json:"ElapsedDowntime"`
}

func Cluster added in v0.8.0

func Cluster(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, clusterHint string) ([]*Instance, error)

func ClusterPrimary

func ClusterPrimary(ctx context.Context, cliCmd clientcmd.Client, pod *corev1.Pod, clusterHint string) (*Instance, error)

type InstanceKey

type InstanceKey struct {
	Hostname string `json:"Hostname"`
	Port     int32  `json:"Port"`
}

Jump to

Keyboard shortcuts

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