types

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TestConfigRules holds the testable ConfigRules{} struct
	TestConfigRules ConfigRules
	// TestAlertersConfig holds the testable AlertersConfig{} struct
	TestAlertersConfig AlertersConfig
)

Functions

func StubsInit

func StubsInit() (ConfigRules, AlertersConfig)

StubsInit generates stub configurations purely for testing purposes

Types

type AlerterTypes

type AlerterTypes struct {
	PDAlerterList      []PDAlerterConfig      `json:"pagerdutyV2"`
	SlackAlerterList   []SlackAlerterConfig   `json:"slack"`
	SMTPAlerterList    []SMTPAlerterConfig    `json:"smtp"`
	WebhookAlerterList []WebhookAlerterConfig `json:"webhook"`
}

AlerterTypes are the actual types of alerter structs

type AlertersConfig

type AlertersConfig struct {
	Types AlerterTypes `json:"alerters"`
}

AlertersConfig is the top level struct containing alerter configuration data

type ConfigRules

type ConfigRules struct {
	Deployments    []DeploymentAlertSpec `json:"deployments"`
	Pods           []PodAlertSpec        `json:"pods"`
	Daemonsets     []DaemonsetAlertSpec  `json:"daemonsets"`
	Nodes          []NodeAlertSpec       `json:"nodes"`
	AlertersConfig AlertersConfig        `json:"alerters"`
}

ConfigRules represents the structure of the config file for k8eraid

type DaemonsetAlertSpec

type DaemonsetAlertSpec struct {
	Name         string               `json:"name"`
	DaemonFilter string               `json:"filter"`
	AlerterType  string               `json:"alerterType"`
	AlerterName  string               `json:"alerterName"`
	ReportStatus DaemonsetAlertStatus `json:"reportStatus"`
}

DaemonsetAlertSpec represents a single configuration for monitoring a DaemonSet

type DaemonsetAlertStatus

type DaemonsetAlertStatus struct {
	FailedScheduling bool  `json:"failedScheduling"`
	CheckReplicas    bool  `json:"checkReplicas"`
	PendingThreshold int64 `json:"pendingThreshold"`
}

DaemonsetAlertStatus represents the thresholds to alert on for DaemonSets

type DeploymentAlertSpec

type DeploymentAlertSpec struct {
	Name         string                `json:"name"`
	DepFilter    string                `json:"filter"`
	AlerterType  string                `json:"alerterType"`
	AlerterName  string                `json:"alerterName"`
	ReportStatus DeploymentAlertStatus `json:"reportStatus"`
}

DeploymentAlertSpec represents a Deployment Alert Rule

type DeploymentAlertStatus

type DeploymentAlertStatus struct {
	MinReplicas      int32 `json:"minReplicas"`
	PendingThreshold int64 `json:"pendingThreshold"`
}

DeploymentAlertStatus represents the thresholds to alert on for Deployments

type NodeAlertSpec

type NodeAlertSpec struct {
	Name         string          `json:"name"`
	NodeFilter   string          `json:"filter"`
	AlerterType  string          `json:"alerterType"`
	AlerterName  string          `json:"alerterName"`
	ReportStatus NodeAlertStatus `json:"reportStatus"`
}

NodeAlertSpec represents the configuration for alerting on Node issues

type NodeAlertStatus

type NodeAlertStatus struct {
	PendingThreshold   int64 `json:"pendingThreshold"`
	NodeOutOfDisk      bool  `json:"outOfDisk"`
	NodeMemoryPressure bool  `json:"memoryPressure"`
	NodeDiskPressure   bool  `json:"diskPressure"`
	NodeReady          bool  `json:"readiness"`
	MinNodes           int32 `json:"minNodes"`
}

NodeAlertStatus represents the thresholds to alert on for Nodes

type PDAlertDetails

type PDAlertDetails struct {
	Subject string    `json:"subject"`
	Message string    `json:"message"`
	Time    time.Time `json:"time"`
}

PDAlertDetails contains the needed data to put into the body of a Pager Duty type alert

type PDAlerterConfig

type PDAlerterConfig struct {
	Name             string `json:"name"`
	ServiceKeyEnvVar string `json:"serviceKeyEnvVar"`
	ProxyServer      string `json:"proxyServer"`
	Subject          string `json:"subject"`
}

PDAlerterConfig struct contains the needed data for triggering a Pager Duty type alert

type PodAlertSpec

type PodAlertSpec struct {
	Name               string         `json:"name"`
	PodFilterNamespace string         `json:"filterNamespace"`
	PodFilterLabel     string         `json:"filterLabel"`
	AlerterType        string         `json:"alerterType"`
	AlerterName        string         `json:"alerterName"`
	ReportStatus       PodAlertStatus `json:"reportStatus"`
}

PodAlertSpec represents the configuration for alerting on Pods

type PodAlertStatus

type PodAlertStatus struct {
	MinPods          int32 `json:"minPods"`
	PodRestarts      bool  `json:"podRestarts"`
	FailedScheduling bool  `json:"failedScheduling"`
	PendingThreshold int64 `json:"pendingThreshold"`
	StuckTerminating bool  `json:"stuckTerminating"`
}

PodAlertStatus represents the thresholds for alerting on Pods

type SMTPAlerterConfig

type SMTPAlerterConfig struct {
	Name           string `json:"name"`
	ToAddress      string `json:"toAddress"`
	FromAddress    string `json:"fromAddress"`
	MailServer     string `json:"mailServer"`
	Port           int    `json:"port"`
	Subject        string `json:"subject"`
	PasswordEnvVar string `json:"passwordEnvVar"`
}

SMTPAlerterConfig struct contains the data needed to trigger an SMTP alert

type SlackAlerterConfig

type SlackAlerterConfig struct {
	Name        string `json:"name"`
	WebhookURL  string `json:"webhookURL"`
	ProxyServer string `json:"proxyServer"`
}

SlackAlerterConfig configures a Slack Alerter

type WebhookAlertDetails

type WebhookAlertDetails struct {
	Subject string    `json:"subject"`
	Msg     string    `json:"message"`
	Time    time.Time `json:"time"`
}

WebhookAlertDetails contains the needed data to put into the body of a Webhook type alert

type WebhookAlerterConfig

type WebhookAlerterConfig struct {
	Name        string `json:"name"`
	Server      string `json:"server"`
	ProxyServer string `json:"proxyServer"`
	Subject     string `json:"subject"`
}

WebhookAlerterConfig struct contains the data needed to trigger an SMTP alert

Jump to

Keyboard shortcuts

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