types

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: Apache-2.0 Imports: 1 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// Type is the condition type. It should describe the condition of node in problem. For example
	// KernelDeadlock, OutOfResource etc.
	Type string `json:"type"`
	// Status indicates whether the node is in the condition or not.
	Status ConditionStatus `json:"status"`
	// Transition is the time when the node transits to this condition.
	Transition time.Time `json:"transition"`
	// Reason is a short reason of why node goes into this condition.
	Reason string `json:"reason"`
	// Message is a human readable message of why node goes into this condition.
	Message string `json:"message"`
}

Condition is the node condition used internally by problem detector.

type ConditionStatus added in v0.5.0

type ConditionStatus string

ConditionStatus is the status of the condition.

const (
	// True means the condition status is true.
	True ConditionStatus = "True"
	// False means the condition status is false.
	False ConditionStatus = "False"
	// Unknown means the condition status is unknown.
	Unknown ConditionStatus = "Unknown"
)

type Event

type Event struct {
	// Severity is the severity level of the event.
	Severity Severity `json:"severity"`
	// Timestamp is the time when the event is generated.
	Timestamp time.Time `json:"timestamp"`
	// Reason is a short reason of why the event is generated.
	Reason string `json:"reason"`
	// Message is a human readable message of why the event is generated.
	Message string `json:"message"`
}

Event is the event used internally by node problem detector.

type Monitor added in v0.5.0

type Monitor interface {
	// Start starts the log monitor.
	Start() (<-chan *Status, error)
	// Stop stops the log monitor.
	Stop()
}

Monitor monitors log and custom plugins and reports node problem condition and event according to the rules.

type Severity

type Severity string

Severity is the severity of the problem event. Now we only have 2 severity levels: Info and Warn, which are corresponding to the current kubernetes event types. We may want to add more severity levels in the future.

const (
	// Info is translated to a normal event.
	Info Severity = "info"
	// Warn is translated to a warning event.
	Warn Severity = "warn"
)

type Status

type Status struct {
	// Source is the name of the problem daemon.
	Source string `json:"source"`
	// Events are temporary node problem events. If the status is only a condition update,
	// this field could be nil. Notice that the events should be sorted from oldest to newest.
	Events []Event `json:"events"`
	// Conditions are the permanent node conditions. The problem daemon should always report the
	// newest node conditions in this field.
	Conditions []Condition `json:"conditions"`
}

Status is the status other problem daemons should report to node problem detector.

type Type added in v0.5.0

type Type string

Type is the type of the problem.

const (
	// Temp means the problem is temporary, only need to report an event.
	Temp Type = "temporary"
	// Perm means the problem is permanent, need to change the node condition.
	Perm Type = "permanent"
)

Jump to

Keyboard shortcuts

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