trafficmgr

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: 64 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionExpiredErr = errors.New("session expired")

Functions

This section is empty.

Types

type Installer

type Installer interface {
	EnsureAgent(c context.Context,
		obj k8sapi.Workload,
		config *ServiceProps,
		agentImageName string,
		telepresenceAPIPort uint16,
	) (string, string, error)
	EnsureManager(c context.Context) error
	RemoveManagerAndAgents(c context.Context, agentsOnly bool, agents []*manager.AgentInfo) error
}

func NewTrafficManagerInstaller

func NewTrafficManagerInstaller(kc *k8s.Cluster) (Installer, error)

type ManagerProxy

type ManagerProxy interface {
	managerrpc.ManagerServer

	// SetClient replaces the client of this proxy
	SetClient(client managerrpc.ManagerClient, callOptions ...grpc.CallOption)
}

func NewManagerProxy

func NewManagerProxy() ManagerProxy

NewManagerProxy returns a rpc.ManagerServer that just proxies all requests through the given rpc.ManagerClient.

type Service

type Service interface {
	RootDaemonClient(context.Context) (daemon.DaemonClient, error)
	SetManagerClient(manager.ManagerClient, ...grpc.CallOption)
	LoginExecutor() auth.LoginExecutor
}

type ServiceProps

type ServiceProps struct {
	Service            *core.Service
	ServicePort        *core.ServicePort
	Container          *core.Container
	ContainerPortIndex int
}

type SessionService

type SessionService interface {
	Name() string
	// Run should run the Session service. Run will be launched in its own goroutine and it's expected that it blocks until the context is finished.
	Run(ctx context.Context, scout *scout.Reporter, session Session) error
}

A SessionService represents a service that should be started together with each daemon session. Can be used when passing in custom commands to start up any resources needed for the commands.

type TrafficManager

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

func (*TrafficManager) AddIntercept

AddIntercept adds one intercept

func (*TrafficManager) AddLocalOnlyIntercept

func (tm *TrafficManager) AddLocalOnlyIntercept(c context.Context, spec *manager.InterceptSpec) (*rpc.InterceptResult, error)

AddLocalOnlyIntercept adds a local-only intercept

func (*TrafficManager) CanIntercept

CanIntercept checks if it is possible to create an intercept for the given request. The intercept can proceed only if the returned rpc.InterceptResult is nil. The returned runtime.Object is either nil, indicating a local intercept, or the workload for the intercept.

func (TrafficManager) EnsureAgent

func (ki TrafficManager) EnsureAgent(
	c context.Context,
	obj k8sapi.Workload,
	svcprops *ServiceProps,
	agentImageName string,
	telepresenceAPIPort uint16,
) (string, string, error)

EnsureAgent does a lot of things but at a high level it ensures that the traffic agent is installed alongside the proper workload. In doing that, it also ensures that the workload is referenced by a service. Lastly, it returns the service UID associated with the workload since this is where that correlation is made.

func (TrafficManager) EnsureManager

func (ki TrafficManager) EnsureManager(c context.Context) error

func (*TrafficManager) GatherLogs added in v2.5.5

func (tm *TrafficManager) GatherLogs(ctx context.Context, request *connector.LogsRequest) (*connector.LogsResponse, error)

GatherLogs acquires the logs for the traffic-manager and/or traffic-agents specified by the connector.LogsRequest and returns them to the caller

func (*TrafficManager) GetInterceptSpec

func (tm *TrafficManager) GetInterceptSpec(name string) *manager.InterceptSpec

GetInterceptSpec returns the InterceptSpec for the given name, or nil if no such spec exists

func (*TrafficManager) IngressInfos

func (tm *TrafficManager) IngressInfos(c context.Context) ([]*manager.IngressInfo, error)

func (*TrafficManager) InterceptInfo

func (tm *TrafficManager) InterceptInfo(ctx context.Context, callerID, path string, h http.Header) (*restapi.InterceptInfo, error)

func (*TrafficManager) ManagerClient

func (tm *TrafficManager) ManagerClient() manager.ManagerClient

func (*TrafficManager) RemainWithToken

func (tm *TrafficManager) RemainWithToken(ctx context.Context) error

func (*TrafficManager) RemoveIntercept

func (tm *TrafficManager) RemoveIntercept(c context.Context, name string) error

RemoveIntercept removes one intercept by name

func (*TrafficManager) RemoveLocalOnlyIntercept

func (tm *TrafficManager) RemoveLocalOnlyIntercept(c context.Context, name, namespace string) error

func (TrafficManager) RemoveManagerAndAgents

func (ki TrafficManager) RemoveManagerAndAgents(c context.Context, agentsOnly bool, agents []*manager.AgentInfo) error

RemoveManagerAndAgents will remove the agent from all deployments listed in the given agents slice. Unless agentsOnly is true, it will also remove the traffic-manager service and deployment.

func (*TrafficManager) Run

func (tm *TrafficManager) Run(c context.Context) error

Run (1) starts up with ensuring that the manager is installed and running, but then for most of its life

  • (2) calls manager.ArriveAsClient and then periodically calls manager.Remain
  • run the intercepts (manager.WatchIntercepts) and then
  • (3) listen on the appropriate local ports and forward them to the intercepted Services, and
  • (4) mount the appropriate remote volumes.

func (*TrafficManager) Status

func (tm *TrafficManager) Status(c context.Context) *rpc.ConnectInfo

func (*TrafficManager) Uninstall

func (*TrafficManager) UpdateStatus

func (tm *TrafficManager) UpdateStatus(c context.Context, cr *rpc.ConnectRequest) *rpc.ConnectInfo

func (*TrafficManager) WatchWorkloads

func (*TrafficManager) WorkloadInfoSnapshot

func (tm *TrafficManager) WorkloadInfoSnapshot(
	ctx context.Context,
	namespaces []string,
	filter rpc.ListRequest_Filter,
	includeLocalIntercepts bool,
) (*rpc.WorkloadInfoSnapshot, error)

type WatchWorkloadsStream

type WatchWorkloadsStream interface {
	Send(*rpc.WorkloadInfoSnapshot) error
}

Jump to

Keyboard shortcuts

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