agent

package
v2.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppEnvironment

func AppEnvironment() map[string]string

AppEnvironment returns the environment visible to this agent together with environment variables explicitly declared for the app container and minus the environment variables provided by this config.

func GetAmbassadorCloudConnectionInfo added in v2.2.0

func GetAmbassadorCloudConnectionInfo(ctx context.Context, address string) (*rpc.AmbassadorCloudConnection, error)

func GetLogLevel added in v2.4.4

func GetLogLevel() string

GetLogLevel will return the log level that this agent should use

func Main

func Main(ctx context.Context, args ...string) error

func SftpServer added in v2.4.7

func SftpServer(ctx context.Context, sftpPortCh chan<- int32) error

SftpServer creates a listener on the next available port, writes that port on the given channel, and then starts accepting connections on that port. Each connection starts a sftp-server that communicates with that connection using its stdin and stdout.

func TalkToManager

func TalkToManager(ctx context.Context, address string, info *rpc.AgentInfo, state State) error

Types

type Config

type Config struct {
	Name        string `env:"_TEL_AGENT_NAME,required"`
	Namespace   string `env:"_TEL_AGENT_NAMESPACE,default="`
	PodIP       string `env:"_TEL_AGENT_POD_IP,default="`
	AgentPort   int32  `env:"_TEL_AGENT_PORT,default=9900"`
	AppMounts   string `env:"_TEL_AGENT_APP_MOUNTS,default=/tel_app_mounts"`
	AppPort     int32  `env:"_TEL_AGENT_APP_PORT,required"`
	ManagerHost string `env:"_TEL_AGENT_MANAGER_HOST,default=traffic-manager"`
	ManagerPort int32  `env:"_TEL_AGENT_MANAGER_PORT,default=8081"`
	APIPort     int32  `env:"TELEPRESENCE_API_PORT,default="`
}

func (*Config) AddSecretsMounts added in v2.4.1

func (cfg *Config) AddSecretsMounts(ctx context.Context, env map[string]string) error

AddSecretsMounts adds any token-rotating system secrets directories if they exist e.g. /var/run/secrets/kubernetes.io or /var/run/secrets/eks.amazonaws.com to the TELEPRESENCE_MOUNTS environment variable

func (*Config) HasMounts added in v2.1.3

func (cfg *Config) HasMounts(ctx context.Context, env map[string]string) bool

type State

type State interface {
	HandleIntercepts(ctx context.Context, cepts []*manager.InterceptInfo) []*manager.ReviewInterceptRequest
	SetManager(sessionInfo *manager.SessionInfo, manager manager.ManagerClient, version semver.Version)
	AgentState() restapi.AgentState
}

func NewState

func NewState(forwarder *forwarder.Forwarder, managerHost, namespace, podIP string, sftpPort int32) State

Jump to

Keyboard shortcuts

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