Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterState ¶
type ClusterState struct {
// contains filtered or unexported fields
}
ClusterState contains information about all containers in cluster
func NewClusterState ¶
func NewClusterState(ignoreFunc IgnoringContainersFunc) *ClusterState
NewClusterState creates ClusterState
func (*ClusterState) ForgetPod ¶
func (cs *ClusterState) ForgetPod(ns, podName string)
ForgetPod removes all information about pod state
func (*ClusterState) GetUnstableContainers ¶
func (cs *ClusterState) GetUnstableContainers(requiredStabilityPeriod time.Duration) []ContainerAndState
GetUnstableContainers returns all Containers which are not ready or restarts in recent requiredStabilityPeriod
func (*ClusterState) UpdateState ¶
func (cs *ClusterState) UpdateState(c Container, update StateUpdate)
UpdateState update state of the container
type ContainerAndState ¶
ContainerAndState aggregates Container and State
type IgnoringContainersFunc ¶
IgnoringContainersFunc defines function for ignoring containers
func IgnoreContainersByRegexp ¶
func IgnoreContainersByRegexp(podPattern, nsPattern, containerPattern string) (IgnoringContainersFunc, error)
IgnoreContainersByRegexp provides ignore function which checks containers against patterns
type PodWatcher ¶
type PodWatcher struct {
// contains filtered or unexported fields
}
PodWatcher allows to listen for changes in pods
func NewPodWatcher ¶
func NewPodWatcher(podListWatcher cache.ListerWatcher, onPodUpdate func(pod *v1.Pod), onPodDelete func(ns, name string)) *PodWatcher
NewPodWatcher creates pod watcher.
onPodUpdate function will be called every time update for pod occurs, and onPodDelete on each delete event. Both functions should be fast, and O(1) as they are blocking event ingestion by shared informer.
func (*PodWatcher) StartListeningToEvents ¶
func (w *PodWatcher) StartListeningToEvents() error
StartListeningToEvents starts listening on pod events
func (*PodWatcher) Stop ¶
func (w *PodWatcher) Stop()
Stop stops watching on pod events. It has to be called to properly free up all resources. Be aware that resource release is only signaled but there is no way to wait till resources are actually released.
type StateUpdate ¶
StateUpdate contains information about changes in container's State