Documentation
¶
Index ¶
- Variables
- func GetFreePort() (int, error)
- func Notify(p *supervisor.Process, message string)
- func RunAsDaemon(dns, fallback string) error
- func RunAsTeleproxyBridge(context, namespace string) error
- func RunAsTeleproxyIntercept(dns, fallback string) error
- func SetUpLogging() supervisor.Logger
- func WaitForSignal(p *supervisor.Process) error
- type DaemonFormatter
- type Intercept
- type InterceptInfo
- func (ii *InterceptInfo) Acquire(_ *supervisor.Process, tm *TrafficManager) (int, error)
- func (ii *InterceptInfo) PreviewURL(hostname string) (url string)
- func (ii *InterceptInfo) Release(_ *supervisor.Process, tm *TrafficManager, port int) error
- func (ii *InterceptInfo) Retain(_ *supervisor.Process, tm *TrafficManager, port int) error
- type KCluster
- func (c *KCluster) Context() string
- func (c *KCluster) GetKubectlArgs(args ...string) []string
- func (c *KCluster) GetKubectlArgsNoNamespace(args ...string) []string
- func (c *KCluster) GetKubectlCmd(p *supervisor.Process, args ...string) *supervisor.Cmd
- func (c *KCluster) GetKubectlCmdNoNamespace(p *supervisor.Process, args ...string) *supervisor.Cmd
- func (c *KCluster) RAI() *RunAsInfo
- func (c *KCluster) Server() string
- func (c *KCluster) SetBridgeCheck(isBridgeOkay func() bool)
- type Resource
- type ResourceBase
- type RunAsInfo
- type TrafficManager
Constants ¶
This section is empty.
Variables ¶
var Help = `The Edge Control Daemon is a long-lived background component that manages connections and network state. Launch the Edge Control Daemon: sudo edgectl daemon Examine the Daemon's log output in ` + edgectl.Logfile + ` to troubleshoot problems. `
Functions ¶
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use. Similar to telepresence.utilities.find_free_port()
func Notify ¶
func Notify(p *supervisor.Process, message string)
Notify displays a desktop banner notification to the user
func RunAsDaemon ¶
RunAsDaemon is the main function when executing as the daemon
func RunAsTeleproxyBridge ¶
RunAsTeleproxyBridge is the main function when executing as teleproxy bridge
func RunAsTeleproxyIntercept ¶
RunAsTeleproxyIntercept is the main function when executing as teleproxy intercept
func SetUpLogging ¶
func SetUpLogging() supervisor.Logger
SetUpLogging sets up standard Edge Control Daemon logging
func WaitForSignal ¶
func WaitForSignal(p *supervisor.Process) error
WaitForSignal is a Worker that calls Shutdown if SIGINT or SIGTERM is received.
Types ¶
type DaemonFormatter ¶
type DaemonFormatter struct {
TimestampFormat string
}
DaemonFormatter formats log messages for the Edge Control Daemon
type Intercept ¶
type Intercept struct { ResourceBase // contains filtered or unexported fields }
Intercept is a Resource handle that represents a live intercept
func MakeIntercept ¶
func MakeIntercept(p *supervisor.Process, tm *TrafficManager, cluster *KCluster, ii *InterceptInfo) (*Intercept, error)
MakeIntercept acquires an intercept and returns a Resource handle for it
type InterceptInfo ¶
type InterceptInfo struct {
*rpc.InterceptRequest
}
InterceptInfo tracks one intercept operation
func (*InterceptInfo) Acquire ¶
func (ii *InterceptInfo) Acquire(_ *supervisor.Process, tm *TrafficManager) (int, error)
Acquire an intercept from the traffic manager
func (*InterceptInfo) PreviewURL ¶
func (ii *InterceptInfo) PreviewURL(hostname string) (url string)
PreviewURL returns the Service Preview URL for this intercept if it is configured appropriately, or the empty string otherwise.
func (*InterceptInfo) Release ¶
func (ii *InterceptInfo) Release(_ *supervisor.Process, tm *TrafficManager, port int) error
Release the given intercept.
func (*InterceptInfo) Retain ¶
func (ii *InterceptInfo) Retain(_ *supervisor.Process, tm *TrafficManager, port int) error
Retain the given intercept. This likely needs to be called every five seconds or so.
type KCluster ¶
type KCluster struct { ResourceBase // contains filtered or unexported fields }
KCluster is a Kubernetes cluster reference
func TrackKCluster ¶
func TrackKCluster( p *supervisor.Process, rai *RunAsInfo, context, namespace string, kargs []string, ) (*KCluster, error)
TrackKCluster tracks connectivity to a cluster
func (*KCluster) GetKubectlArgs ¶
GetKubectlArgs returns the kubectl command arguments to run a kubectl command with this cluster, including the namespace argument.
func (*KCluster) GetKubectlArgsNoNamespace ¶
GetKubectlArgsNoNamespace returns the kubectl command arguments to run a kubectl command with this cluster, but without the namespace argument.
func (*KCluster) GetKubectlCmd ¶
func (c *KCluster) GetKubectlCmd(p *supervisor.Process, args ...string) *supervisor.Cmd
GetKubectlCmd returns a Cmd that runs kubectl with the given arguments and the appropriate environment to talk to the cluster
func (*KCluster) GetKubectlCmdNoNamespace ¶
func (c *KCluster) GetKubectlCmdNoNamespace(p *supervisor.Process, args ...string) *supervisor.Cmd
GetKubectlCmdNoNamespace returns a Cmd that runs kubectl with the given arguments and the appropriate environment to talk to the cluster, but it doesn't supply a namespace arg.
func (*KCluster) SetBridgeCheck ¶
SetBridgeCheck sets the callable used to check whether the Teleproxy bridge is functioning. If this is nil/unset, cluster monitoring checks the cluster directly (via kubectl)
type Resource ¶
Resource represents one thing managed by edgectl daemon. Examples include network intercepts (via teleproxy intercept) and cluster connectivity.
func CheckedRetryingCommand ¶
func CheckedRetryingCommand( p *supervisor.Process, name string, args []string, rai *RunAsInfo, check func(*supervisor.Process) error, startGrace time.Duration, ) (Resource, error)
CheckedRetryingCommand launches a command, restarting it repeatedly if it quits, and killing and restarting it if it fails the given check.
type ResourceBase ¶
type ResourceBase struct {
// contains filtered or unexported fields
}
ResourceBase has helpers to create a monitored resource
func (*ResourceBase) IsOkay ¶
func (rb *ResourceBase) IsOkay() bool
IsOkay returns whether the resource is okay as far as monitoring is aware
type RunAsInfo ¶
RunAsInfo contains the information required to launch a subprocess as the user such that it is likely to function as if the user launched it themselves.
func GuessRunAsInfo ¶
func GuessRunAsInfo(p *supervisor.Process) (*RunAsInfo, error)
GuessRunAsInfo attempts to construct a RunAsInfo for the user logged in at the primary display
func (*RunAsInfo) Command ¶
func (rai *RunAsInfo) Command(p *supervisor.Process, args ...string) *supervisor.Cmd
Command returns a supervisor.Cmd that is configured to run a subprocess as the user in this context.
type TrafficManager ¶
type TrafficManager struct {
// contains filtered or unexported fields
}
TrafficManager is a handle to access the Traffic Manager in a cluster.
func NewTrafficManager ¶
func NewTrafficManager(p *supervisor.Process, cluster *KCluster, managerNs string, installID string, isCI bool) (*TrafficManager, error)
NewTrafficManager returns a TrafficManager resource for the given cluster if it has a Traffic Manager service.