controller

package
v0.0.0-...-3eef760 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// SuccessSynced is used as part of the Event 'reason' when a Foo is synced
	SuccessSynced = "Synced"
	// ErrResourceExists is used as part of the Event 'reason' when a Foo fails
	// to sync due to a Deployment of the same name already existing.
	ErrResourceExists = "ErrResourceExists"

	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a Deployment already existing
	MessageResourceExists = "Resource %q already exists and is not managed by an Foremast-enabled deployment"
	// MessageResourceSynced is the message used for an Event fired when a Foo
	// is synced successfully
	MessageResourceSynced = "Foremast-barrelman-enabled resource synced successfully"
)
View Source
const AnnotationDeploymentRollbackMessage = "deployment.foremast.ai/rollbackMessage"
View Source
const CanarySuffic = "-foremast-canary"
View Source
const DeploymentName = "deployment.kubernetes.io/name"
View Source
const FOREMAST = "foremast"
View Source
const ForemastAnotation = "foremast.ai/monitoring"
View Source
const ForemastHPA = "foremastHpa"
View Source
const HPA_SCORE_TEMPLATE_DEFAULT = "cpu_bound"
View Source
const HPA_STRATEGY_ANYWAY = "anyway"

Generates HPA SCORE any way

View Source
const HPA_STRATEGY_HPA_EXISTS = "hpa_exists"

HPA score strategy If the deployment has HPA object, generates score

View Source
const MODE_HPA_AND_HEALTHY_MONITORING = "hpa_and_healthy_monitoring"
View Source
const MODE_HPA_ONLY = "hpa_only"
View Source
const MonitorControllerName = "monitorController"
View Source
const Strategy = "deployment.foremast.ai/strategy"

Variables

View Source
var AddToManagerFuncs []func(manager.Manager) error

AddToManagerFuncs is a list of functions to add all Controllers to the Manager

Functions

func AddToManager

func AddToManager(m manager.Manager) error

AddToManager adds all Controllers to the Manager

func EnvArrayEquals

func EnvArrayEquals(a []corev1.EnvVar, b []corev1.EnvVar) bool

Types

type Barrelman

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

DeploymentController is the controller implementation for watching deployment changes

func NewBarrelman

func NewBarrelman(
	kubeclientset kubernetes.Interface,
	foremastClientset clientset.Interface,
	mode string,
	hpaStrategy string) *Barrelman

type DeploymentController

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

DeploymentController is the controller implementation for watching deployment changes

func NewDeploymentController

func NewDeploymentController(
	kubeclientset kubernetes.Interface,
	foremastClientset clientset.Interface,
	deploymentInformer appsinformers.DeploymentInformer,
	barrelman *Barrelman) *DeploymentController

NewDeploymentController returns a new sample controller

func (*DeploymentController) Run

func (c *DeploymentController) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items. this is leftover from the sample controller, but seems to do a good job of setting things up

type HpaAlertContent

type HpaAlertContent struct {
	Timestamp   string
	Application string
	Namespace   string
	Action      string
	Old         string
	New         string
	HpaLogEntry []d.HpaLogEntry
}

HpaAlertContent use to prepare data for alert template

type HpaController

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

Watch HPA object,

func NewHpaController

func NewHpaController(kubeclientset kubernetes.Interface, foremastClientset clientset.Interface,
	hpaInfomer hpainformers.HorizontalPodAutoscalerInformer, barrelman *Barrelman) *HpaController

NewDeploymentController returns a new sample controller

type MonitorController

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

func NewMonitorController

func NewMonitorController(kubeclientset kubernetes.Interface, foremastClientset clientset.Interface,
	monitorInformer informers.DeploymentMonitorInformer, barrelman *Barrelman) *MonitorController

NewMonitorController returns a new DeploymentMonitor controller

type RemediationOptions

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

Trigger a rollback if error occured RemediationAutoRollback = "AutoRollback" Trigger a pause only to reduce the error rate RemediationAutoPause = "AutoPause" Let foremast take care everything for you RemediationAuto = "Auto"

Jump to

Keyboard shortcuts

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