apimachinery: kubedb.dev/apimachinery/pkg/controller Index | Files | Directories

package controller

import "kubedb.dev/apimachinery/pkg/controller"


Package Files

controller.go lib.go


const UtilVolumeName = "util-volume"

func FoundStashCRDs Uses

func FoundStashCRDs(apiExtClient crd_cs.ApiextensionsV1beta1Interface) bool

type Config Uses

type Config struct {
    // Informer factory
    KubeInformerFactory   informers.SharedInformerFactory
    KubedbInformerFactory kubedbinformers.SharedInformerFactory
    StashInformerFactory  stashInformers.SharedInformerFactory
    AppCatInformerFactory appcat_in.SharedInformerFactory

    // DormantDb queue
    DrmnQueue    *queue.Worker
    DrmnInformer cache.SharedIndexInformer
    // job queue
    JobQueue    *queue.Worker
    JobInformer cache.SharedIndexInformer
    // snapshot queue
    SnapQueue    *queue.Worker
    SnapInformer cache.SharedIndexInformer
    // restoreSession queue
    RSQueue    *queue.Worker
    RSInformer cache.SharedIndexInformer

    EnableRBAC              bool
    OperatorNamespace       string
    GoverningService        string
    ResyncPeriod            time.Duration
    MaxNumRequeues          int
    NumThreads              int
    LoggerOptions           golog.Options
    EnableAnalytics         bool
    AnalyticsClientID       string
    WatchNamespace          string
    EnableValidatingWebhook bool
    EnableMutatingWebhook   bool

type Controller Uses

type Controller struct {
    ClientConfig *rest.Config
    // Kubernetes client
    Client kubernetes.Interface
    // Api Extension Client
    ApiExtKubeClient crd_cs.ApiextensionsV1beta1Interface
    // ThirdPartyExtension client
    ExtClient cs.Interface //#TODO: rename to DBClient
    // Dynamic client
    DynamicClient dynamic.Interface
    // AppCatalog client
    AppCatalogClient appcat_cs.Interface
    // StashClient for stash
    StashClient scs.Interface

func (*Controller) BlockOnStashOperator Uses

func (c *Controller) BlockOnStashOperator(stopCh <-chan struct{}) error

BlockOnStashOperator waits for restoresession crd to come up. It either waits until restoresession crd exists or throws error otherwise

func (*Controller) CreateDeploymentPodDisruptionBudget Uses

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

func (*Controller) CreateGoverningService Uses

func (c *Controller) CreateGoverningService(name, namespace string) error

func (*Controller) CreateStatefulSetPodDisruptionBudget Uses

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

func (*Controller) DeleteSnapshotData Uses

func (c *Controller) DeleteSnapshotData(snapshot *api.Snapshot) error

func (*Controller) GetVolumeForSnapshot Uses

func (c *Controller) GetVolumeForSnapshot(st api.StorageType, pvcSpec *core.PersistentVolumeClaimSpec, jobName, namespace string) (*core.Volume, error)

GetVolumeForSnapshot returns pvc or empty directory depending on StorageType. In case of PVC, this function will create a PVC then returns the volume.

func (*Controller) SetJobOwnerReference Uses

func (c *Controller) SetJobOwnerReference(snapshot *api.Snapshot, job *batch.Job) error

type Deleter Uses

type Deleter interface {
    // WaitUntilPaused will block until db pods and service are deleted. PV/PVC will remain intact.
    WaitUntilPaused(*api.DormantDatabase) error
    // WipeOutDatabase won't need to handle snapshots and PVCs.
    // All other elements of database will be Wipedout on WipeOutDatabase function.
    // Ex: secrets, wal-g data and other staff that is required.
    WipeOutDatabase(*api.DormantDatabase) error

type Snapshotter Uses

type Snapshotter interface {
    ValidateSnapshot(*api.Snapshot) error
    GetDatabase(metav1.ObjectMeta) (runtime.Object, error)
    GetSnapshotter(*api.Snapshot) (*batch.Job, error)
    WipeOutSnapshot(*api.Snapshot) error
    SetDatabaseStatus(metav1.ObjectMeta, api.DatabasePhase, string) error
    UpsertDatabaseAnnotation(metav1.ObjectMeta, map[string]string) error



Package controller imports 38 packages (graph) and is imported by 32 packages. Updated 2019-10-07. Refresh now. Tools for package owners.