edge

package
v0.0.0-...-71f93e5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Zlib Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EdgeAsyncCommandTypeConfig      EdgeAsyncCommandType = "edgeConfig"
	EdgeAsyncCommandTypeStack       EdgeAsyncCommandType = "edgeStack"
	EdgeAsyncCommandTypeJob         EdgeAsyncCommandType = "edgeJob"
	EdgeAsyncCommandTypeLog         EdgeAsyncCommandType = "edgeLog"
	EdgeAsyncCommandTypeContainer   EdgeAsyncCommandType = "container"
	EdgeAsyncCommandTypeImage       EdgeAsyncCommandType = "image"
	EdgeAsyncCommandTypeVolume      EdgeAsyncCommandType = "volume"
	EdgeAsyncCommandTypeNormalStack EdgeAsyncCommandType = "normalStack"

	EdgeAsyncCommandOpAdd     EdgeAsyncCommandOperation = "add"
	EdgeAsyncCommandOpRemove  EdgeAsyncCommandOperation = "remove"
	EdgeAsyncCommandOpReplace EdgeAsyncCommandOperation = "replace"
)

Variables

This section is empty.

Functions

func BlockUntilCertificateIsReady

func BlockUntilCertificateIsReady(certPath, keyPath string, retryInterval time.Duration)

BlockUntilCertificateIsReady blocks the server start until the TLS certificates are ready

func ParseEdgeKey

func ParseEdgeKey(key string) (*edgeKey, error)

parseEdgeKey decodes a base64 encoded key and extract the decoded information from the following format: <portainer_instance_url>|<tunnel_server_addr>|<tunnel_server_fingerprint>|<endpoint_id>

func RetrieveEdgeKey

func RetrieveEdgeKey(edgeKey string, clusterService agent.ClusterService, dataPath string) (string, error)

Types

type EdgeAsyncCommandOperation

type EdgeAsyncCommandOperation string

type EdgeAsyncCommandType

type EdgeAsyncCommandType string

type Manager

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

Manager is used to manage all Edge features through multiple sub-components. It is mainly responsible for running the Edge background process.

func NewManager

func NewManager(parameters *ManagerParameters) *Manager

NewManager returns a pointer to a new instance of Manager

func (*Manager) CreateEdgeConfig

func (manager *Manager) CreateEdgeConfig(config *client.EdgeConfig) error

func (*Manager) DeleteEdgeConfig

func (manager *Manager) DeleteEdgeConfig(config *client.EdgeConfig) error

func (*Manager) GetEndpointID

func (manager *Manager) GetEndpointID() portainer.EndpointID

GetEndpointID gets the endpointID of the agent

func (*Manager) GetKey

func (manager *Manager) GetKey() string

GetKey returns the Edge key associated to the agent

func (*Manager) GetStackManager

func (manager *Manager) GetStackManager() *stack.StackManager

func (*Manager) IsKeySet

func (manager *Manager) IsKeySet() bool

IsKeySet returns true if an Edge key is associated to the agent

func (*Manager) PropagateKeyInCluster

func (manager *Manager) PropagateKeyInCluster() error

PropagateKeyInCluster propagates the Edge key associated to the agent to all the other agents inside the cluster

func (*Manager) ResetActivityTimer

func (manager *Manager) ResetActivityTimer()

ResetActivityTimer resets the activity timer

func (*Manager) SetEndpointID

func (manager *Manager) SetEndpointID(endpointID portainer.EndpointID)

SetEndpointID set the endpointID of the agent

func (*Manager) SetKey

func (manager *Manager) SetKey(key string) error

SetKey parses and associates an Edge key to the agent. If the agent is running inside a cluster, it will also set the "set" flag to specify that a key is set on this agent in the cluster.

func (*Manager) Start

func (manager *Manager) Start() error

Start starts the manager

func (*Manager) UpdateEdgeConfig

func (manager *Manager) UpdateEdgeConfig(config *client.EdgeConfig) error

type ManagerParameters

type ManagerParameters struct {
	Options           *agent.Options
	AdvertiseAddr     string
	ClusterService    agent.ClusterService
	DockerInfoService agent.DockerInfoService
	ContainerPlatform agent.ContainerPlatform
	KubeClient        *kubernetes.KubeClient
}

ManagerParameters represents an object used to create a Manager

type PollService

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

PollService is used to poll a Portainer instance to retrieve the status associated to the Edge endpoint. It is responsible for managing the state of the reverse tunnel (open and closing after inactivity). It is also responsible for retrieving the data associated to Edge stacks and schedules.

func (*PollService) Start

func (service *PollService) Start()

func (*PollService) Stop

func (service *PollService) Stop()

Directories

Path Synopsis
Package pkcs7 implements the subset of the CMS PKCS #7 datatype that is typically used to package certificates and CRLs.
Package pkcs7 implements the subset of the CMS PKCS #7 datatype that is typically used to package certificates and CRLs.

Jump to

Keyboard shortcuts

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