config

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config allows to override some of the default settings from the exported default config package.

Index

Constants

This section is empty.

Variables

View Source
var (
	StunnerdImage       = "l7mp/stunnerd:latest"
	ConfigWatcherName   = "config-watcher"
	ConfigWatcherImage  = "kiwigrid/k8s-sidecar:latest"
	ConfigVolumeName    = "stunnerd-config-volume"
	TerminationGrace    = int64(3600)
	LivenessProbeAction = corev1.HTTPGetAction{
		Path:   "/live",
		Port:   apiutil.FromInt(stnrconfv1.DefaultHealthCheckPort),
		Scheme: "HTTP",
	}
	LivenessProbe = corev1.Probe{
		ProbeHandler:  corev1.ProbeHandler{HTTPGet: &LivenessProbeAction},
		PeriodSeconds: 15, SuccessThreshold: 1, FailureThreshold: 3, TimeoutSeconds: 1,
	}
	ReadinessProbeAction = corev1.HTTPGetAction{
		Path:   "/ready",
		Port:   apiutil.FromInt(stnrconfv1.DefaultHealthCheckPort),
		Scheme: "HTTP",
	}
	ReadinessProbe = corev1.Probe{
		ProbeHandler:  corev1.ProbeHandler{HTTPGet: &ReadinessProbeAction},
		PeriodSeconds: 15, SuccessThreshold: 1, FailureThreshold: 3, TimeoutSeconds: 1,
	}
	CPURequest      = resource.MustParse("250m")
	MemoryLimit     = resource.MustParse("20M")
	ResourceRequest = corev1.ResourceList(map[corev1.ResourceName]resource.Quantity{
		corev1.ResourceCPU: CPURequest,
	})
	ResourceLimit = corev1.ResourceList(map[corev1.ResourceName]resource.Quantity{
		corev1.ResourceMemory: MemoryLimit,
	})
)
View Source
var (
	// ControllerName is the current controller name which indicates this operator's name
	ControllerName = opdefault.DefaultControllerName

	// ConfigMapName names a ConfigMap the operator renders the stunnerd config file into
	ConfigMapName = opdefault.DefaultConfigMapName

	// EnableEndpointDiscovery enables EDS for finding the UDP-route backend endpoints
	EnableEndpointDiscovery = opdefault.DefaultEnableEndpointDiscovery

	// EnableRelayToClusterIP allows clients to create transport relay connections directly to
	// the ClusterIP of a Kubernetes service. This is useful for hiding the pod IPs behind the
	// ClusterIP. If both EnableEndpointDiscovery and EnableRelayToClusterIP are on, clients
	// can connect to both the ClusterIP and any direct pod IP.
	EnableRelayToClusterIP = opdefault.DefaultEnableRelayToClusterIP

	// ThrottleTimeout defines the amount of time to wait before initiating a new config render
	// process. This allows to rate-limit config renders in very large clusters or frequently
	// changing resources, where the config rendering process is too expensive to be run after
	// every CRUD operation on the object being watched by the operator. The larger the
	// throttle timeout the slower the controller and the smaller the operator CPU
	// consumption. Default is 250 msec.
	ThrottleTimeout = opdefault.DefaultThrottleTimeout

	// DataplaneMode is the "managed dataplane" mode. When set to "managed", the operator takes
	// care of providing the stunnerd pods for each Gateway. In "legacy" mode, the dataplanes
	// must be provided by the user.
	DataplaneMode = NewDataplaneMode(opdefault.DefaultDataplaneMode)

	// ConfigDiscoveryAddress is the default URI at which config discovery requests are served.
	ConfigDiscoveryAddress = stnrv1.DefaultConfigDiscoveryAddress
)

Functions

This section is empty.

Types

type DataplaneModeType added in v0.15.1

type DataplaneModeType int

DataplaneModeType species the type of the STUN/TURN authentication mechanism used by STUNner

const (
	DataplaneModeManaged DataplaneModeType = iota // default
	DataplaneModeLegacy
)

func NewDataplaneMode added in v0.15.1

func NewDataplaneMode(raw string) DataplaneModeType

NewDataplaneModeType parses the dataplane mode specification.

func (DataplaneModeType) String added in v0.15.1

func (a DataplaneModeType) String() string

String returns a string representation for the dataplane mode.

type ProgressReporter added in v0.18.0

type ProgressReporter interface {
	ProgressReport() int
}

ProgressReporter is a general interface ProgressTrackers must satisfy.

type ProgressTracker added in v0.18.0

type ProgressTracker struct {
	// contains filtered or unexported fields
}

ProgressTracker is an embeddable object that can track and report the number of ongoing operations for some parallel process. This can be used for implementing graceful shutdown.

func NewProgressTracker added in v0.18.0

func NewProgressTracker() *ProgressTracker

NewProgressTracker creates an empty progress tracker.

func (*ProgressTracker) ProgressReport added in v0.18.0

func (t *ProgressTracker) ProgressReport() int

ProgressReport returns the number of operations in progress.

func (*ProgressTracker) ProgressUpdate added in v0.18.0

func (t *ProgressTracker) ProgressUpdate(delta int)

Update can be used to increase or decrease (for negative delta) the progress counter.

type Server added in v0.17.0

type Server struct {
	*cdsserver.Server

	*ProgressTracker
	// contains filtered or unexported fields
}

func NewCDSServer added in v0.17.0

func NewCDSServer(addr string, logger logr.Logger) *Server

func (*Server) GetConfigUpdateChannel added in v0.17.0

func (c *Server) GetConfigUpdateChannel() chan event.Event

GetConfigUpdateChannel returns the channel on which the config discovery server listenens to update resuests.

func (*Server) ProcessUpdate added in v0.17.0

func (c *Server) ProcessUpdate(e *event.EventUpdate) error

ProcessUpdate processes new config events and updates the server with the current state-of-the-world.

func (*Server) Start added in v0.17.0

func (c *Server) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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