Documentation ¶
Index ¶
- Constants
- func EDSz(w http.ResponseWriter, req *http.Request)
- func PushAll()
- type ConfigCache
- func (cache *ConfigCache) ID(node *core.Node) string
- func (cache *ConfigCache) OnConfigEvent(svc model.Config, event model.Event)
- func (cache *ConfigCache) OnFetchRequest(*v2.DiscoveryRequest)
- func (cache *ConfigCache) OnFetchResponse(*v2.DiscoveryRequest, *v2.DiscoveryResponse)
- func (cache *ConfigCache) OnServiceEvent(svc *model.Service, event model.Event)
- func (cache *ConfigCache) OnStreamClosed(int64)
- func (cache *ConfigCache) OnStreamOpen(int64, string)
- func (cache *ConfigCache) OnStreamRequest(int64, *v2.DiscoveryRequest)
- func (cache *ConfigCache) OnStreamResponse(int64, *v2.DiscoveryRequest, *v2.DiscoveryResponse)
- func (cache *ConfigCache) Register(grpcServer *grpc.Server)
- func (cache *ConfigCache) RegisterInput(services model.Controller, configs model.ConfigStoreCache)
- type DiscoveryServer
- func (s *DiscoveryServer) FetchEndpoints(ctx context.Context, req *xdsapi.DiscoveryRequest) (*xdsapi.DiscoveryResponse, error)
- func (s *DiscoveryServer) InitDebug(mux *http.ServeMux, sctl *aggregate.Controller)
- func (s *DiscoveryServer) StreamAggregatedResources(stream ads.AggregatedDiscoveryService_StreamAggregatedResourcesServer) error
- func (s *DiscoveryServer) StreamEndpoints(stream xdsapi.EndpointDiscoveryService_StreamEndpointsServer) error
- func (s *DiscoveryServer) StreamLoadStats(xdsapi.EndpointDiscoveryService_StreamEndpointsServer) error
- type EdsCluster
- type MemServiceDiscovery
- func (sd *MemServiceDiscovery) AddEndpoint(service, servicePortName string, servicePort int, address string, port int) *model.ServiceInstance
- func (sd *MemServiceDiscovery) AddInstance(service string, instance *model.ServiceInstance)
- func (sd *MemServiceDiscovery) AddService(name string, svc *model.Service)
- func (sd *MemServiceDiscovery) ClearErrors()
- func (sd *MemServiceDiscovery) GetIstioServiceAccounts(hostname string, ports []string) []string
- func (sd *MemServiceDiscovery) GetProxyServiceInstances(node model.Proxy) ([]*model.ServiceInstance, error)
- func (sd *MemServiceDiscovery) GetService(hostname string) (*model.Service, error)
- func (sd *MemServiceDiscovery) Instances(hostname string, ports []string, labels model.LabelsCollection) ([]*model.ServiceInstance, error)
- func (sd *MemServiceDiscovery) ManagementPorts(addr string) model.PortList
- func (sd *MemServiceDiscovery) Services() ([]*model.Service, error)
- type XdsConnection
- type XdsEvent
Constants ¶
const ( // ClusterType is used for cluster discovery. Typically first request received ClusterType = typePrefix + "Cluster" // EndpointType is used for EDS and ADS endpoint discovery. Typically second request. EndpointType = typePrefix + "ClusterLoadAssignment" // ListenerType is sent after clusters and endpoints. ListenerType = typePrefix + "Listener" // RouteType is sent after listeners. RouteType = typePrefix + "Route" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigCache ¶
type ConfigCache struct {
// contains filtered or unexported fields
}
ConfigCache for xDS resources
func NewConfigCache ¶
func NewConfigCache(services model.ServiceDiscovery, configs model.ConfigStore) *ConfigCache
NewConfigCache spins up a new config cache
func (*ConfigCache) OnConfigEvent ¶
func (cache *ConfigCache) OnConfigEvent(svc model.Config, event model.Event)
OnConfigEvent ...
func (*ConfigCache) OnFetchRequest ¶
func (cache *ConfigCache) OnFetchRequest(*v2.DiscoveryRequest)
OnFetchRequest ...
func (*ConfigCache) OnFetchResponse ¶
func (cache *ConfigCache) OnFetchResponse(*v2.DiscoveryRequest, *v2.DiscoveryResponse)
OnFetchResponse ...
func (*ConfigCache) OnServiceEvent ¶
func (cache *ConfigCache) OnServiceEvent(svc *model.Service, event model.Event)
OnServiceEvent ...
func (*ConfigCache) OnStreamClosed ¶
func (cache *ConfigCache) OnStreamClosed(int64)
OnStreamClosed ...
func (*ConfigCache) OnStreamOpen ¶
func (cache *ConfigCache) OnStreamOpen(int64, string)
OnStreamOpen ...
func (*ConfigCache) OnStreamRequest ¶
func (cache *ConfigCache) OnStreamRequest(int64, *v2.DiscoveryRequest)
OnStreamRequest ...
func (*ConfigCache) OnStreamResponse ¶
func (cache *ConfigCache) OnStreamResponse(int64, *v2.DiscoveryRequest, *v2.DiscoveryResponse)
OnStreamResponse ...
func (*ConfigCache) Register ¶
func (cache *ConfigCache) Register(grpcServer *grpc.Server)
Register with gRPC server
func (*ConfigCache) RegisterInput ¶
func (cache *ConfigCache) RegisterInput(services model.Controller, configs model.ConfigStoreCache)
RegisterInput connects with the controllers
type DiscoveryServer ¶
type DiscoveryServer struct { // GrpcServer supports gRPC for xDS v2 services. GrpcServer *grpc.Server // MemRegistry is used for debug and load testing, allow adding services. Visible for testing. MemRegistry *MemServiceDiscovery // ConfigGenerator is responsible for generating data plane configuration using Istio networking // APIs and service registry info ConfigGenerator *v1alpha3.ConfigGeneratorImpl // contains filtered or unexported fields }
DiscoveryServer is Pilot's gRPC implementation for Envoy's v2 xds APIs
func NewDiscoveryServer ¶
func NewDiscoveryServer(grpcServer *grpc.Server, env model.Environment, generator *v1alpha3.ConfigGeneratorImpl) *DiscoveryServer
NewDiscoveryServer creates DiscoveryServer that sources data from Pilot's internal mesh data structures
func (*DiscoveryServer) FetchEndpoints ¶
func (s *DiscoveryServer) FetchEndpoints(ctx context.Context, req *xdsapi.DiscoveryRequest) (*xdsapi.DiscoveryResponse, error)
FetchEndpoints implements xdsapi.EndpointDiscoveryServiceServer.FetchEndpoints().
func (*DiscoveryServer) InitDebug ¶
func (s *DiscoveryServer) InitDebug(mux *http.ServeMux, sctl *aggregate.Controller)
InitDebug initializes the debug handlers and adds a debug in-memory registry.
func (*DiscoveryServer) StreamAggregatedResources ¶
func (s *DiscoveryServer) StreamAggregatedResources(stream ads.AggregatedDiscoveryService_StreamAggregatedResourcesServer) error
StreamAggregatedResources implements the ADS interface.
func (*DiscoveryServer) StreamEndpoints ¶
func (s *DiscoveryServer) StreamEndpoints(stream xdsapi.EndpointDiscoveryService_StreamEndpointsServer) error
StreamEndpoints implements xdsapi.EndpointDiscoveryServiceServer.StreamEndpoints().
func (*DiscoveryServer) StreamLoadStats ¶
func (s *DiscoveryServer) StreamLoadStats(xdsapi.EndpointDiscoveryService_StreamEndpointsServer) error
StreamLoadStats implements xdsapi.EndpointDiscoveryServiceServer.StreamLoadStats().
type EdsCluster ¶
type EdsCluster struct { LoadAssignment *xdsapi.ClusterLoadAssignment // FirstUse is the time the cluster was first used, for debugging FirstUse time.Time // EdsClients keeps track of all nodes monitoring the cluster. EdsClients map[string]*XdsConnection // NonEmptyTime is the time the cluster first had a non-empty set of endpoints NonEmptyTime time.Time // contains filtered or unexported fields }
EdsCluster tracks eds-related info for monitored clusters. In practice it'll include all clusters until we support on-demand cluster loading.
type MemServiceDiscovery ¶
type MemServiceDiscovery struct { WantGetProxyServiceInstances []*model.ServiceInstance ServicesError error GetServiceError error InstancesError error GetProxyServiceInstancesError error // contains filtered or unexported fields }
MemServiceDiscovery is a mock discovery interface
func NewMemServiceDiscovery ¶
func NewMemServiceDiscovery(services map[string]*model.Service, versions int) *MemServiceDiscovery
NewMemServiceDiscovery builds an in-memory MemServiceDiscovery
func (*MemServiceDiscovery) AddEndpoint ¶
func (sd *MemServiceDiscovery) AddEndpoint(service, servicePortName string, servicePort int, address string, port int) *model.ServiceInstance
AddEndpoint adds an endpoint to a service.
func (*MemServiceDiscovery) AddInstance ¶
func (sd *MemServiceDiscovery) AddInstance(service string, instance *model.ServiceInstance)
AddInstance adds an in-memory instance.
func (*MemServiceDiscovery) AddService ¶
func (sd *MemServiceDiscovery) AddService(name string, svc *model.Service)
AddService adds an in-memory service.
func (*MemServiceDiscovery) ClearErrors ¶
func (sd *MemServiceDiscovery) ClearErrors()
ClearErrors clear errors used for mocking failures during model.MemServiceDiscovery interface methods
func (*MemServiceDiscovery) GetIstioServiceAccounts ¶
func (sd *MemServiceDiscovery) GetIstioServiceAccounts(hostname string, ports []string) []string
GetIstioServiceAccounts gets the Istio service accounts for a service hostname.
func (*MemServiceDiscovery) GetProxyServiceInstances ¶
func (sd *MemServiceDiscovery) GetProxyServiceInstances(node model.Proxy) ([]*model.ServiceInstance, error)
GetProxyServiceInstances returns service instances associated with a node, resulting in 'in' services.
func (*MemServiceDiscovery) GetService ¶
func (sd *MemServiceDiscovery) GetService(hostname string) (*model.Service, error)
GetService implements discovery interface
func (*MemServiceDiscovery) Instances ¶
func (sd *MemServiceDiscovery) Instances(hostname string, ports []string, labels model.LabelsCollection) ([]*model.ServiceInstance, error)
Instances filters the service instances by labels. This assumes single port, as is used by EDS/ADS.
func (*MemServiceDiscovery) ManagementPorts ¶
func (sd *MemServiceDiscovery) ManagementPorts(addr string) model.PortList
ManagementPorts implements discovery interface
type XdsConnection ¶
type XdsConnection struct { // PeerAddr is the address of the client envoy, from network layer PeerAddr string // Time of connection, for debugging Connect time.Time // ConID is the connection identifier, used as a key in the connection table. // Currently based on the node name and a counter. ConID string HTTPListeners []*xdsapi.Listener RouteConfigs map[string][]*xdsapi.RouteConfiguration // current list of clusters monitored by the client Clusters []string // Routes is the list of watched Routes. Routes []string // LDSWatch is set if the remote server is watching Listeners LDSWatch bool // CDSWatch is set if the remote server is watching Clusters CDSWatch bool // contains filtered or unexported fields }
XdsConnection is a listener connection type.