rootd

package
v2.14.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessName = "daemon"
)

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Command returns the telepresence sub-command "daemon-foreground".

func WithNewServiceFunc added in v2.9.0

func WithNewServiceFunc(ctx context.Context, f NewServiceFunc) context.Context

func WithNewSessionFunc added in v2.9.0

func WithNewSessionFunc(ctx context.Context, f NewSessionFunc) context.Context

Types

type InProcSession added in v2.11.0

type InProcSession struct {
	*Session
	// contains filtered or unexported fields
}

InProcSession is like Session, but also implements the daemon.DaemonClient interface. This makes it possible to use the session in-process from the user daemon, without starting the root daemon gRPC service.

func NewInProcSession added in v2.11.0

func NewInProcSession(
	ctx context.Context,
	scout *scout.Reporter,
	mi *rpc.OutboundInfo,
	mc manager.ManagerClient,
	ver semver.Version,
) *InProcSession

NewInProcSession returns a root daemon session suitable to use in-process (from the user daemon) and is primarily intended for when the user daemon runs in a docker container with NET_ADMIN capabilities.

func (*InProcSession) Connect added in v2.11.0

func (rd *InProcSession) Connect(ctx context.Context, in *rpc.OutboundInfo, opts ...grpc.CallOption) (*rpc.DaemonStatus, error)

func (*InProcSession) Disconnect added in v2.11.0

func (rd *InProcSession) Disconnect(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error)

func (*InProcSession) GetNetworkConfig added in v2.11.0

func (rd *InProcSession) GetNetworkConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*rpc.NetworkConfig, error)

func (*InProcSession) Quit added in v2.11.0

func (rd *InProcSession) Quit(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error)

func (*InProcSession) SetDNSExcludes added in v2.14.0

func (rd *InProcSession) SetDNSExcludes(ctx context.Context, in *rpc.SetDNSExcludesRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*InProcSession) SetDNSMappings added in v2.14.0

func (rd *InProcSession) SetDNSMappings(ctx context.Context, in *rpc.SetDNSMappingsRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*InProcSession) SetDnsSearchPath added in v2.11.0

func (rd *InProcSession) SetDnsSearchPath(ctx context.Context, paths *rpc.Paths, opts ...grpc.CallOption) (*empty.Empty, error)

func (*InProcSession) SetLogLevel added in v2.11.0

func (rd *InProcSession) SetLogLevel(ctx context.Context, in *manager.LogLevelRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*InProcSession) Status added in v2.11.0

func (rd *InProcSession) Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*rpc.DaemonStatus, error)

func (*InProcSession) Version added in v2.11.0

func (rd *InProcSession) Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*common.VersionInfo, error)

func (*InProcSession) WaitForNetwork added in v2.11.0

func (rd *InProcSession) WaitForNetwork(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error)

type NewServiceFunc added in v2.9.0

type NewServiceFunc func(*scout.Reporter, *client.Config) *Service

func GetNewServiceFunc added in v2.9.0

func GetNewServiceFunc(ctx context.Context) NewServiceFunc

type NewSessionFunc added in v2.9.0

type NewSessionFunc func(context.Context, *scout.Reporter, *rpc.OutboundInfo) (*Session, error)

func GetNewSessionFunc added in v2.9.0

func GetNewSessionFunc(ctx context.Context) NewSessionFunc

type Service added in v2.9.0

type Service struct {
	rpc.UnsafeDaemonServer
	// contains filtered or unexported fields
}

Service represents the state of the Telepresence Daemon.

func NewService added in v2.9.0

func NewService(sr *scout.Reporter, cfg *client.Config) *Service

func (*Service) As added in v2.9.0

func (s *Service) As(ptr any)

func (*Service) Connect added in v2.9.0

func (s *Service) Connect(ctx context.Context, info *rpc.OutboundInfo) (*rpc.DaemonStatus, error)

func (*Service) Disconnect added in v2.9.0

func (s *Service) Disconnect(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

func (*Service) GetNetworkConfig added in v2.9.0

func (s *Service) GetNetworkConfig(ctx context.Context, e *empty.Empty) (nc *rpc.NetworkConfig, err error)

func (*Service) Quit added in v2.9.0

func (s *Service) Quit(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

func (*Service) SetDNSExcludes added in v2.14.0

func (s *Service) SetDNSExcludes(ctx context.Context, req *rpc.SetDNSExcludesRequest) (*emptypb.Empty, error)

func (*Service) SetDNSMappings added in v2.14.0

func (s *Service) SetDNSMappings(ctx context.Context, req *rpc.SetDNSMappingsRequest) (*emptypb.Empty, error)

func (*Service) SetDnsSearchPath added in v2.9.0

func (s *Service) SetDnsSearchPath(ctx context.Context, paths *rpc.Paths) (*empty.Empty, error)

func (*Service) SetLogLevel added in v2.9.0

func (s *Service) SetLogLevel(ctx context.Context, request *manager.LogLevelRequest) (*empty.Empty, error)

func (*Service) Status added in v2.9.0

func (s *Service) Status(_ context.Context, _ *empty.Empty) (*rpc.DaemonStatus, error)

func (*Service) Version added in v2.9.0

func (s *Service) Version(_ context.Context, _ *empty.Empty) (*common.VersionInfo, error)

func (*Service) WaitForNetwork added in v2.9.0

func (s *Service) WaitForNetwork(ctx context.Context, e *empty.Empty) (*empty.Empty, error)

func (*Service) WithSession added in v2.9.0

func (s *Service) WithSession(f func(context.Context, *Session) error) error

type Session added in v2.9.0

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

Session resolves DNS names and routes outbound traffic that is centered around a TUN device. The router is similar to a TUN-to-SOCKS5 but uses a bidirectional gRPC muxTunnel instead of SOCKS when communicating with the traffic-manager. The addresses of the device are derived from IP addresses sent to it from the user daemon (which in turn receives them from the cluster).

Data sent to the device is received as L3 IP-packets and parsed into L4 UDP and TCP before they are dispatched over the muxTunnel. Returned payloads are wrapped as IP-packets before written back to the device. This L3 <=> L4 conversation is made using gvisor.dev/gvisor/pkg/tcpip.

Connection pooling:

For UDP and TCP packets, a ConnID is created which uniquely identifies a combination of protocol, source IP, source port, destination IP, and destination port. A handler is then obtained that matches that ID (active handlers are cached in a tunnel.Pool) and the packet is then sent to that handler. The handler typically sends the ConnID and the payload of the packet over to the traffic-manager using the gRPC ClientTunnel. At the receiving en din the traffic-manager, a similar tunnel.Pool obtains a corresponding handler which manages a net.Conn matching the ConnID in the cluster.

A zero Session is invalid; you must use newSession.

func NewSession added in v2.9.0

func NewSession(c context.Context, scout *scout.Reporter, mi *rpc.OutboundInfo) (*Session, error)

NewSession returns a new properly initialized session object.

func (*Session) Done added in v2.9.3

func (s *Session) Done() chan struct{}

func (*Session) SetExcludes added in v2.14.0

func (s *Session) SetExcludes(ctx context.Context, excludes []string)

func (*Session) SetMappings added in v2.14.0

func (s *Session) SetMappings(ctx context.Context, mappings []*rpc.DNSMapping)

func (*Session) SetSearchPath added in v2.9.0

func (s *Session) SetSearchPath(ctx context.Context, paths []string, namespaces []string)

func (*Session) Start added in v2.12.0

func (s *Session) Start(c context.Context, g *dgroup.Group) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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