kumadp

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = func() Config {
	return Config{
		ControlPlane: ControlPlane{
			URL: "https://localhost:5678",
			Retry: CpRetry{
				Backoff:     3 * time.Second,
				MaxDuration: 5 * time.Minute,
			},
		},
		Dataplane: Dataplane{
			Mesh:      "",
			Name:      "",
			DrainTime: 30 * time.Second,
			ProxyType: "dataplane",
		},
		DataplaneRuntime: DataplaneRuntime{
			BinaryPath: "envoy",
			ConfigDir:  "",
		},
		DNS: DNS{
			Enabled:                   true,
			CoreDNSPort:               15053,
			EnvoyDNSPort:              15054,
			CoreDNSEmptyPort:          15055,
			CoreDNSBinaryPath:         "coredns",
			CoreDNSConfigTemplatePath: "",
			ConfigDir:                 "",
			PrometheusPort:            19153,
		},
	}
}

Functions

func PrintDeprecations added in v1.8.1

func PrintDeprecations(cfg *Config, out io.Writer)

Types

type ApiServer

type ApiServer struct {
	// Address defines the address of Control Plane API server.
	URL string `yaml:"url,omitempty" envconfig:"kuma_control_plane_api_server_url"`
	// Retry settings for API Server
	Retry CpRetry `yaml:"retry,omitempty"`
}

func (*ApiServer) Sanitize

func (d *ApiServer) Sanitize()

func (*ApiServer) Validate

func (d *ApiServer) Validate() (errs error)

type Config

type Config struct {
	// ControlPlane defines coordinates of the Kuma Control Plane.
	ControlPlane ControlPlane `yaml:"controlPlane,omitempty"`
	// Dataplane defines bootstrap configuration of the dataplane (Envoy).
	Dataplane Dataplane `yaml:"dataplane,omitempty"`
	// DataplaneRuntime defines the context in which dataplane (Envoy) runs.
	DataplaneRuntime DataplaneRuntime `yaml:"dataplaneRuntime,omitempty"`
	// DNS defines a configuration for builtin DNS in Kuma DP
	DNS DNS `yaml:"dns,omitempty"`
}

Config defines configuration of the Kuma Dataplane Manager.

func (*Config) Sanitize

func (c *Config) Sanitize()

func (*Config) Validate

func (c *Config) Validate() (errs error)

type ControlPlane

type ControlPlane struct {
	// URL defines the address of Control Plane DP server.
	URL string `yaml:"url,omitempty" envconfig:"kuma_control_plane_url"`
	// Retry settings for Control Plane communication
	Retry CpRetry `yaml:"retry,omitempty"`
	// CaCert defines Certificate Authority that will be used to verify connection to the Control Plane. It takes precedence over CaCertFile.
	CaCert string `yaml:"caCert" envconfig:"kuma_control_plane_ca_cert"`
	// CaCertFile defines a file for Certificate Authority that will be used to verifiy connection to the Control Plane.
	CaCertFile string `yaml:"caCertFile" envconfig:"kuma_control_plane_ca_cert_file"`
}

ControlPlane defines coordinates of the Control Plane.

func (*ControlPlane) Sanitize

func (c *ControlPlane) Sanitize()

func (*ControlPlane) Validate

func (c *ControlPlane) Validate() (errs error)

type CpRetry

type CpRetry struct {
	// Duration to wait between retries
	Backoff time.Duration `yaml:"backoff,omitempty" envconfig:"kuma_control_plane_retry_backoff"`
	// Max duration for retries (this is not exact time for execution, the check is done between retries)
	MaxDuration time.Duration `yaml:"maxDuration,omitempty" envconfig:"kuma_control_plane_retry_max_duration"`
}

func (*CpRetry) Sanitize

func (a *CpRetry) Sanitize()

func (*CpRetry) Validate

func (a *CpRetry) Validate() error

type DNS

