Documentation ¶
Index ¶
Constants ¶
const AppMonitorAnnotation string = "app-monitor.kubedemo.com/monitor"
const AppMonitorAnnotationRedeployInProgress string = "app-monitor.kubedemo.com/redeploy-in-progress"
const Description string = "Allow user to create an app monitor to supervise the app and the resources it needs."
const Domain string = "kubedemo.com"
const ResourceName string = "appmonitor"
const ResourceNamePlural string = "appmonitors"
const TPRName string = "app-monitor"
const Version string = "v1"
Variables ¶
This section is empty.
Functions ¶
func ListAppMonitorsWithClient ¶
List all AppMonitors in the cluster.
Types ¶
type AppMonitor ¶
type AppMonitor struct { // TODO: add Name field for AppMonitor as its currently missing unversioned.TypeMeta `json:",inline"` Metadata api.ObjectMeta `json:"metadata"` Spec AppMonitorSpec `json:"spec"` }
func CopyObjToAppMonitor ¶
func CopyObjToAppMonitor(obj interface{}) (*AppMonitor, error)
Create a deep-copy of an AppMonitor object
func CopyObjToAppMonitors ¶
func CopyObjToAppMonitors(obj []interface{}) ([]AppMonitor, error)
Attempt to deep copy an empty interface into an AppMonitorList.
func NewAppMonitor ¶
func NewAppMonitor(name string, memThresholdPercent, memMultiplier float64) *AppMonitor
func (*AppMonitor) GetObjectKind ¶
func (am *AppMonitor) GetObjectKind() unversioned.ObjectKind
Required to satisfy Object interface
func (*AppMonitor) GetObjectMeta ¶
func (am *AppMonitor) GetObjectMeta() meta.Object
Required to satisfy ObjectMetaAccessor interface
func (*AppMonitor) Instantiate ¶
func (am *AppMonitor) Instantiate(kubecfg, namespace string) error
Instantiate an AppMonitor in the cluster.
func (*AppMonitor) UnmarshalJSON ¶
func (am *AppMonitor) UnmarshalJSON(data []byte) error
type AppMonitorController ¶
type AppMonitorController struct {
// contains filtered or unexported fields
}
Implements an AppMonitor's controller loop in a particular namespace. The controller makes use of an Informer resource to locally cache resources managed, and handle events on the resources.
func NewAppMonitorController ¶
func NewAppMonitorController(kubeconfig, namespace, prometheusAddr string) ( *AppMonitorController, error)
Create a new Controller for the AppMonitor operator
func (*AppMonitorController) Run ¶
func (amc *AppMonitorController) Run(stop <-chan struct{})
Run begins the AppMonitorController.
func (*AppMonitorController) Start ¶
func (amc *AppMonitorController) Start(stop <-chan struct{})
Start the AppMonitorController until stopped.
type AppMonitorControllerInformer ¶
type AppMonitorControllerInformer struct {
// contains filtered or unexported fields
}
Implements an Informer for the resources being operated on: Pods & AppMonitors.
type AppMonitorCopy ¶
type AppMonitorCopy AppMonitor
type AppMonitorList ¶
type AppMonitorList struct { unversioned.TypeMeta `json:",inline"` Metadata unversioned.ListMeta `json:"metadata"` Items []AppMonitor `json:"items"` }
func (*AppMonitorList) GetListMeta ¶
func (aml *AppMonitorList) GetListMeta() unversioned.List
Required to satisfy ListMetaAccessor interface
func (*AppMonitorList) GetObjectKind ¶
func (aml *AppMonitorList) GetObjectKind() unversioned.ObjectKind
Required to satisfy Object interface
func (*AppMonitorList) UnmarshalJSON ¶
func (aml *AppMonitorList) UnmarshalJSON(data []byte) error
type AppMonitorListCopy ¶
type AppMonitorListCopy AppMonitorList
type AppMonitorSpec ¶
type AppMonitorSpec struct { MemThresholdPercent float64 `json:memThresholdPercent` MemMultiplier float64 `json:memMultiplier` }
An AppMonitor redeploys an app when resource limits are exceeded.