app

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppDescription = "Run your custom cluster-wide scripts in reaction to Kubernetes events or on schedule."
View Source
var AppName = "shell-operator"
View Source
var CommonFlagsInfo = map[string]FlagInfo{
	"hooks-dir": {
		"hooks-dir",
		"A path to a hooks file structure. Can be set with $SHELL_OPERATOR_HOOKS_DIR.",
		"SHELL_OPERATOR_HOOKS_DIR",
		true,
	},
	"tmp-dir": {
		"tmp-dir",
		"A path to store temporary files with data for hooks. Can be set with $SHELL_OPERATOR_TMP_DIR.",
		"SHELL_OPERATOR_TMP_DIR",
		true,
	},
	"listen-address": {
		"listen-address",
		"Address to use to serve metrics to Prometheus. Can be set with $SHELL_OPERATOR_LISTEN_ADDRESS.",
		"SHELL_OPERATOR_LISTEN_ADDRESS",
		true,
	},
	"listen-port": {
		"listen-port",
		"Port to use to serve metrics to Prometheus. Can be set with $SHELL_OPERATOR_LISTEN_PORT.",
		"SHELL_OPERATOR_LISTEN_PORT",
		true,
	},
	"prometheus-metrics-prefix": {
		"prometheus-metrics-prefix",
		"Prefix for Prometheus metrics. Can be set with $SHELL_OPERATOR_PROMETHEUS_METRICS_PREFIX.",
		"SHELL_OPERATOR_PROMETHEUS_METRICS_PREFIX",
		true,
	},
	"hook-metrics-listen-port": {
		"hook-metrics-listen-port",
		"Port to use to serve hooks’ custom metrics to Prometheus. Can be set with $SHELL_OPERATOR_HOOK_METRICS_LISTEN_PORT. Equal to listen-port if empty.",
		"SHELL_OPERATOR_HOOK_METRICS_LISTEN_PORT",
		true,
	},
	"namespace": {
		"namespace",
		"A namespace of a shell-operator. Used to setup validating webhooks. Can be set with $SHELL_OPERATOR_NAMESPACE.",
		"SHELL_OPERATOR_NAMESPACE",
		true,
	},
}
View Source
var DebugKeepTmpFiles = "no"
View Source
var DebugUnixSocket = "/var/run/shell-operator/debug.socket"
View Source
var HookMetricsListenPort = ""
View Source
var HooksDir = ""
View Source
var JqLibraryPath = ""
View Source
var KubeClientBurst int
View Source
var KubeClientBurstDefault = "10" // DefaultBurst from k8s.io/client-go/rest/config.go
View Source
var KubeClientQps float32
View Source
var KubeClientQpsDefault = "5" // DefaultQPS from k8s.io/client-go/rest/config.go
View Source
var KubeConfig = ""
View Source
var KubeContext = ""
View Source
var KubeServer = ""
View Source
var ListenAddress = "0.0.0.0"
View Source
var ListenPort = "9115"
View Source
var LogLevel = "info"

Use info level with timestamps and a text output by default

View Source
var LogNoTime = false
View Source
var LogType = "text"
View Source
var Namespace = ""
View Source
var PrometheusMetricsPrefix = "shell_operator_"
View Source
var TempDir = "/tmp/shell-operator"
View Source
var ValidatingWebhookSettings = &validatingWebhookSettings{
	ServerCertPath:    "/validating-certs/cert.crt",
	ServerKeyPath:     "/validating-certs/cert.key",
	CAPath:            "/validating-certs/ca.crt",
	ClientCAPaths:     nil,
	ServiceName:       "shell-operator-validating-svc",
	ConfigurationName: "shell-operator-hooks",
	ListenAddr:        "0.0.0.0",
	ListenPort:        "9680",
}
View Source
var Version = "dev"

Functions

func CommandWithDefaultUsageTemplate

func CommandWithDefaultUsageTemplate(kpApp *kingpin.Application, name, help string) *kingpin.CmdClause

CommandWithDefaultUsageTemplate is used to workaround an absence of per-command usage templates

func DefineDebugFlags

func DefineDebugFlags(kpApp *kingpin.Application, cmd *kingpin.CmdClause)

SetupDebugSettings init global flags for debug

func DefineDebugUnixSocketFlag

func DefineDebugUnixSocketFlag(cmd *kingpin.CmdClause)

func DefineJqFlags

func DefineJqFlags(cmd *kingpin.CmdClause)

DefineJqFlags set flag for jq library

func DefineKubeClientFlags

func DefineKubeClientFlags(cmd *kingpin.CmdClause)

func DefineLoggingFlags

func DefineLoggingFlags(cmd *kingpin.CmdClause)

SetupLoggingSettings init global flags for logging

func DefineStartCommandFlags

func DefineStartCommandFlags(kpApp *kingpin.Application, cmd *kingpin.CmdClause)

DefineStartCommandFlags set shell-operator flags for cmd

func DefineValidatingWebhookFlags

func DefineValidatingWebhookFlags(cmd *kingpin.CmdClause)

DefineValidatingWebhookFlags defines flags for ValidatingWebhook server.

func OperatorUsageTemplate

func OperatorUsageTemplate(appName string) string

func SetupLogging

func SetupLogging()

SetupLogging sets logging output

Types

type FlagInfo

type FlagInfo struct {
	Name   string
	Help   string
	Envar  string
	Define bool
}

Jump to

Keyboard shortcuts

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