etcdcluster

package
v0.0.0-...-215afb5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// AnnotationInitImage is an init image annotation, you can specify this annotation to replace the default init image
	AnnotationInitImage = "etcdcluster.etcd.tkestack.io/init-image"
)

Variables

This section is empty.

Functions

func ApplyEtcdDefaultTemplate

func ApplyEtcdDefaultTemplate(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)

ApplyEtcdDefaultTemplate set default TApp template with the EtcdCluster template

func ApplyEtcdExtraArgs

func ApplyEtcdExtraArgs(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)

ApplyEtcdExtraArgs set the etcd extra args for TApp

func ApplyEtcdNodeInitArgs

func ApplyEtcdNodeInitArgs(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)

ApplyEtcdNodeInitArgs set the TApp container args with the EtcdCluster template

func ApplyEtcdPersistentVolume

func ApplyEtcdPersistentVolume(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)

ApplyEtcdPersistentVolume set the TApp persistent volume option with EtcdCluster's persistent volume claim spec

func ApplyEtcdTLSOptions

func ApplyEtcdTLSOptions(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)

ApplyEtcdTLSOptions set the etcd tls option args for TApp

func DefaultTAppTemplateForEtcd

func DefaultTAppTemplateForEtcd(e *v1alpha1.EtcdCluster) corev1.PodTemplateSpec

DefaultTAppTemplateForEtcd create TApp template from the EtcdCluster template

func NewEtcdInitContainer

func NewEtcdInitContainer(e *v1alpha1.EtcdCluster) corev1.Container

NewEtcdInitContainer returns the init container used to start etcd node

func NewSeedTApp

func NewSeedTApp(e *v1alpha1.EtcdCluster) (*tAppV1.TApp, error)

NewSeedTApp create a new TApp from an EtcdCluster template

Types

type Cluster

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

Cluster controls an etcd cluster's lifecycle

func NewCluster

func NewCluster(
	etcd *v1alpha1.EtcdCluster,
	reconcileInterval time.Duration,
	statusReconcileInterval time.Duration,
	recorder record.EventRecorder,
	kubeClient clientset.Interface,
	etcdClient etcdClientSet.Interface,
	tAppClient tAppClientSet.Interface,
	etcdLister etcdLister.EtcdClusterLister,
	tAppLister tAppLister.TAppLister,
	podLister coreListers.PodLister,
	svcLister coreListers.ServiceLister,
	secretLister coreListers.SecretLister,
	cmLister coreListers.ConfigMapLister,
) *Cluster

NewCluster construct Cluster to control the etcd cluster's lifecycle

func (*Cluster) Client

func (c *Cluster) Client() (*clientv3.Client, error)

Client return an etcd client which can be used to access the etcd cluster

func (*Cluster) ClientConfig

func (c *Cluster) ClientConfig() (*clientv3.Config, error)

ClientConfig return an etcd client config, for the operator to access etcd cluster

func (*Cluster) Run

func (c *Cluster) Run()

Run runs the Cluster controller.

func (*Cluster) Stop

func (c *Cluster) Stop()

Stop will stop the control of the etcd cluster.

func (*Cluster) Update

func (c *Cluster) Update()

Update will trigger an update event that syncs the etcd cluster.

type Controller

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

Controller controls etcdclusters

func NewEtcdClusterController

func NewEtcdClusterController(
	reconcileInterval time.Duration,
	statusReconcileInterval time.Duration,
	etcdClient etcdClientSet.Interface,
	tAppClient tAppClientSet.Interface,
	kubeClient clientset.Interface,
	etcdInformer etcdInformer.EtcdClusterInformer,
	tAppInformer tAppInformer.TAppInformer,
	podInformer coreInformers.PodInformer,
	svcInformer coreInformers.ServiceInformer,
	secretInformer coreInformers.SecretInformer,
	cmInformer coreInformers.ConfigMapInformer,
) *Controller

NewEtcdClusterController create a new etcdcluster controller

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, workers int)

Run runs the etcdcluster controller.

func (*Controller) StopControl

func (c *Controller) StopControl(e *etcdv1alpha1.EtcdCluster)

StopControl will stop controlling the specified EtcdCluster

func (*Controller) UpdateEtcdCluster

func (c *Controller) UpdateEtcdCluster(e *etcdv1alpha1.EtcdCluster)

UpdateEtcdCluster will create an etcd Cluster object to manage the specified etcd cluster, if the Cluster object exist, calling the function will trigger an update event to reconcile the etcd cluster

Jump to

Keyboard shortcuts

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