addon_operator

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 19 Imported by: 3

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{}

	// HelmClient is the object for Helm client.
	HelmClient helm.HelmClient
)
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()

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. TODO пока только один обработчик, всё ок. Но лучше, чтобы очередь позволяла удалять только то, чему ранее был сделан peek. Т.е. кто взял в обработку задание, тот его и удалил из очереди. Сейчас Peek-нуть может одна го-рутина, другая добавит, первая Pop-нет задание — новое задание пропало, второй раз будет обработано одно и тоже.

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