Documentation
¶
Overview ¶
Package edge runs what routing adapters need in front of Pando (R-174).
A routing adapter describes an edge — Traefik, cloudflared — as an api.EdgePlan; the default runtime adapter runs it. This package is the join, and the only place the two meet: neither adapter reaches into the other (design 03 §4.4).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateIssuer ¶
type CertificateIssuer interface {
Ensure(ctx context.Context, plan *api.CertificateIssue) ([]api.EdgeCertificate, error)
}
CertificateIssuer issues an edge's certificates and returns those it holds.
type Service ¶
type Service struct {
Registry *api.Registry
ProxyUpstream string
Logger *zap.Logger
// Certificates issues what an edge asks Pando to (EdgePlan.Issue):
// *edgecert.Issuer. Nil refuses such an edge.
Certificates CertificateIssuer
Clock clock.Clock
// Hosts counts the cluster's hosts. With more than one, each control
// host runs an edge of its own and every edge is told so
// (EdgeRequest.Clustered), so one that would order its own certificates
// leaves that to Pando (R-417, O-68). Nil is one host.
Hosts func(ctx context.Context) (int, error)
// Follower makes this the pass a control host that does not lead runs
// for its own edge (RunFollower): Certificates then hands out what the
// leader issued (edgecert.Held) rather than ordering, and the pass is
// skipped for a runtime whose one edge serves every host.
Follower bool
// Leading reports whether this replica leads, for RunFollower: the
// leader's own pass applies its host's edge. Nil is never.
Leading func() bool
// contains filtered or unexported fields
}
Service applies every routing adapter's edge through the default runtime.
func (*Service) Reconcile ¶
Reconcile makes the edges that exist the edges the routing adapters ask for.
Idempotent: a matching edge is left alone, a changed plan recreates it, and an edge nothing asks for any more is removed. One adapter's broken edge does not stop another's from being applied.
func (*Service) RunFollower ¶ added in v0.17.0
RunFollower reconciles this host's edge every interval until ctx ends, while the cluster has more than one host and this replica does not lead (R-417). The leader's "edges" job does the same for its own host and is the one that orders certificates; this pass serves what it ordered.
type Status ¶
type Status struct {
// Running is whether the edge was running when last looked at.
Running bool `json:"running"`
// Message says what is wrong, when something is. Operator detail — a
// port, an image — so the handler shows it only to whoever may change
// the adapter.
Message string `json:"message,omitempty"`
CheckedAt time.Time `json:"checked_at"`
}
Status is the last thing Pando found out about one routing adapter's edge.