edge

package
v0.0.0-...-0c9bbe6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Zlib Imports: 48 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 HasServerConnectivity

func HasServerConnectivity(options *agent.Options) bool

HasServerConnectivity performs a one-shot connectivity check against the Portainer API server and, when configured, the tunnel server. Results are printed to stdout. Returns true if all checks pass, false if any fail.

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) MetricsHandler

func (manager *Manager) MetricsHandler() *agentmetrics.Handler

MetricsHandler returns the agent metrics handler for the /api/metrics endpoint. Returns nil when metrics collection is not enabled for the current platform.

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) RegisterPollHook

func (service *PollService) RegisterPollHook(h policyreconcile.PollHook)

RegisterPollHook registers a PollHook that will be called every poll cycle via Tick. Intended for handler packages (e.g. helm.RestoreCoordinator) that need cross-poll work outside the reconciler's per-cycle Apply/Remove lifecycle.

func (*PollService) RegisterReconcilerFactory

func (service *PollService) RegisterReconcilerFactory(policyType string, f policyreconcile.HandlerFactory)

RegisterReconcilerFactory registers a HandlerFactory with the reconciler. Called at boot for each platform-specific policy handler type.

func (*PollService) SetChartReporter

func (service *PollService) SetChartReporter(r *helm.ChartStatusReporter)

SetChartReporter registers the helm ChartStatusReporter used for legacy dual-emit. Called at boot on K8s agents only; nil on Docker/Podman agents.

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