Documentation ¶
Index ¶
- Constants
- func ApplyEtcdDefaultTemplate(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)
- func ApplyEtcdExtraArgs(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)
- func ApplyEtcdNodeInitArgs(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)
- func ApplyEtcdPersistentVolume(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)
- func ApplyEtcdTLSOptions(e *v1alpha1.EtcdCluster, app *tAppV1.TApp)
- func DefaultTAppTemplateForEtcd(e *v1alpha1.EtcdCluster) corev1.PodTemplateSpec
- func NewEtcdInitContainer(e *v1alpha1.EtcdCluster) corev1.Container
- func NewSeedTApp(e *v1alpha1.EtcdCluster) (*tAppV1.TApp, error)
- type Cluster
- type Controller
Constants ¶
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) ClientConfig ¶
ClientConfig return an etcd client config, for the operator to access 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