config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Flags = []cli.Flag{
	&cli.BoolFlag{
		Name:     "verbose",
		Aliases:  []string{"vv"},
		Usage:    "Verbose logging",
		Required: false,
		Value:    false,
	},
	&cli.Int64Flag{
		Name:     "logs-tail",
		Usage:    "Specifies the logs tail length when reporting logs from a problematic pod",
		Value:    250,
		Required: false,
	},
	&cli.Int64Flag{
		Name:     "events-limit",
		Usage:    "Maximum number of namespace events to fetch",
		Value:    150,
		Required: false,
	},
	&cli.StringFlag{
		Name:     "kubeconfig",
		Aliases:  []string{"k"},
		Usage:    "kubeconfig file path, defaults to env var KUBECONFIG or ~/.kube/config",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "time-format",
		Aliases:  []string{"f"},
		Value:    time.RFC822,
		Usage:    "timestamp print format",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "locale",
		Aliases:  []string{"l"},
		Value:    "UTC",
		Usage:    "timestamp print localization",
		Required: false,
	},
	&cli.Float64Flag{
		Name:     "pod-creation-grace-sec",
		Value:    30,
		Usage:    "grace period in seconds since pod creation",
		Required: false,
	},
	&cli.Int64Flag{
		Name:     "pod-termination-grace-sec",
		Value:    30,
		Usage:    "grace period in seconds since pod termination",
		Required: false,
	},
	&cli.IntFlag{
		Name:     "pod-restart-grace-count",
		Value:    3,
		Usage:    "grace count for pod restarts",
		Required: false,
	},
	&cli.Float64Flag{
		Name:     "node-resource-usage-threshold",
		Value:    0.85,
		Usage:    "node resources usage threshold",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "exclude-ns",
		Aliases:  []string{"e"},
		Value:    "",
		Usage:    "namespaces to skip",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "include-ns",
		Aliases:  []string{"i"},
		Value:    "",
		Usage:    "namespaces to include (will skip any not listed if this option is used)",
		Required: false,
	},
	&cli.IntFlag{
		Name:     "dedup-minutes",
		Aliases:  []string{"d"},
		Value:    60,
		Usage:    "time in minutes to silence duplicate or already observed alerts, or 0 to disable deduplication",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "store-filepath",
		Aliases:  []string{"s"},
		Value:    "kube-scout.store.json",
		Usage:    "path to store file where state will be persisted or empty string to disable persistency",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "output",
		Aliases:  []string{"o"},
		Value:    "pretty",
		Usage:    "output mode, one of pretty/json/yaml/discard",
		Required: false,
	},
	&cli.IntFlag{
		Name:     "iterations",
		Aliases:  []string{"it"},
		Value:    3,
		Usage:    "number of diag iterations, meant to better capture constantly changing states",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "context",
		Aliases:  []string{"c"},
		Value:    "",
		Usage:    "context name to use from kubeconfig, defaults to current context",
		Required: false,
	},
	&cli.BoolFlag{
		Name:     "all-contexts",
		Aliases:  []string{"a"},
		Value:    false,
		Usage:    "iterate all kubeconfig contexts, 'context' flag will be ignored if this flag is set",
		Required: false,
	},
	&cli.StringFlag{
		Name:     "exclude-contexts",
		Value:    "",
		Usage:    "a comma separated list of kubeconfig context names to skip, only relevant if 'all-contexts' flag is set",
		Required: false,
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	PodLogsTail                      int64
	EventsLimit                      int64
	KubeconfigFilePath               string
	TimeFormat                       string
	Locale                           *time.Location
	PodCreationGracePeriodSeconds    float64
	PodTerminationGracePeriodSeconds int64
	PodRestartGraceCount             int32
	NodeResourceUsageThreshold       float64
	ExcludeNamespaces                []string
	IncludeNamespaces                []string
	MessagesDeduplicationDuration    time.Duration
	StoreFilePath                    string
	OutputMode                       string
	Iterations                       int
	ContextName                      string
	AllContexts                      bool
	ExcludeContexts                  []string
}

func DefaultConfig

func DefaultConfig() (*Config, error)

func FromArgs

func FromArgs(args []string) (config *Config, err error)

func ParseConfig

func ParseConfig(c *cli.Context) (*Config, error)

func (*Config) DefaultSink added in v0.1.5

func (config *Config) DefaultSink() sink.Sink

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