controller

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 35 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Informer factory
	KubeInformerFactory        informers.SharedInformerFactory
	KubedbInformerFactory      kubedbinformers.SharedInformerFactory
	AppCatInformerFactory      appcat_in.SharedInformerFactory
	ExternalInformerFactory    externalInformers.SharedInformerFactory
	CertManagerInformerFactory cmInformers.SharedInformerFactory

	// External tool to initialize the database
	Initializers Initializers

	// Secret
	SecretInformer cache.SharedIndexInformer
	SecretLister   corelisters.SecretLister

	// StatefulSet Watcher
	StsQueue    *queue.Worker
	StsInformer cache.SharedIndexInformer
	StsLister   appslister.StatefulSetLister

	// Only watch or reconcile objects in this namespace (usually for license reasons)
	RestrictToNamespace    string
	ResyncPeriod           time.Duration
	ReadinessProbeInterval time.Duration
	MaxNumRequeues         int
	NumThreads             int
}

type Controller

type Controller struct {
	ClientConfig *rest.Config
	// KubeBuilder Client
	KBClient client.Client
	// Kubernetes client
	Client kubernetes.Interface
	// CRD Client
	CRDClient crd_cs.Interface
	// KubeDB client
	DBClient cs.Interface
	// Dynamic client
	DynamicClient dynamic.Interface
	// AppCatalog client
	AppCatalogClient appcat_cs.Interface
	// Cluster topology when the operator started
	ClusterTopology *core_util.Topology
	// RESTMapper allows clients to map resources to kind, and map kind and version
	// to interfaces for manipulating those objects.
	Mapper discovery.ResourceMapper
	// Event Recorder
	Recorder record.EventRecorder
	// Audit Event Publisher
	Auditor *auditlib.EventPublisher
}

func (*Controller) CreateDeploymentPodDisruptionBudget

func (c *Controller) CreateDeploymentPodDisruptionBudget(deployment *apps.Deployment) error

func (*Controller) CreateStatefulSetPodDisruptionBudget deprecated

func (c *Controller) CreateStatefulSetPodDisruptionBudget(sts *apps.StatefulSet) error

Deprecated: CreateStatefulSetPodDisruptionBudget is deprecated. Use SyncStatefulSetPodDisruptionBudget instead.

func (*Controller) SyncStatefulSetPDBWithCustomLabelSelectors added in v0.27.0

func (c *Controller) SyncStatefulSetPDBWithCustomLabelSelectors(sts *apps.StatefulSet, replicas int32, labels map[string]string, matchLabelSelectors map[string]string) error

func (*Controller) SyncStatefulSetPodDisruptionBudget added in v0.27.0

func (c *Controller) SyncStatefulSetPodDisruptionBudget(sts *apps.StatefulSet) error

SyncStatefulSetPodDisruptionBudget syncs the PDB with the current state of the statefulSet. The maxUnavailable is calculated based statefulSet replica count, maxUnavailable = (replicas-1)/2. Also cleanup the PDB, when replica count is 1 or less.

type Initializers

type Initializers struct {
	Stash StashInitializer
}

type StashInitializer

type StashInitializer struct {
	StashClient          scs.Interface
	StashInformerFactory stashinformer.SharedInformerFactory
	// StashInitializer RestoreSession
	RSQueue    *queue.Worker
	RSInformer cache.SharedIndexInformer
	RSLister   lister.RestoreSessionLister

	// StashInitializer RestoreBatch
	RBQueue    *queue.Worker
	RBInformer cache.SharedIndexInformer
	RBLister   lister.RestoreBatchLister
}

Directories

Path Synopsis
initializer

Jump to

Keyboard shortcuts

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