edge

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package edge runs Traefik replicas on edge nodes (§8.5): nodes of edge pools serve public traffic with the routes and certificates the controller serves them over the private network, and keep serving with the last configuration when the controller is down.

Index

Constants

View Source
const AdminPort = "8082"

AdminPort is Traefik's ping and metrics port on the node's mesh address.

View Source
const TaskID = "sys-edge-traefik"

TaskID is the edge Traefik's task ID on every edge node.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Image        string
	TraefikToken string
	TokenHeader  string
	// ControllerURL is the controller's API on the private network.
	ControllerURL func() string
	// Edges lists the nodes that run a replica: those of edge pools and the
	// projects' own load balancers (D22).
	Edges func() []nodes.View
	// EdgePool reports nodes of edge pools (nil: all of Edges).
	EdgePool func(nodeID string) bool
	// Projects lists the projects a node is the load balancer of.
	Projects func(nodeName string) []string
	// Settings returns the global Traefik settings (§5.7).
	Settings func() traefik.Settings
	// DatabaseEntrypoints are the public database entrypoints (name -> address).
	DatabaseEntrypoints map[string]string
	// ServiceEntrypoints returns the public service ports' entrypoints
	// (Phase 15c; may be nil).
	ServiceEntrypoints func() map[string]string
}

Config of the edge replicas.

type Health

type Health struct {
	NodeID    string    `json:"nodeId"`
	Node      string    `json:"node"`
	MeshIP    string    `json:"meshIp"`
	Address   string    `json:"address"` // public (point DNS here)
	State     string    `json:"state"`   // healthy | unhealthy | starting
	Error     string    `json:"error,omitempty"`
	Container string    `json:"container"` // the Traefik task state on the node
	CheckedAt time.Time `json:"checkedAt"`
	// EdgePool: the node is in an edge pool and serves the default
	// ingress; Projects chose it as their load balancer.
	EdgePool bool     `json:"edgePool"`
	Projects []string `json:"projects"`
}

Health is the controller's view of one edge.

type Manager

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

func New

func New(st *store.Store, gw *agentgw.Gateway, ms *metrics.Store, names metrics.ServiceNames, cfg Config, log *slog.Logger) *Manager

func (*Manager) Healthy added in v0.3.0

func (m *Manager) Healthy(node string) (healthy, known bool)

Healthy reports whether a node's replica answered its last check.

func (*Manager) Hooks

func (m *Manager) Hooks() agentgw.Hooks

Hooks start the replica when an edge node connects and remove it from nodes that left their edge pool.

func (*Manager) List

func (m *Manager) List() []Health

List returns every edge's health.

func (*Manager) Refresh

func (m *Manager) Refresh(ctx context.Context)

Refresh re-sends the replica to every edge node (after a settings change).

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run keeps replicas on every edge node, removes them from former edges, checks their health and imports their metrics, every 10 seconds.

func (*Manager) Spec

func (m *Manager) Spec(nodeName, meshIP string) *agentv1.TaskSpec

Spec is the edge Traefik for one node.

Jump to

Keyboard shortcuts

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