envoy

package
v0.20.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultAccessLogFormat = map[string]interface{}{
		"bytes_received":            "%BYTES_RECEIVED%",
		"bytes_sent":                "%BYTES_SENT%",
		"downstream_local_address":  "%DOWNSTREAM_LOCAL_ADDRESS%",
		"downstream_remote_address": "%DOWNSTREAM_REMOTE_ADDRESS%",
		"duration":                  "%DURATION%",
		"forwarded_for":             "%REQ(X-FORWARDED-FOR)%",
		"protocol":                  "%PROTOCOL%",
		"request_id":                "%REQ(X-REQUEST-ID)%",
		"request_method":            "%REQ(:METHOD)%",
		"request_path":              "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%",
		"response_code":             "%RESPONSE_CODE%",
		"response_flags":            "%RESPONSE_FLAGS%",
		"start_time":                "%START_TIME(%s.%3f)%",
		"upstream_cluster":          "%UPSTREAM_CLUSTER%",
		"upstream_host":             "%UPSTREAM_HOST%",
		"upstream_local_address":    "%UPSTREAM_LOCAL_ADDRESS%",
		"upstream_service_time":     "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%",
		"user_agent":                "%REQ(USER-AGENT)%",
	}
)

Functions

func ClustersEquals

func ClustersEquals(a, b []*cluster) bool

func ValidateEnvoyRetryOn added in v0.16.0

func ValidateEnvoyRetryOn(retryOn string) bool

func VirtualHostsEquals

func VirtualHostsEquals(a, b []*virtualHost) bool

func WithAccessLog added in v0.19.0

func WithAccessLog(accessLogger AccessLogger) option

WithAccessLog configures the access log formats

func WithDefaultRetryOn added in v0.16.0

func WithDefaultRetryOn(defaultRetryOn string) option

WithDefaultRetryOn configures the default retry policy

func WithEnvoyListenerIpv4Address added in v0.14.0

func WithEnvoyListenerIpv4Address(address string) option

WithEWithEnvoyListenerIpv4AddressnvoyPort configures envoy IPv4 listen address into a KubernetesConfigurator

func WithEnvoyPort

func WithEnvoyPort(port uint32) option

WithEnvoyPort configures the given envoy port into a KubernetesConfigurator

func WithHostSelectionRetryAttempts

func WithHostSelectionRetryAttempts(attempts int64) option

WithHostSelectionRetryAttempts configures number of host selection reattempts into a KubernetesConfigurator

func WithHttpExtAuthzCluster added in v0.15.0

func WithHttpExtAuthzCluster(httpExtAuthz HttpExtAuthz) option

WithHttpExtAuthzCluster configures the options for the gRPC cluster

func WithHttpGrpcLogger added in v0.15.0

func WithHttpGrpcLogger(httpGrpcLogger HttpGrpcLogger) option

WithHttpGrpcLogger configures the options for the gPRC access logger

func WithOutlierPercentage

func WithOutlierPercentage(percentage int32) option

WithOutlierPercentage configures the given percentage as maximal outlier percentage into a KubernetesConfigurator

func WithSyncSecrets added in v0.19.1

func WithSyncSecrets(syncSecrets bool) option

WithSyncSecrets configures the syncSecrets option

func WithTracingProvider added in v0.20.0

func WithTracingProvider(tracingProvider string) option

WithTracingProvider configures the tracing provider for HTTP connection manager

func WithUpstreamHealthCheck

func WithUpstreamHealthCheck(config UpstreamHealthCheck) option

WithUpstreamHealthCheck configures the upstream health check into the KubernetesConfigurator

func WithUpstreamPort

func WithUpstreamPort(port uint32) option

WithUpstreamPort configures the given upstream port into a KubernetesConfigurator

func WithUseRemoteAddress added in v0.14.0

func WithUseRemoteAddress(useRemoteAddress bool) option

WithUseRemoteAddress configures the useRemoteAddress option into the KubernetesConfigurator

Types

type AccessLogger added in v0.19.0

type AccessLogger struct {
	Format map[string]interface{} `json:"format"`
}

type Certificate

type Certificate struct {
	Hosts []string `json:"hosts"`
	Cert  string   `json:"cert"`
	Key   string   `json:"key"`
}

type Configurator

type Configurator interface {
	Generate([]*k8s.Ingress, []*v1.Secret) (cache.Snapshot, error)
	NodeID() string
}

Configurator is an interface that implements Generate and NodeID

type EnvoySnapshot added in v0.19.0

type EnvoySnapshot struct {
	Listeners map[string]types.Resource
	Clusters  map[string]types.Resource
}

type HttpExtAuthz added in v0.15.0

type HttpExtAuthz struct {
	Cluster             string        `json:"cluster"`
	Timeout             time.Duration `json:"timeout"`
	MaxRequestBytes     uint32        `json:"maxRequestBytes"`
	AllowPartialMessage bool          `json:"allowPartialMessage"`
	PackAsBytes         bool          `json:"packAsBytes"`
	FailureModeAllow    bool          `json:"FailureModeAllow"`
}

type HttpGrpcLogger added in v0.15.0

type HttpGrpcLogger struct {
	Name            string        `json:"name"`
	Cluster         string        `json:"cluster"`
	Timeout         time.Duration `json:"timeout"`
	RequestHeaders  []string      `json:"requestHeaders"`
	ResponseHeaders []string      `json:"responseHeaders"`
}

type KubernetesConfigurator

type KubernetesConfigurator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

KubernetesConfigurator takes a given Ingress Class and lister to find only ingresses of that class

func NewKubernetesConfigurator

func NewKubernetesConfigurator(nodeID string, certificates []Certificate, ca string, ingressClasses []string, options ...option) *KubernetesConfigurator

NewKubernetesConfigurator returns a Kubernetes configurator given a lister and ingress class

func (*KubernetesConfigurator) Generate

func (c *KubernetesConfigurator) Generate(ingresses []*k8s.Ingress, secrets []*v1.Secret) (cache.Snapshot, error)

Generate creates a new snapshot

func (*KubernetesConfigurator) NodeID

func (c *KubernetesConfigurator) NodeID() string

NodeID returns the NodeID

type Snapshotter

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

Snapshotter watches for Ingress changes and updates the config snapshot

func NewSnapshotter

func NewSnapshotter(snapshotCache cache.SnapshotCache, config Configurator, aggregator *k8s.Aggregator) *Snapshotter

NewSnapshotter returns a new Snapshotter

func (*Snapshotter) ConfigDump added in v0.19.0

func (s *Snapshotter) ConfigDump() (EnvoySnapshot, error)

func (*Snapshotter) CurrentSnapshot added in v0.19.0

func (s *Snapshotter) CurrentSnapshot() (cache.ResourceSnapshot, error)

func (*Snapshotter) Run

func (s *Snapshotter) Run(a *k8s.Aggregator)

Run will periodically refresh the snapshot

type UpstreamHealthCheck

type UpstreamHealthCheck struct {
	Timeout            time.Duration `json:"timeout"`
	Interval           time.Duration `json:"interval"`
	UnhealthyThreshold uint32        `json:"unhealthyThreshold"`
	HealthyThreshold   uint32        `json:"healtyThreshold"`
}

Jump to

Keyboard shortcuts

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