Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetParentNameAndOrdinal ¶
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 ¶
NewInstanceFromGroupSeed creates an Instance from a fully qualified group seed.
func NewLocalInstance ¶
NewLocalInstance creates a new instance of this structure, with it's name and index populated from os.Hostname().
func (*Instance) GetPassword ¶
GetPassword returns the password of the MySQL operator's management user.
func (*Instance) GetShellURI ¶
GetShellURI returns the MySQL shell URI for the local MySQL instance.
func (*Instance) WhitelistCIDR ¶
WhitelistCIDR returns the CIDR range to whitelist for GR based on the Pod's IP.