cluster

package
v0.0.0-...-830b495 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: BSD-3-Clause, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParentNameAndOrdinal

func GetParentNameAndOrdinal(name string) (string, int)

GetParentNameAndOrdinal gets the name of a Pod's parent StatefulSet and Pod's ordinal from the Pods name (or hostname). If the Pod was not created by a StatefulSet, its parent is considered to be empty string, and its ordinal is considered to be -1.

func GetStatus

func GetStatus() *innodb.ClusterStatus

GetStatus fetches a copy of the latest cluster status.

func NewHealthCheck

func NewHealthCheck() (healthcheck.Check, error)

NewHealthCheck constructs a healthcheck for the local instance which checks cluster status using mysqlsh.

func SetStatus

func SetStatus(new *innodb.ClusterStatus)

SetStatus sets the status of the local mysql cluster. The cluster manager controller is responsible for updating.

Types

type Instance

type Instance struct {
	// Namespace is the Kubernetes Namespace in which the instance is running.
	Namespace string
	// ClusterName is the name of the Cluster to which the instance
	// belongs.
	ClusterName string
	// ParentName is the name of the StatefulSet to which the instance belongs.
	ParentName string
	// Ordinal is the StatefulSet ordinal of the instances Pod.
	Ordinal int
	// Port is the port on which MySQLDB is listening.
	Port int
	// MultiMaster specifies if all, or just a single, instance is configured to be read/write.
	MultiMaster bool

	// IP is the IP address of the Kubernetes Pod.
	IP net.IP
}

Instance represents the local MySQL instance.

func NewInstance

func NewInstance(namespace, clusterName, parentName string, ordinal, port int, multiMaster bool) *Instance

NewInstance creates a new Instance.

func NewInstanceFromGroupSeed

func NewInstanceFromGroupSeed(seed string) (*Instance, error)

NewInstanceFromGroupSeed creates an Instance from a fully qualified group seed.

func NewLocalInstance

func NewLocalInstance() (*Instance, error)

NewLocalInstance creates a new instance of this structure, with it's name and index populated from os.Hostname().

func (*Instance) GetPassword

func (i *Instance) GetPassword() string

GetPassword returns the password of the MySQL operator's management user.

func (*Instance) GetShellURI

func (i *Instance) GetShellURI() string

GetShellURI returns the MySQL shell URI for the local MySQL instance.

func (*Instance) GetUser

func (i *Instance) GetUser() string

GetUser returns the username of the MySQL operator's management user.

func (*Instance) Name

func (i *Instance) Name() string

Name returns the name of the instance.

func (*Instance) PodName

func (i *Instance) PodName() string

PodName returns the name of the instance's Pod.

func (*Instance) WhitelistCIDR

func (i *Instance) WhitelistCIDR() (string, error)

WhitelistCIDR returns the CIDR range to whitelist for GR based on the Pod's IP.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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