regeneration

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 8 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatapathRegenerationLevel

type DatapathRegenerationLevel int

DatapathRegenerationLevel determines what is expected of the datapath when a regeneration event is processed.

const (
	// Invalid is the default level to enforce explicit setting of
	// the regeneration level.
	Invalid DatapathRegenerationLevel = iota
	// RegenerateWithoutDatapath indicates that datapath rebuild or reload
	// is not required to implement this regeneration.
	RegenerateWithoutDatapath
	// RegenerateWithDatapathLoad indicates that the datapath must be
	// reloaded but not recompiled to implement this regeneration.
	RegenerateWithDatapathLoad
	// RegenerateWithDatapathRewrite indicates that the datapath must be
	// recompiled and reloaded to implement this regeneration.
	RegenerateWithDatapathRewrite
	// RegenerateWithDatapathRebuild indicates that the datapath must be
	// fully recompiled and reloaded without using any cached templates.
	RegenerateWithDatapathRebuild
)

func (DatapathRegenerationLevel) String

func (r DatapathRegenerationLevel) String() string

String converts a DatapathRegenerationLevel into a human-readable string.

type EndpointInfoSource

type EndpointInfoSource interface {
	GetID() uint64
	GetIPv4Address() string
	GetIPv6Address() string
	GetIdentity() identity.NumericIdentity
	GetLabels() []string
	GetLabelsSHA() string
	HasSidecarProxy() bool
	ConntrackName() string
	ConntrackNameLocked() string
	GetProxyInfoByFields() (uint64, string, string, []string, string, uint64, error)
}

EndpointInfoSource returns information about an endpoint being proxied. The read lock must be held when calling any method.

type EndpointUpdater

type EndpointUpdater interface {
	EndpointInfoSource
	// OnProxyPolicyUpdate is called when the proxy acknowledges that it
	// has applied a policy.
	OnProxyPolicyUpdate(policyRevision uint64)

	// UpdateProxyStatistics updates the Endpoint's proxy statistics to account
	// for a new observed flow with the given characteristics.
	UpdateProxyStatistics(l4Protocol string, port uint16, ingress, request bool, verdict accesslog.FlowVerdict)
}

EndpointUpdater returns information about an endpoint being proxied and is called back to update the endpoint when proxy events occur. This is a subset of `Endpoint`.

type ExternalRegenerationMetadata

type ExternalRegenerationMetadata struct {
	// Reason provides context to source for the regeneration, which is
	// used to generate useful log messages.
	Reason string

	// RegenerationLevel forces datapath regeneration according to the
	// levels defined in the DatapathRegenerationLevel description.
	RegenerationLevel DatapathRegenerationLevel

	ParentContext context.Context
}

ExternalRegenerationMetadata contains any information about a regeneration that the endpoint subsystem should be made aware of for a given endpoint.

type Owner

type Owner interface {
	// Must return the policy repository
	GetPolicyRepository() *policy.Repository

	// QueueEndpointBuild puts the given endpoint in the processing queue
	QueueEndpointBuild(ctx context.Context, epID uint64) (func(), error)

	// GetCompilationLock returns the mutex responsible for synchronizing compilation
	// of BPF programs.
	GetCompilationLock() *lock.RWMutex

	// GetCIDRPrefixLengths returns the sorted list of unique prefix lengths used
	// by CIDR policies.
	GetCIDRPrefixLengths() (s6, s4 []int)

	// SendNotification is called to emit an agent notification
	SendNotification(msg monitorAPI.AgentNotifyMessage) error

	// Datapath returns a reference to the datapath implementation.
	Datapath() datapath.Datapath

	// GetDNSRules creates a fresh copy of DNS rules that can be used when
	// endpoint is restored on a restart.
	GetDNSRules(epID uint16) restore.DNSRules

	// RemoveRestoredDNSRules removes any restored DNS rules for
	// this endpoint from the DNS proxy.
	RemoveRestoredDNSRules(epID uint16)
}

Owner is the interface defines the requirements for anybody owning policies.

Jump to

Keyboard shortcuts

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