Documentation
¶
Index ¶
- Constants
- func ApplyBootstrapConfig(boostrapConfig *egv1a1.ProxyBootstrap, defaultBootstrap string) (string, error)
- func GetCgroupMemoryLimit() uint64
- func GetDefaultMaxHeapSizeBytes() *uint64
- func GetRenderedBootstrapConfig(opts ...BootstrapOption) (string, error)
- type BootstrapConfig
- type BootstrapOption
- func WithOverloadMaxActiveConnections(count uint64) BootstrapOption
- func WithOverloadMaxHeapSizeBytes(size uint64) BootstrapOption
- func WithXdsServerHost(host string) BootstrapOption
- func WithXdsServerPort(port int32) BootstrapOption
- func WithXdsTLS() BootstrapOption
- func WithXdsTLSCAPath(caPath string) BootstrapOption
- type CgroupMemoryDetector
- type DefaultFileReader
- type FileReader
- type MemoryDetector
- type OverloadManagerParameters
- type StatsMatcherParameters
Constants ¶
const ( // EnvoyAdminAddress is the listening address of the envoy admin interface. EnvoyAdminAddress = "127.0.0.1" // EnvoyAdminPort is the port used to expose admin interface. EnvoyAdminPort = 19000 // DefaultXdsServerPort is the default listening port of the xds-server. DefaultXdsServerPort = 18000 // DefaultTLSCAPath is the default path to system CA certificates. DefaultTLSCAPath = "/etc/ssl/certs/ca-certificates.crt" EnvoyReadinessPort = 19001 EnvoyReadinessPath = "/ready" )
Variables ¶
This section is empty.
Functions ¶
func ApplyBootstrapConfig ¶
func ApplyBootstrapConfig(boostrapConfig *egv1a1.ProxyBootstrap, defaultBootstrap string) (string, error)
ApplyBootstrapConfig applies the bootstrap config to the default bootstrap config and return the result config.
func GetCgroupMemoryLimit ¶
func GetCgroupMemoryLimit() uint64
GetCgroupMemoryLimit returns the cgroup memory limit using the default detector
func GetDefaultMaxHeapSizeBytes ¶
func GetDefaultMaxHeapSizeBytes() *uint64
GetDefaultMaxHeapSizeBytes returns the default max heap size in bytes based on cgroup memory limit
func GetRenderedBootstrapConfig ¶
func GetRenderedBootstrapConfig(opts ...BootstrapOption) (string, error)
GetRenderedBootstrapConfig renders the bootstrap YAML string.
Types ¶
type BootstrapConfig ¶
type BootstrapConfig struct {
// XdsServerHost is the DNS name of the Xds Server within Envoy Gateway.
XdsServerHost string
// XdsServerPort is the port of the Xds Server within Envoy Gateway.
XdsServerPort int32
// XdsTLSCAPath enables TLS for the xDS server connection using the CA certificate at this path.
// Empty string disables TLS.
XdsTLSCAPath string
// OverloadMaxHeapSizeBytes defines the maximum heap size in bytes for the Envoy overload manager.
OverloadMaxHeapSizeBytes *uint64
// OverloadMaxActiveDownstreamConnections defines the maximum number of active downstream connections for the Envoy overload manager.
OverloadMaxActiveDownstreamConnections *uint64
}
type BootstrapOption ¶
type BootstrapOption func(*BootstrapConfig)
BootstrapOption defines the functional option to configure the bootstrap configuration.
func WithOverloadMaxActiveConnections ¶
func WithOverloadMaxActiveConnections(count uint64) BootstrapOption
WithOverloadMaxActiveConnections sets the maximum number of active downstream connections for the Envoy overload manager.
func WithOverloadMaxHeapSizeBytes ¶
func WithOverloadMaxHeapSizeBytes(size uint64) BootstrapOption
WithOverloadMaxHeapSizeBytes sets the maximum heap size in bytes for the Envoy overload manager.
func WithXdsServerHost ¶
func WithXdsServerHost(host string) BootstrapOption
WithXdsServerHost sets the Xds Server host.
func WithXdsServerPort ¶
func WithXdsServerPort(port int32) BootstrapOption
WithXdsServerPort sets the Xds Server port. The default port is 18000.
func WithXdsTLS ¶
func WithXdsTLS() BootstrapOption
WithXdsTLS enables TLS for the xDS server connection using system CA certificates.
func WithXdsTLSCAPath ¶
func WithXdsTLSCAPath(caPath string) BootstrapOption
WithXdsTLSCAPath enables TLS for the xDS server connection using the CA certificate at the given path.
type CgroupMemoryDetector ¶
type CgroupMemoryDetector struct {
// contains filtered or unexported fields
}
CgroupMemoryDetector detects cgroup memory limits
func NewCgroupMemoryDetector ¶
func NewCgroupMemoryDetector() *CgroupMemoryDetector
NewCgroupMemoryDetector creates a new CgroupMemoryDetector with default paths
func (*CgroupMemoryDetector) GetDefaultMaxHeapSizeBytes ¶
func (d *CgroupMemoryDetector) GetDefaultMaxHeapSizeBytes() *uint64
GetDefaultMaxHeapSizeBytes returns the default max heap size in bytes based on cgroup memory limit
func (*CgroupMemoryDetector) GetMemoryLimit ¶
func (d *CgroupMemoryDetector) GetMemoryLimit() uint64
GetMemoryLimit returns the cgroup memory limit in bytes. It tries to detect both cgroup v1 and v2 memory limits. If no limit is found, it returns 0.
type DefaultFileReader ¶
type DefaultFileReader struct{}
DefaultFileReader is the default implementation of FileReader
type FileReader ¶
type FileReader interface {
ReadFile(filename string) ([]byte, error)
Open(name string) (*os.File, error)
}
FileReader is an interface for reading files, used for testing
type MemoryDetector ¶
MemoryDetector is an interface for memory limit detection