Documentation ¶
Index ¶
- Constants
- type Button
- type Commands
- type Config
- type EventType
- type ExtraButtons
- type Filters
- type IngressRecommendations
- type KubernetesEvent
- type KubernetesResourceEventTypes
- type Level
- type PodRecommendations
- type Recommendations
- type RegexConstraints
- type Resource
- type Trigger
- type UpdateSetting
Constants ¶
const (
// AllNamespaceIndicator represents a keyword for allowing all Kubernetes Namespaces.
AllNamespaceIndicator = ".*"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ExtraButtons []ExtraButtons `yaml:"extraButtons"` InformerResyncPeriod time.Duration `yaml:"informerResyncPeriod"` Log config.Logger `yaml:"log"` Recommendations *Recommendations `yaml:"recommendations"` Event *KubernetesEvent `yaml:"event"` Resources []Resource `yaml:"resources" validate:"dive"` Commands Commands `yaml:"commands"` Namespaces *RegexConstraints `yaml:"namespaces"` Annotations *map[string]string `yaml:"annotations"` Labels *map[string]string `yaml:"labels"` Filters *Filters `yaml:"filters"` }
Config Kubernetes configuration
type EventType ¶
type EventType string
EventType to watch
const ( // CreateEvent when resource is created CreateEvent EventType = "create" // UpdateEvent when resource is updated UpdateEvent EventType = "update" // DeleteEvent when resource deleted DeleteEvent EventType = "delete" // ErrorEvent on errors in resources ErrorEvent EventType = "error" // WarningEvent for warning events WarningEvent EventType = "warning" // NormalEvent for Normal events NormalEvent EventType = "normal" // InfoEvent for insignificant Info events InfoEvent EventType = "info" // AllEvent to watch all events AllEvent EventType = "all" )
type ExtraButtons ¶ added in v1.2.0
type Filters ¶
type Filters struct { // ObjectAnnotationChecker enables support for `botkube.io/disable` resource annotation. ObjectAnnotationChecker bool `yaml:"objectAnnotationChecker"` // NodeEventsChecker filters out Node-related events that are not important. NodeEventsChecker bool `yaml:"nodeEventsChecker"` }
Filters contains configuration for built-in filters.
type IngressRecommendations ¶
type IngressRecommendations struct { // BackendServiceValid notifies about Ingress resources with invalid backend service reference. BackendServiceValid *bool `yaml:"backendServiceValid,omitempty"` // TLSSecretValid notifies about Ingress resources with invalid TLS secret reference. TLSSecretValid *bool `yaml:"tlsSecretValid,omitempty"` }
IngressRecommendations contains configuration for ingress recommendations.
type KubernetesEvent ¶
type KubernetesEvent struct { Reason RegexConstraints `yaml:"reason"` Message RegexConstraints `yaml:"message"` Types KubernetesResourceEventTypes `yaml:"types"` }
KubernetesEvent contains configuration for Kubernetes events.
func (KubernetesEvent) AreConstraintsDefined ¶
func (e KubernetesEvent) AreConstraintsDefined() bool
AreConstraintsDefined checks if any of the event constraints are defined.
type KubernetesResourceEventTypes ¶
type KubernetesResourceEventTypes []EventType
KubernetesResourceEventTypes contains events to watch for a resource.
type PodRecommendations ¶
type PodRecommendations struct { // NoLatestImageTag notifies about Pod containers that use `latest` tag for images. NoLatestImageTag *bool `yaml:"noLatestImageTag,omitempty"` // LabelsSet notifies about Pod resources created without labels. LabelsSet *bool `yaml:"labelsSet,omitempty"` }
PodRecommendations contains configuration for pods recommendations.
type Recommendations ¶
type Recommendations struct { Ingress IngressRecommendations `yaml:"ingress"` Pod PodRecommendations `yaml:"pod"` }
Recommendations contains configuration for various recommendation insights.
type RegexConstraints ¶
type RegexConstraints struct { // Include contains a list of allowed values. // It can also contain a regex expressions: // - ".*" - to specify all values. Include []string `yaml:"include"` // Exclude contains a list of values to be ignored even if allowed by Include. // It can also contain a regex expressions: // - "test-.*" - to specify all values with `test-` prefix. Exclude []string `yaml:"exclude,omitempty"` }
RegexConstraints contains a list of allowed and excluded values.
func (*RegexConstraints) AreConstraintsDefined ¶
func (r *RegexConstraints) AreConstraintsDefined() bool
AreConstraintsDefined checks whether the RegexConstraints has any Include/Exclude configuration.
type Resource ¶
type Resource struct { Type string `yaml:"type"` Name RegexConstraints `yaml:"name"` Namespaces RegexConstraints `yaml:"namespaces"` Annotations map[string]string `yaml:"annotations"` Labels map[string]string `yaml:"labels"` Event KubernetesEvent `yaml:"event"` UpdateSetting UpdateSetting `yaml:"updateSetting"` }
Resource contains resources to watch
type UpdateSetting ¶
UpdateSetting struct defines updateEvent fields specification