type DNS struct {
	// If true then builtin DNS functionality is enabled and CoreDNS server is started
	Enabled bool `yaml:"enabled,omitempty" envconfig:"kuma_dns_enabled"`
	// CoreDNSPort defines a port that handles DNS requests. When transparent proxy is enabled then iptables will redirect DNS traffic to this port.
	CoreDNSPort uint32 `yaml:"coreDnsPort,omitempty" envconfig:"kuma_dns_core_dns_port"`
	// CoreDNSEmptyPort defines a port that always responds with empty NXDOMAIN respond. It is required to implement a fallback to a real DNS
	CoreDNSEmptyPort uint32 `yaml:"coreDnsEmptyPort,omitempty" envconfig:"kuma_dns_core_dns_empty_port"`
	// EnvoyDNSPort defines a port that handles Virtual IP resolving by Envoy. CoreDNS should be configured that it first tries to use this DNS resolver and then the real one.
	EnvoyDNSPort uint32 `yaml:"envoyDnsPort,omitempty" envconfig:"kuma_dns_envoy_dns_port"`
	// CoreDNSBinaryPath defines a path to CoreDNS binary.
	CoreDNSBinaryPath string `yaml:"coreDnsBinaryPath,omitempty" envconfig:"kuma_dns_core_dns_binary_path"`
	// CoreDNSConfigTemplatePath defines a path to a CoreDNS config template.
	CoreDNSConfigTemplatePath string `yaml:"coreDnsConfigTemplatePath,omitempty" envconfig:"kuma_dns_core_dns_config_template_path"`
	// Dir to store auto-generated DNS Server config in.
	ConfigDir string `yaml:"configDir,omitempty" envconfig:"kuma_dns_config_dir"`
	// Port where Prometheus stats will be exposed for the DNS Server
	PrometheusPort uint32 `yaml:"prometheusPort,omitempty" envconfig:"kuma_dns_prometheus_port"`
}

func (*DNS) Sanitize

func (d *DNS) Sanitize()

func (*DNS) Validate

func (d *DNS) Validate() error

type Dataplane

type Dataplane struct {
	// Mesh name.
	Mesh string `yaml:"mesh,omitempty" envconfig:"kuma_dataplane_mesh"`
	// Dataplane name.
	Name string `yaml:"name,omitempty" envconfig:"kuma_dataplane_name"`
	// ProxyType defines mode which should be used, supported values: 'dataplane', 'ingress'
	ProxyType string `yaml:"proxyType,omitempty" envconfig:"kuma_dataplane_proxy_type"`
	// Drain time for listeners.
	DrainTime time.Duration `yaml:"drainTime,omitempty" envconfig:"kuma_dataplane_drain_time"`
}

Dataplane defines bootstrap configuration of the dataplane (Envoy).

func (*Dataplane) Sanitize

func (d *Dataplane) Sanitize()

func (*Dataplane) Validate

func (d *Dataplane) Validate() (errs error)

func (*Dataplane) ValidateForTemplate

func (d *Dataplane) ValidateForTemplate() (errs error)

type DataplaneResources added in v1.8.1

type DataplaneResources struct {
	MaxMemoryBytes uint64 `yaml:"maxMemoryBytes,omitempty" envconfig:"kuma_dataplane_resources_max_memory_bytes"`
}

DataplaneResources defines the resources available to a dataplane proxy.

type DataplaneRuntime

type DataplaneRuntime struct {
	// Path to Envoy binary.
	BinaryPath string `yaml:"binaryPath,omitempty" envconfig:"kuma_dataplane_runtime_binary_path"`
	// Dir to store auto-generated Envoy bootstrap config in.
	ConfigDir string `yaml:"configDir,omitempty" envconfig:"kuma_dataplane_runtime_config_dir"`
	// Concurrency specifies how to generate the Envoy concurrency flag.
	Concurrency uint32 `yaml:"concurrency,omitempty" envconfig:"kuma_dataplane_runtime_concurrency"`
	// Path to a file with dataplane token (use 'kumactl generate dataplane-token' to get one)
	TokenPath string `yaml:"dataplaneTokenPath,omitempty" envconfig:"kuma_dataplane_runtime_token_path"`
	// Token is dataplane token's value provided directly, will be stored to a temporary file before applying
	Token string `yaml:"dataplaneToken,omitempty" envconfig:"kuma_dataplane_runtime_token"`
	// Resource is a Dataplane resource that will be applied on Kuma CP
	Resource string `yaml:"resource,omitempty" envconfig:"kuma_dataplane_runtime_resource"`
	// ResourcePath is a path to Dataplane resource that will be applied on Kuma CP
	ResourcePath string `yaml:"resourcePath,omitempty" envconfig:"kuma_dataplane_runtime_resource_path"`
	// ResourceVars are the StringToString values that can fill the Resource template
	ResourceVars map[string]string `yaml:"resourceVars,omitempty"`
	// EnvoyLogLevel is a level on which Envoy will log.
	// Available values are: [trace][debug][info][warning|warn][error][critical][off]
	// By default it inherits Kuma DP logging level.
	EnvoyLogLevel string `yaml:"envoyLogLevel,omitempty" envconfig:"kuma_dataplane_runtime_envoy_log_level"`
	// Resources defines the resources for this proxy.
	Resources DataplaneResources `yaml:"resources,omitempty"`
}

DataplaneRuntime defines the context in which dataplane (Envoy) runs.

func (*DataplaneRuntime) Sanitize

func (d *DataplaneRuntime) Sanitize()

func (*DataplaneRuntime) Validate

func (d *DataplaneRuntime) Validate() (errs error)

Jump to

Keyboard shortcuts

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