scheduler

package
v4.5.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateBackRestSchedule

func ValidateBackRestSchedule(scheduleType, deployment, label, backupType, storageType string) error

func ValidatePolicySchedule

func ValidatePolicySchedule(scheduleType, policy, database string) error

func ValidateSchedule

func ValidateSchedule(schedule string) error

ValidateSchedule validates that the cron syntax is valid We use the standard format here...

func ValidateScheduleType

func ValidateScheduleType(schedule string) error

Types

type BackRestBackupJob

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

func (BackRestBackupJob) Run

func (b BackRestBackupJob) Run()

type Controller

type Controller struct {
	Informer  coreinformers.ConfigMapInformer
	Scheduler *Scheduler
}

Controller holds the client and informer for the controller, along with a pointer to a Scheduler.

func (*Controller) AddConfigMapEventHandler

func (c *Controller) AddConfigMapEventHandler()

AddConfigMapEventHandler adds the pgcluster event handler to the pgcluster informer

type ControllerManager

type ControllerManager struct {
	Scheduler *Scheduler
	// contains filtered or unexported fields
}

ControllerManager manages a map of controller groups, each of which is comprised of the various controllers needed to handle events within a specific namespace. Only one controllerGroup is allowed per namespace.

func NewControllerManager

func NewControllerManager(namespaces []string, scheduler *Scheduler, installationName string,
	namespaceOperatingMode ns.NamespaceOperatingMode) (*ControllerManager, error)

NewControllerManager returns a new ControllerManager comprised of controllerGroups for each namespace included in the 'namespaces' parameter.

func (*ControllerManager) AddAndRunGroup

func (c *ControllerManager) AddAndRunGroup(namespace string) error

AddAndRunGroup is a convenience function that adds a controller group for the namespace specified, and then immediately runs the controllers in that group.

func (*ControllerManager) AddGroup

func (c *ControllerManager) AddGroup(namespace string) error

AddGroup adds a new controller group for the namespace specified. Each controller group is comprised of a controller for the following resource: - configmaps One SharedInformerFactory is utilized, specifically for Kube resources, to create and track the informers for this resource. Each controller group also receives its own clients, which can then be utilized by the controller within the controller group.

func (*ControllerManager) RemoveAll

func (c *ControllerManager) RemoveAll()

RemoveAll removes all controller groups managed by the controller manager, first stopping all controllers within each controller group managed by the controller manager.

func (*ControllerManager) RemoveGroup

func (c *ControllerManager) RemoveGroup(namespace string)

RemoveGroup removes the controller group for the namespace specified, first stopping all controllers within that group

func (*ControllerManager) RunAll

func (c *ControllerManager) RunAll() error

RunAll runs all controllers across all controller groups managed by the controller manager.

func (*ControllerManager) RunGroup

func (c *ControllerManager) RunGroup(namespace string) error

RunGroup runs the controllers within the controller group for the namespace specified.

type PGBackRest

type PGBackRest struct {
	Deployment  string `json:"deployment"`
	Label       string `json:"label"`
	Container   string `json:"container"`
	Type        string `json:"type"`
	StorageType string `json:"storageType,omitempty"`
	Options     string `json:"options"`
}

type Policy

type Policy struct {
	Secret      string `json:"secret"`
	Name        string `json:"name"`
	ImagePrefix string `json:"imagePrefix"`
	ImageTag    string `json:"imageTag"`
	Database    string `json:"database"`
}

type PolicyJob

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

func (PolicyJob) Run

func (p PolicyJob) Run()

type PolicyTemplate

type PolicyTemplate struct {
	JobName        string
	ClusterName    string
	PGOImagePrefix string
	PGOImageTag    string
	PGHost         string
	PGPort         string
	PGDatabase     string
	PGUserSecret   string
	PGSQLConfigMap string
}

type ScheduleTemplate

type ScheduleTemplate struct {
	Version    string    `json:"version"`
	Name       string    `json:"name"`
	Created    time.Time `json:"created"`
	Schedule   string    `json:"schedule"`
	Namespace  string    `json:"namespace"`
	Type       string    `json:"type"`
	Cluster    string    `json:"cluster"`
	PGBackRest `json:"pgbackrest,omitempty"`
	Policy     `json:"policy,omitempty"`
}

func (*ScheduleTemplate) NewBackRestSchedule

func (s *ScheduleTemplate) NewBackRestSchedule() BackRestBackupJob

func (*ScheduleTemplate) NewPolicySchedule

func (s *ScheduleTemplate) NewPolicySchedule() PolicyJob

type Scheduler

type Scheduler struct {
	CronClient *cv2.Cron
	// contains filtered or unexported fields
}

func New

func New(label, namespace string, client kubeapi.Interface) *Scheduler

func (*Scheduler) AddSchedule

func (s *Scheduler) AddSchedule(config *v1.ConfigMap) error

func (*Scheduler) DeleteSchedule

func (s *Scheduler) DeleteSchedule(config *v1.ConfigMap)

Jump to

Keyboard shortcuts

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