config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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"
	// ShortNotify is the Default NotifType
	ShortNotify NotifType = "short"
	// LongNotify for short events notification
	LongNotify NotifType = "long"

	// Info level
	Info Level = "info"
	// Warn level
	Warn Level = "warn"
	// Debug level
	Debug Level = "debug"
	// Error level
	Error Level = "error"
	// Critical level
	Critical Level = "critical"

	// SlackBot bot platform
	SlackBot BotPlatform = "slack"
	// MattermostBot bot platform
	MattermostBot BotPlatform = "mattermost"
	// TeamsBot bot platform
	TeamsBot BotPlatform = "teams"
)

Variables

View Source
var CommunicationConfigFileName = "comm_config.yaml"

CommunicationConfigFileName is a name of botkube communication configuration file

View Source
var Notify = true

Notify flag to toggle event notification

View Source
var ResourceConfigFileName = "resource_config.yaml"

ResourceConfigFileName is a name of botkube resource configuration file

Functions

This section is empty.

Types

type AWSSigning added in v0.11.0

type AWSSigning struct {
	Enabled   bool
	AWSRegion string `yaml:"awsRegion"`
	RoleArn   string `yaml:"roleArn"`
}

AWSSigning contains AWS configurations

type BotPlatform added in v0.11.0

type BotPlatform string

BotPlatform supported by BotKube

type Commands added in v0.11.0

type Commands struct {
	Verbs     []string
	Resources []string
}

Commands allowed in bot

type Communications

type Communications struct {
	Communications CommunicationsConfig
}

Communications contains communication config

func NewCommunicationsConfig added in v0.11.0

func NewCommunicationsConfig() (*Communications, error)

NewCommunicationsConfig return new communication config object

type CommunicationsConfig added in v0.11.0

type CommunicationsConfig struct {
	Slack         Slack
	Mattermost    Mattermost
	Webhook       Webhook
	Teams         Teams
	ElasticSearch ElasticSearch
}

CommunicationsConfig channels to send events to

type Config

type Config struct {
	Resources       []Resource
	Recommendations bool
	Communications  CommunicationsConfig
	Settings        Settings
}

Config structure of configuration yaml file

func New

func New() (*Config, error)

New returns new Config

type ElasticSearch added in v0.7.0

type ElasticSearch struct {
	Enabled    bool
	Username   string
	Password   string `yaml:",omitempty"`
	Server     string
	AWSSigning AWSSigning `yaml:"awsSigning"`
	Index      Index
}

ElasticSearch config auth settings

type EventType added in v0.8.0

type EventType string

EventType to watch

func (EventType) String added in v0.8.0

func (eventType EventType) String() string

type Index added in v0.7.0

type Index struct {
	Name     string
	Type     string
	Shards   int
	Replicas int
}

Index settings for ELS

type Kubectl added in v0.11.0

type Kubectl struct {
	Enabled          bool
	Commands         Commands
	DefaultNamespace string
	RestrictAccess   bool `yaml:"restrictAccess"`
}

Kubectl configuration for executing commands inside cluster

type Level added in v0.11.0

type Level string

Level type to store event levels

type Mattermost added in v0.7.0

type Mattermost struct {
	Enabled   bool
	URL       string
	Token     string
	Team      string
	Channel   string
	NotifType NotifType `yaml:",omitempty"`
}

Mattermost configuration to authentication and send notifications

type Namespaces added in v0.9.0

type Namespaces struct {
	Include []string
	Ignore  []string `yaml:",omitempty"`
}

Namespaces contains namespaces to include and ignore Include contains a list of namespaces to be watched,

  • "all" to watch all the namespaces

Ignore contains a list of namespaces to be ignored when all namespaces are included It is an optional (omitempty) field which is tandem with Include [all] example : include [all], ignore [x,y,z]

type NotifType added in v0.9.0

type NotifType string

NotifType to change notification type

type Resource

type Resource struct {
	Name          string
	Namespaces    Namespaces
	Events        []EventType
	UpdateSetting UpdateSetting `yaml:"updateSetting"`
}

Resource contains resources to watch

type Settings added in v0.2.0

type Settings struct {
	ClusterName     string
	Kubectl         Kubectl
	ConfigWatcher   bool
	UpgradeNotifier bool `yaml:"upgradeNotifier"`
}

Settings for multicluster support

type Slack

type Slack struct {
	Enabled   bool
	Channel   string
	NotifType NotifType `yaml:",omitempty"`
	Token     string    `yaml:",omitempty"`
}

Slack configuration to authentication and send notifications

type Teams added in v0.11.0

type Teams struct {
	Enabled     bool
	AppID       string `yaml:"appID,omitempty"`
	AppPassword string `yaml:"appPassword,omitempty"`
	Team        string
	Port        string
	MessagePath string
	NotifType   NotifType `yaml:",omitempty"`
}

Teams creds for authentication with MS Teams

type UpdateSetting added in v0.10.0

type UpdateSetting struct {
	Fields      []string
	IncludeDiff bool `yaml:"includeDiff"`
}

UpdateSetting struct defines updateEvent fields specification

type Webhook added in v0.9.0

type Webhook struct {
	Enabled bool
	URL     string
}

Webhook configuration to send notifications

Jump to

Keyboard shortcuts

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