v0.46.0 Latest Latest

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 37 Imported by: 12




This section is empty.


This section is empty.


This section is empty.


type Config

type Config struct {
	// Informer factory
	KubeInformerFactory        informers.SharedInformerFactory
	KubedbInformerFactory      kubedbinformers.SharedInformerFactory
	AppCatInformerFactory      appcat_in.SharedInformerFactory
	CertManagerInformerFactory cmInformers.SharedInformerFactory
	PetSetInformerFactory      psinformer.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

	// PetSet Watcher
	PSQueue    *queue.Worker
	PSInformer cache.SharedIndexInformer
	PSLister   pslister.PetSetLister

	// 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
	// KubeDB client
	DBClient cs.Interface
	// PetSet client
	PSClient petsetcs.Interface
	// Dynamic client
	DynamicClient dynamic.Interface
	// AppCatalog client
	AppCatalogClient appcat_cs.Interface
	// Cluster topology when the operator started
	ClusterTopology *core_util.Topology
	// 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) SyncPetSetPDBWithCustomLabelSelectors added in v0.44.0

func (c *Controller) SyncPetSetPDBWithCustomLabelSelectors(ps *psapi.PetSet, replicas int32, labels map[string]string, matchLabelSelectors map[string]string) error

func (*Controller) SyncPetSetPodDisruptionBudget added in v0.44.0

func (c *Controller) SyncPetSetPodDisruptionBudget(ps *psapi.PetSet) error

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

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


Path Synopsis

Jump to

Keyboard shortcuts

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