addon_operator

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultConfigMapName = "addon-operator"
View Source
const DefaultGlobalHooksDir = "global-hooks"
View Source
const DefaultMetricsPrefix = "addon_operator_"
View Source
const DefaultModulesDir = "modules"
View Source
const DefaultTasksQueueDumpFilePath = "/tmp/addon-operator-tasks-queue"
View Source
const DefaultTmpDir = "/tmp/addon-operator"
View Source
const DefaultValuesChecksumsAnnotation = "addon-operator/values-checksums"

Variables

View Source
var (
	ModulesDir     string
	GlobalHooksDir string
	TempDir        string

	// TasksQueueDumpFilePath is the name of the file to which the queue will be dumped.
	TasksQueueDumpFilePath string

	TasksQueue *task.TasksQueue

	// ModuleManager is the module manager object, which monitors configuration
	// and variable changes.
	ConfigMapName             string
	ValuesChecksumsAnnotation string
	ModuleManager             module_manager.ModuleManager

	ScheduleManager schedule_manager.ScheduleManager
	ScheduledHooks  schedule_hook.ScheduledHooksStorage

	KubeEventsManager kube_events_manager.KubeEventsManager
	KubeEventsHooks   kube_event_hook.KubeEventsHooksController

	MetricsPrefix  string
	MetricsStorage *metrics_storage.MetricStorage

	// ManagersEventsHandlerStopCh is the channel object for stopping infinite loop of the ManagersEventsHandler.
	ManagersEventsHandlerStopCh chan struct{}
)
View Source
var (
	QueueIsEmptyDelay = 3 * time.Second
	FailedHookDelay   = 5 * time.Second
	FailedModuleDelay = 5 * time.Second
)

Defining delays in processing tasks from queue.

Functions

func CreateOnStartupTasks

func CreateOnStartupTasks()

func CreateReloadAllTasks

func CreateReloadAllTasks(onStartup bool)

func Init added in v1.0.6

func Init() error

Init gets all settings, initialize managers and create a working queue.

Settings: directories for modules, global hooks, host name, dump file, tiller namespace.

Initializing necessary objects: helm/tiller, registry manager, module manager, kube events manager.

Creating an empty queue with jobs.

func InitHttpServer

func InitHttpServer(listenAddr *net.TCPAddr)

func ManagersEventsHandler

func ManagersEventsHandler()

func PrefixMetric

func PrefixMetric(metric string) string

func Run

func Run()

Run runs all managers, event and queue handlers.

The main process is blocked by the 'for-select' in the queue handler.

func RunAddonOperatorMetrics

func RunAddonOperatorMetrics()

func TasksRunner

func TasksRunner()

TasksRunner handle tasks in queue.

Task handler may delay task processing by pushing delay to the queue. FIXME: For now, only one TaskRunner for a TasksQueue. There should be a lock between Peek and Pop to prevent Poping tasks from other TaskRunner

func UpdateScheduleHooks

UpdateScheduleHooks creates the new ScheduledHooks. Calculates the difference between the old and the new schedule, removes what was in the old but is missing in the new schedule.

Types

This section is empty.

Jump to

Keyboard shortcuts

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