Documentation
¶
Overview ¶
Package service provides authoritative service DNS and readiness-selected endpoint control.
Index ¶
- func BuildClusterSnapshot(cluster string, generation, revision uint64, leader string, peers []Peer) (*api.Snapshot, error)
- func ValidateContract(cluster, nodeGroup, digest string, services []*api.Service) error
- func ValidateNodeState(nodeGroup string, contract []*api.Service, state *api.NodeState) error
- func ValidateSnapshotOwnership(snapshot *api.Snapshot) error
- type Controller
- func (c *Controller) Apply(ctx context.Context, snapshot *api.Snapshot) error
- func (c *Controller) BuildSnapshot(generation, revision uint64, leader string, nodes []*api.NodeState) *api.Snapshot
- func (c *Controller) Contract() []*api.Service
- func (c *Controller) Digest() string
- func (c *Controller) Healthy() bool
- func (c *Controller) NodeState(session string, sequence uint64) *api.NodeState
- func (c *Controller) SetPods(value pods.Snapshot)
- func (c *Controller) SetServices(value []manifest.Service)
- func (c *Controller) Subscribe() (<-chan struct{}, func())
- func (c *Controller) ValidateNodeState(state *api.NodeState) error
- type Dataplane
- type Peer
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClusterSnapshot ¶
func BuildClusterSnapshot(cluster string, generation, revision uint64, leader string, peers []Peer) (*api.Snapshot, error)
BuildClusterSnapshot merges NodeGroup contracts and matching leased node states.
func ValidateContract ¶
ValidateContract validates a Hello's deterministic NodeGroup-owned Service identities and ports.
func ValidateNodeState ¶
ValidateNodeState rejects endpoints that do not exactly match the sending NodeGroup contract.
func ValidateSnapshotOwnership ¶
ValidateSnapshotOwnership rejects duplicate cluster-wide Service identities.
Types ¶
type Controller ¶
type Controller struct {
Cluster, NodeGroup string
NodeIPv6 netip.Addr
DNS *Server
Dataplane Dataplane
// contains filtered or unexported fields
}
Controller combines desired Services with ready selected local Pods.
func NewController ¶
func NewController(cluster, nodeGroup string, nodeIPv6 netip.Addr, dns *Server, plane Dataplane) *Controller
NewController constructs an initially healthy empty controller.
func (*Controller) BuildSnapshot ¶
func (c *Controller) BuildSnapshot(generation, revision uint64, leader string, nodes []*api.NodeState) *api.Snapshot
BuildSnapshot merges only node states matching the current desired digest.
func (*Controller) Contract ¶
func (c *Controller) Contract() []*api.Service
Contract returns the complete local service contract without leased backends.
func (*Controller) Digest ¶
func (c *Controller) Digest() string
Digest returns a deterministic SHA-512 desired configuration digest.
func (*Controller) Healthy ¶
func (c *Controller) Healthy() bool
Healthy reports whether the last required dataplane application succeeded.
func (*Controller) NodeState ¶
func (c *Controller) NodeState(session string, sequence uint64) *api.NodeState
NodeState creates a complete ready-selected local endpoint view.
func (*Controller) SetPods ¶
func (c *Controller) SetPods(value pods.Snapshot)
SetPods replaces the complete local pod view.
func (*Controller) SetServices ¶
func (c *Controller) SetServices(value []manifest.Service)
SetServices replaces desired service configuration.
func (*Controller) Subscribe ¶
func (c *Controller) Subscribe() (<-chan struct{}, func())
Subscribe returns an independent coalescing state-change channel and cleanup callback.
func (*Controller) ValidateNodeState ¶
func (c *Controller) ValidateNodeState(state *api.NodeState) error
ValidateNodeState rejects endpoints that do not exactly match current Service contracts.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves authoritative deployment IPv6 records from a replaceable snapshot.
func NewServer ¶
func NewServer() *Server
NewServer constructs an empty authoritative Kubernetes Service DNS handler.