proxy

package
v1.6.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const ProxyKeepAlivePeriod = time.Duration(5) * time.Minute

ProxyKeepAlivePeriod is the time used for sending periodic keepalives on proxy connections. Cross-reference with datapath PROXY_DEFAULT_LIFETIME.

Variables

View Source
var (
	// DefaultDNSProxy is the global, shared, DNS Proxy singleton.
	DefaultDNSProxy *dnsproxy.DNSProxy
)
View Source
var (
	// DefaultEndpointInfoRegistry is the default instance implementing the
	// EndpointInfoRegistry interface.
	DefaultEndpointInfoRegistry logger.EndpointInfoRegistry = &defaultEndpointInfoRegistry{}
)

Functions

func ChangeLogLevel added in v1.5.0

func ChangeLogLevel(level logrus.Level)

ChangeLogLevel changes proxy log level to correspond to the logrus log level 'level'.

func GetProxyPort added in v1.6.0

func GetProxyPort(l7Type policy.L7ParserType, ingress bool) (uint16, string, error)

GetProxyPort() returns the fixed listen port for a proxy, if any.

Types

type DatapathUpdater added in v1.6.0

type DatapathUpdater interface {
	InstallProxyRules(proxyPort uint16, ingress bool, name string) error
	RemoveProxyRules(proxyPort uint16, ingress bool, name string) error
}

type Proxy

type Proxy struct {
	*envoy.XDSServer
	// contains filtered or unexported fields
}

Proxy maintains state about redirects

func StartProxySupport added in v1.5.0

func StartProxySupport(minPort uint16, maxPort uint16, stateDir string,
	accessLogFile string, accessLogNotifier logger.LogRecordNotifier, accessLogMetadata []string,
	datapathUpdater DatapathUpdater) *Proxy

StartProxySupport starts the servers to support L7 proxies: xDS GRPC server and access log server.

func (*Proxy) CreateOrUpdateRedirect

func (p *Proxy) CreateOrUpdateRedirect(l4 *policy.L4Filter, id string, localEndpoint logger.EndpointUpdater,
	wg *completion.WaitGroup) (proxyPort uint16, err error, finalizeFunc revert.FinalizeFunc, revertFunc revert.RevertFunc)

CreateOrUpdateRedirect creates or updates a L4 redirect with corresponding proxy configuration. This will allocate a proxy port as required and launch a proxy instance. If the redirect is already in place, only the rules will be updated. The proxy listening port is returned, but proxy configuration on that port may still be ongoing asynchronously. Caller should wait for successful completion on 'wg' before assuming the returned proxy port is listening.

func (*Proxy) GetStatusModel added in v1.5.0

func (p *Proxy) GetStatusModel() *models.ProxyStatus

GetStatusModel returns the proxy status as API model

func (*Proxy) ReinstallRules added in v1.6.0

func (p *Proxy) ReinstallRules()

ReinstallRules is called by daemon reconfiguration to re-install proxy ports rules that were removed during the removal of all Cilium rules.

func (*Proxy) RemoveRedirect

func (p *Proxy) RemoveRedirect(id string, wg *completion.WaitGroup) (error, revert.FinalizeFunc, revert.RevertFunc)

RemoveRedirect removes an existing redirect.

func (*Proxy) SetProxyPort added in v1.6.0

func (p *Proxy) SetProxyPort(name string, port uint16) error

SetProxyPort() marks the proxy 'name' as successfully created with proxy port 'port' and creates or updates the datapath rules accordingly. May only be called once per proxy.

func (*Proxy) UpdateRedirectMetrics added in v1.5.0

func (p *Proxy) UpdateRedirectMetrics()

UpdateRedirectMetrics updates the redirect metrics per application protocol in Prometheus. Lock needs to be held to call this function.

type ProxyPort added in v1.6.0

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

type Redirect

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

type RedirectImplementation added in v1.5.0

type RedirectImplementation interface {
	// UpdateRules notifies the proxy implementation that the new rules in
	// parameter l4 are to be applied. The implementation should .Add to the
	// WaitGroup if the update is asynchronous and the update should not return
	// until it is complete.
	// The returned RevertFunc must be non-nil.
	// Note: UpdateRules is not called when a redirect is created.
	UpdateRules(wg *completion.WaitGroup, l4 *policy.L4Filter) (revert.RevertFunc, error)

	// Close closes and cleans up resources associated with the redirect
	// implementation. The implementation should .Add to the WaitGroup if the
	// update is asynchronous and the update should not return until it is
	// complete.
	Close(wg *completion.WaitGroup) (revert.FinalizeFunc, revert.RevertFunc)
}

RedirectImplementation is the generic proxy redirect interface that each proxy redirect type must implement

Directories

Path Synopsis
Package logger provides the accesslog logging logic for all proxies
Package logger provides the accesslog logging logic for all proxies

Jump to

Keyboard shortcuts

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