ateomtunnel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package ateomtunnel wires atunnel into an ateom: its flags, listeners, DNS relay, and per-actor ingress and egress. Both ateoms build their tunnel here so they cannot drift.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorEgress

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

ActorEgress is an actor's tunneled egress, ready to activate.

type Config

type Config struct {
	// ListenAddress serves actor ingress HTTPS.
	ListenAddress string
	// ConnectListenAddress serves actor ingress mTLS CONNECT.
	ConnectListenAddress string
	// CredentialBundle holds the worker Pod certificate and key, used for
	// inbound serving, outbound mTLS, and authentication to the atelet broker.
	CredentialBundle string
	// TrustBundle verifies router clients and the node-local atelet.
	TrustBundle string
	// ClientIdentity is the SPIFFE ID allowed to call actor ingress HTTPS.
	ClientIdentity string
	// BrokerIdentity is the SPIFFE ID the node-local atelet must present on the
	// credential broker connection. It names atelet's namespace, not this
	// worker's, so it is configured rather than derived from the downward API.
	BrokerIdentity string
	// EgressListenAddress receives transparently intercepted actor egress TCP.
	EgressListenAddress string
	// EgressTrustBundle verifies the remote egress gateway's serving cert.
	EgressTrustBundle string
}

Config is the atunnel setup an ateom takes from its flags.

func RegisterFlags

func RegisterFlags(fs FlagSet) *Config

RegisterFlags registers the atunnel flags on fs and returns the Config they fill once fs is parsed.

type FlagSet

type FlagSet interface {
	StringVar(p *string, name, value, usage string)
}

FlagSet is the registration surface that flag.FlagSet and pflag.FlagSet share.

type Tunnel

type Tunnel struct {
	// Ingress proxies router traffic to the active actors.
	Ingress *atunnel.Server
	// Egress tunnels the active actors' outbound TCP to the egress gateway.
	Egress *atunnel.Egress
	// EgressPort is the local atunnel listener used as the target of the
	// actor network's transparent TCP redirect.
	EgressPort uint16
	// DNSRelay answers the sandbox's DNS from inside its own namespace.
	DNSRelay *dns.Relay
	// contains filtered or unexported fields
}

Tunnel is the atunnel state one ateom shares across its actors.

func Start

func Start(ctx context.Context, cfg Config, upstream string) (*Tunnel, error)

Start builds the DNS relay and starts serving actor ingress, which proxies to upstream inside each sandbox. Egress binds only in sandbox namespaces, so nothing listens for it here.

func (*Tunnel) Activate

func (t *Tunnel) Activate(actor resources.ActorAttribution, dial atunnel.DialFunc, egress *ActorEgress) error

Activate starts admitting the actor's traffic. Ingress reaches the actor through dial; egress is activated only when it was prepared.

func (*Tunnel) Deactivate

func (t *Tunnel) Deactivate(ctx context.Context, actor resources.ActorAttribution) error

Deactivate stops admitting the actor's traffic and drains its active streams, before the actor network is torn down. It attempts both directions even if one fails.

func (*Tunnel) PrepareEgress

func (t *Tunnel) PrepareEgress(ctx context.Context, actor resources.ActorAttribution, gateway *ateompb.EgressGateway) (*ActorEgress, error)

PrepareEgress mints the actor's certificate and builds its gateway client. A nil gateway means the actor has no tunneled egress and yields a nil result.

Jump to

Keyboard shortcuts

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