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 ¶
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" )
const AnnotationDeploymentRollbackMessage = "deployment.foremast.ai/rollbackMessage"
const CanarySuffic = "-foremast-canary"
const DeploymentName = "deployment.kubernetes.io/name"
const FOREMAST = "foremast"
const ForemastAnotation = "foremast.ai/monitoring"
const ForemastHPA = "foremastHpa"
const HPA_SCORE_TEMPLATE_DEFAULT = "cpu_bound"
const HPA_STRATEGY_ANYWAY = "anyway"
Generates HPA SCORE any way
const HPA_STRATEGY_HPA_EXISTS = "hpa_exists"
HPA score strategy If the deployment has HPA object, generates score
const MODE_HPA_AND_HEALTHY_MONITORING = "hpa_and_healthy_monitoring"
const MODE_HPA_ONLY = "hpa_only"
const MonitorControllerName = "monitorController"
const Strategy = "deployment.foremast.ai/strategy"
Variables ¶
var AddToManagerFuncs []func(manager.Manager) error
AddToManagerFuncs is a list of functions to add all Controllers to the Manager
Functions ¶
func AddToManager ¶
AddToManager adds all Controllers to the Manager
Types ¶
type Barrelman ¶
type Barrelman struct {
// contains filtered or unexported fields
}
DeploymentController is the controller implementation for watching deployment changes
func NewBarrelman ¶
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"