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 ¶
const AdminPort = "8082"
AdminPort is Traefik's ping and metrics port on the node's mesh address.
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 (*Manager) Healthy ¶ added in v0.3.0
Healthy reports whether a node's replica answered its last check.
func (*Manager) Hooks ¶
Hooks start the replica when an edge node connects and remove it from nodes that left their edge pool.
func (*Manager) Refresh ¶
Refresh re-sends the replica to every edge node (after a settings change).