cmd

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithSignal

func ContextWithSignal(ctx context.Context) context.Context

ContextWithSignal creates a context canceled when SIGINT or SIGTERM are notified.

func ContextWithStopChan

func ContextWithStopChan(ctx context.Context, stopCh <-chan struct{}) context.Context

ContextWithStopChan creates a context canceled when the given stopCh receives a message or get closed.

func NewLogger

func NewLogger(format, level string, debug bool) (logrus.FieldLogger, error)

NewLogger returns a new field logger with the provided format, level, and debug configurations.

Types

type CleanupConfiguration

type CleanupConfiguration struct {
	ConfigFile string `description:"Configuration file to use. If specified all other flags are ignored." export:"true"`
	KubeConfig string `description:"Path to a kubeconfig. Only required if out-of-cluster." export:"true"`
	MasterURL  string `` /* 137-byte string literal not displayed */
	Namespace  string `description:"The namespace that Traefik Mesh is installed in." export:"true"`
	LogLevel   string `description:"The log level." export:"true"`
	LogFormat  string `description:"The log format." export:"true"`
}

CleanupConfiguration holds the configuration for the cleanup command.

func NewCleanupConfiguration

func NewCleanupConfiguration() *CleanupConfiguration

NewCleanupConfiguration creates CleanupConfiguration.

type EnvLoader

type EnvLoader struct{}

EnvLoader loads a configuration from all the environment variables.

func (*EnvLoader) Load

func (e *EnvLoader) Load(_ []string, cmd *cli.Command) (bool, error)

Load loads the command's configuration from the environment variables prefixed with "TRAEFIK_MESH_" or "MAESH_". The "MAESH_" prefix is deprecated and will be removed in the next major release. If "TRAEFIK_MESH_" and "MAESH_" env variables are mixed up an error is returned. As it is not possible to have a prefix with multiple "_" everything is normalized to "MESH_" under the hood for the decoding.

type FileLoader

type FileLoader struct{}

FileLoader loads a configuration from a file.

func (*FileLoader) Load

func (f *FileLoader) Load(args []string, cmd *cli.Command) (bool, error)

Load loads the command's configuration from a file either specified with the --configFile flag, or from default locations.

type PrepareConfiguration

type PrepareConfiguration struct {
	ConfigFile    string `description:"Configuration file to use. If specified all other flags are ignored." export:"true"`
	KubeConfig    string `description:"Path to a kubeconfig. Only required if out-of-cluster." export:"true"`
	MasterURL     string `` /* 137-byte string literal not displayed */
	LogLevel      string `description:"The log level." export:"true"`
	LogFormat     string `description:"The log format." export:"true"`
	Debug         bool   `description:"Debug mode, deprecated, use --loglevel=debug instead." export:"true"`
	Namespace     string `description:"The namespace that Traefik Mesh is installed in." export:"true"`
	ClusterDomain string `description:"Your internal K8s cluster domain." export:"true"`
	SMI           bool   `description:"Enable SMI operation, deprecated, use --acl instead." export:"true"`
	ACL           bool   `description:"Enable ACL mode." export:"true"`
}

PrepareConfiguration holds the configuration to prepare the cluster.

func NewPrepareConfiguration

func NewPrepareConfiguration() *PrepareConfiguration

NewPrepareConfiguration creates a PrepareConfiguration with default values.

type TraefikMeshConfiguration

type TraefikMeshConfiguration struct {
	ConfigFile       string   `description:"Configuration file to use. If specified all other flags are ignored." export:"true"`
	KubeConfig       string   `description:"Path to a kubeconfig. Only required if out-of-cluster." export:"true"`
	MasterURL        string   `` /* 137-byte string literal not displayed */
	LogLevel         string   `description:"The log level." export:"true"`
	LogFormat        string   `description:"The log format." export:"true"`
	Debug            bool     `description:"Debug mode, deprecated, use --loglevel=debug instead." export:"true"`
	ACL              bool     `description:"Enable ACL mode." export:"true"`
	SMI              bool     `description:"Enable SMI operation, deprecated, use --acl instead." export:"true"`
	DefaultMode      string   `description:"Default mode for mesh services." export:"true"`
	Namespace        string   `description:"The namespace that Traefik Mesh is installed in." export:"true"`
	WatchNamespaces  []string `description:"Namespaces to watch." export:"true"`
	IgnoreNamespaces []string `description:"Namespaces to ignore." export:"true"`
	APIPort          int32    `description:"API port for the controller." export:"true"`
	APIHost          string   `description:"API host for the controller to bind to." export:"true"`
	LimitHTTPPort    int32    `description:"Number of HTTP ports allocated." export:"true"`
	LimitTCPPort     int32    `description:"Number of TCP ports allocated." export:"true"`
	LimitUDPPort     int32    `description:"Number of UDP ports allocated." export:"true"`
}

TraefikMeshConfiguration wraps the static configuration and extra parameters.

func NewTraefikMeshConfiguration

func NewTraefikMeshConfiguration() *TraefikMeshConfiguration

NewTraefikMeshConfiguration creates a TraefikMeshConfiguration with default values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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