Documentation ¶
Overview ¶
Package server provides an implementation of a streaming xDS server.
Package server provides an implementation of a streaming xDS server.
Index ¶
- Constants
- func GetValidKeys(proxies v1.ProxyList, extensionKeys map[string]struct{}) []string
- func NewSnapshotFromResources(endpoints cache.Resources, clusters cache.Resources, routes cache.Resources, ...) cache.Snapshot
- func SetEdsOnCluster(out *envoy_config_cluster_v3.Cluster, settings *v1.Settings)
- func SetupEnvoyXds(grpcServer *grpc.Server, xdsServer envoyserver.Server, ...)
- func SnapshotKey(proxy *v1.Proxy) string
- type EnvoyServerV2
- type EnvoyServerV3
- type EnvoySnapshot
- type ProxyKeyHasher
Constants ¶
const FallbackNodeKey = "misconfigured-node"
used to let nodes know they have a bad config we assign a "fix me" snapshot for bad nodes
Variables ¶
This section is empty.
Functions ¶
func GetValidKeys ¶ added in v1.3.20
Called in Syncer when a new set of proxies arrive used to trim snapshots whose proxies have been deleted
func SetEdsOnCluster ¶ added in v0.13.16
func SetEdsOnCluster(out *envoy_config_cluster_v3.Cluster, settings *v1.Settings)
func SetupEnvoyXds ¶
func SetupEnvoyXds(grpcServer *grpc.Server, xdsServer envoyserver.Server, envoyCache envoycache.SnapshotCache)
register xDS methods with GRPC server
func SnapshotKey ¶
SnapshotKey of Proxy == Role in Envoy Configmap == "Node" in Envoy semantics
Types ¶
type EnvoyServerV2 ¶ added in v1.6.0
type EnvoyServerV2 interface { v2.EndpointDiscoveryServiceServer v2.ClusterDiscoveryServiceServer v2.RouteDiscoveryServiceServer v2.ListenerDiscoveryServiceServer envoy_service_discovery_v2.AggregatedDiscoveryServiceServer }
Server is a collection of handlers for streaming discovery requests.
func NewEnvoyServerV2 ¶ added in v1.6.0
func NewEnvoyServerV2(genericServer server.Server) EnvoyServerV2
NewServer creates handlers from a config watcher and an optional logger.
type EnvoyServerV3 ¶ added in v1.6.0
type EnvoyServerV3 interface { envoy_service_endpoint_v3.EndpointDiscoveryServiceServer envoy_service_cluster_v3.ClusterDiscoveryServiceServer envoy_service_route_v3.RouteDiscoveryServiceServer envoy_service_listener_v3.ListenerDiscoveryServiceServer envoy_service_discovery_v3.AggregatedDiscoveryServiceServer }
Server is a collection of handlers for streaming discovery requests.
func NewEnvoyServerV3 ¶ added in v1.6.0
func NewEnvoyServerV3(genericServer server.Server) EnvoyServerV3
NewServer creates handlers from a config watcher and an optional logger.
type EnvoySnapshot ¶
type EnvoySnapshot struct { // Endpoints are items in the EDS V3 response payload. Endpoints cache.Resources // Clusters are items in the CDS response payload. Clusters cache.Resources // Routes are items in the RDS response payload. Routes cache.Resources // Listeners are items in the LDS response payload. Listeners cache.Resources // contains filtered or unexported fields }
Snapshot is an internally consistent snapshot of xDS resources. Consistently is important for the convergence as different resource types from the snapshot may be delivered to the proxy in arbitrary order.
func NewSnapshot ¶
func NewSnapshot( version string, endpoints []cache.Resource, clusters []cache.Resource, routes []cache.Resource, listeners []cache.Resource, ) *EnvoySnapshot
NewSnapshot creates a snapshot from response types and a version.
func (*EnvoySnapshot) Clone ¶ added in v0.15.0
func (s *EnvoySnapshot) Clone() cache.Snapshot
func (*EnvoySnapshot) Consistent ¶
func (s *EnvoySnapshot) Consistent() error
Consistent check verifies that the dependent resources are exactly listed in the snapshot: - all EDS resources are listed by name in CDS resources - all RDS resources are listed by name in LDS resources
Note that clusters and listeners are requested without name references, so Envoy will accept the snapshot list of clusters as-is even if it does not match all references found in xDS.
func (*EnvoySnapshot) GetResources ¶
func (s *EnvoySnapshot) GetResources(typ string) cache.Resources
GetResources selects snapshot resources by type.
type ProxyKeyHasher ¶
type ProxyKeyHasher struct{}
Returns the node.metadata.role from the envoy bootstrap config if not found, it returns a key for the Fallback snapshot which alerts the user their Envoy is missing the required role key.
func NewNodeHasher ¶ added in v0.19.0
func NewNodeHasher() *ProxyKeyHasher
func (*ProxyKeyHasher) ID ¶
func (h *ProxyKeyHasher) ID(node *envoy_config_core_v3.Node) string