cluster

package
v0.0.0-...-c2ba8ab Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessSynced is used as part of the Event 'reason' when a MySQSL is
	// synced.
	SuccessSynced = "Synced"
	// ErrResourceExists is used as part of the Event 'reason' when a
	// MySQLCluster fails to sync due to a resource of the same name already
	// existing.
	ErrResourceExists = "ErrResourceExists"

	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a resource already existing.
	MessageResourceExists = "%s %s/%s already exists and is not managed by MySQLCluster"
	// MessageResourceSynced is the message used for an Event fired when a
	// MySQLCluster is synced successfully
	MessageResourceSynced = "MySQLCluster synced successfully"
)

Variables

This section is empty.

Functions

func RegisterMetrics

func RegisterMetrics()

func SelectorForCluster

func SelectorForCluster(c *api.MySQLCluster) labels.Selector

SelectorForCluster creates a labels.Selector to match a given clusters associated resources.

func SelectorForClusterOperatorVersion

func SelectorForClusterOperatorVersion(operatorVersion string) labels.Selector

SelectorForClusterOperatorVersion creates a labels.Selector to match a given clusters associated resources MySQLOperatorVersionLabel.

Types

type ConfigMapControlInterface

type ConfigMapControlInterface interface {
	CreateConfigMap(c *v1.ConfigMap) error
	DeleteConfigMap(c *v1.ConfigMap) error
}

ConfigMapControlInterface defines the interface that the MySQLClusterController uses to create, update, and delete Configmap. It is implemented as an interface to enable testing.

func NewRealConfigMapControl

func NewRealConfigMapControl(client kubernetes.Interface, ConfigMapLister corelisters.ConfigMapLister) ConfigMapControlInterface

NewRealConfigMapControl creates a concrete implementation of the ConfigMapControlInterface.

type MySQLController

type MySQLController struct {
	// contains filtered or unexported fields
}

The MySQLController watches the Kubernetes API for changes to MySQL resources

func NewController

func NewController(
	opConfig options.MySQLOperatorServer,
	opClient mysqlop.Interface,
	kubeClient kubernetes.Interface,
	apiServerVersion *version.Info,
	clusterInformer opinformers.MySQLClusterInformer,
	statefulSetInformer appsinformers.StatefulSetInformer,
	podInformer coreinformers.PodInformer,
	serviceInformer coreinformers.ServiceInformer,
	configMapInformer coreinformers.ConfigMapInformer,
	resyncPeriod time.Duration,
	namespace string,
) *MySQLController

NewController creates a new MySQLController.

func (*MySQLController) Run

func (m *MySQLController) Run(ctx context.Context, threadiness int)

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type PodControlInterface

type PodControlInterface interface {
	PatchPod(old *v1.Pod, new *v1.Pod) error
}

PodControlInterface defines the interface that the MySQLClusterController uses to create, update, and delete mysql pods. It is implemented as an interface to enable testing.

func NewRealPodControl

func NewRealPodControl(client kubernetes.Interface, podLister corelisters.PodLister) PodControlInterface

NewRealPodControl creates a concrete implementation of the PodControlInterface.

type SecretControlInterface

type SecretControlInterface interface {
	GetForCluster(cluster *api.MySQLCluster) (*v1.Secret, error)
	CreateSecret(s *v1.Secret) error
	DeleteSecret(s *v1.Secret) error
}

SecretControlInterface defines the interface that the MySQLClusterController uses to create, update, and delete Secrets. It is implemented as an interface to enable testing.

func NewRealSecretControl

func NewRealSecretControl(client kubernetes.Interface) SecretControlInterface

NewRealSecretControl creates a concrete implementation of the SecretControlInterface.

type ServiceControlInterface

type ServiceControlInterface interface {
	CreateService(s *v1.Service) error
	DeleteService(s *v1.Service) error
}

ServiceControlInterface defines the interface that the MySQLClusterController uses to create, update, and delete Services. It is implemented as an interface to enable testing.

func NewRealServiceControl

func NewRealServiceControl(client kubernetes.Interface, serviceLister corelisters.ServiceLister) ServiceControlInterface

NewRealServiceControl creates a concrete implementation of the ServiceControlInterface.

type StatefulSetControlInterface

type StatefulSetControlInterface interface {
	CreateStatefulSet(ss *apps.StatefulSet) error
	DeleteStatefulSet(ss *apps.StatefulSet) error
	PatchStatefulSet(old *apps.StatefulSet, new *apps.StatefulSet) error
}

StatefulSetControlInterface defines the interface that the MySQLClusterController uses to create, update, and delete StatefulSets. It is implemented as an interface to enable testing.

func NewRealStatefulSetControl

func NewRealStatefulSetControl(client kubernetes.Interface, statefulSetLister appslisters.StatefulSetLister) StatefulSetControlInterface

NewRealStatefulSetControl creates a concrete implementation of the StatefulSetControlInterface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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