cluster

package
v0.0.0-...-9aebcc3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 40 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
	// Cluster 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 Cluster"
	// MessageResourceSynced is the message used for an Event fired when a
	// Cluster is synced successfully
	MessageResourceSynced = "Cluster synced successfully"
)

Variables

This section is empty.

Functions

func RegisterMetrics

func RegisterMetrics()

RegisterMetrics registers the cluster CRUD metrics.

func SelectorForCluster

func SelectorForCluster(c *v1alpha1.Cluster) 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
}

ConfigMapControlInterface defines the interface that the ClusterController uses to create Configmaps. It is implemented as an interface to enable testing.

func NewRealConfigMapControl

func NewRealConfigMapControl(client kubernetes.Interface) 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 operatoropts.MySQLOperatorOpts,
	opClient clientset.Interface,
	kubeClient kubernetes.Interface,
	clusterInformer informersv1alpha1.ClusterInformer,
	statefulSetInformer appsinformers.StatefulSetInformer,
	podInformer coreinformers.PodInformer,
	serviceInformer coreinformers.ServiceInformer,
	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 ClusterController 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 corelistersv1.PodLister) PodControlInterface

NewRealPodControl creates a concrete implementation of the PodControlInterface.

type SecretControlInterface

type SecretControlInterface interface {
	GetForCluster(cluster *v1alpha1.Cluster) (*v1.Secret, error)
	CreateSecret(s *v1.Secret) error
}

SecretControlInterface defines the interface that the ClusterController uses to get and create 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 *corev1.Service) error
}

ServiceControlInterface defines the interface that the ClusterController uses to create Services. It is implemented as an interface to enable testing.

func NewRealServiceControl

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

NewRealServiceControl creates a concrete implementation of the ServiceControlInterface.

type StatefulSetControlInterface

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

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

func NewRealStatefulSetControl

func NewRealStatefulSetControl(client kubernetes.Interface, statefulSetLister appslistersv1beta1.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