Documentation ¶
Index ¶
- Constants
- Variables
- type CDSBuilder
- type CurrentServiceInfoProvider
- type EDSBuilder
- type LDSBuilder
- type RDSBuilder
- type ResourceServer
- type ServiceInfos
- type VHDSBuilder
- type XDSServer
- func (x *XDSServer) DebugHandlers() []model.DebugHandler
- func (x *XDSServer) FetchHealthCheck(ctx context.Context, ...) (*healthservice.HealthCheckSpecifier, error)
- func (x *XDSServer) Generate(needPush, needRemove ServiceInfos)
- func (x *XDSServer) GetPort() uint32
- func (x *XDSServer) GetProtocol() string
- func (x *XDSServer) Initialize(ctx context.Context, option map[string]interface{}, ...) error
- func (x *XDSServer) OnCreateDeltaWatch(request *cachev3.DeltaRequest, state stream.StreamState, ...)
- func (x *XDSServer) OnCreateWatch(request *cachev3.Request, streamState stream.StreamState, ...)
- func (x *XDSServer) OnFetch(ctx context.Context, request *cachev3.Request)
- func (x *XDSServer) Restart(option map[string]interface{}, apiConf map[string]apiserver.APIConfig, ...) error
- func (x *XDSServer) Run(errCh chan error)
- func (x *XDSServer) Stop()
- func (x *XDSServer) StreamHealthCheck(checksvr healthservice.HealthDiscoveryService_StreamHealthCheckServer) error
- type XdsResourceGenerator
Constants ¶
const (
SniTemp = "outbound_.default_.%s.%s.svc.cluster.local"
)
const (
SubsetSep = "|"
)
Variables ¶
var (
ErrorNoSupportXDSType = errors.New("unsupport xds build type")
)
Functions ¶
This section is empty.
Types ¶
type CDSBuilder ¶ added in v1.17.3
type CDSBuilder struct {
// contains filtered or unexported fields
}
CDSBuilder .
func (*CDSBuilder) Generate ¶ added in v1.17.3
func (cds *CDSBuilder) Generate(option *resource.BuildOption) (interface{}, error)
func (*CDSBuilder) GenerateByDirection ¶ added in v1.17.3
func (cds *CDSBuilder) GenerateByDirection(option *resource.BuildOption, direction corev3.TrafficDirection) ([]types.Resource, error)
func (*CDSBuilder) Init ¶ added in v1.17.3
func (cds *CDSBuilder) Init(svr service.DiscoverServer)
type CurrentServiceInfoProvider ¶ added in v1.18.0
type CurrentServiceInfoProvider func() ServiceInfos
type EDSBuilder ¶ added in v1.17.3
type EDSBuilder struct { }
EDSBuilder .
func (*EDSBuilder) Generate ¶ added in v1.17.3
func (eds *EDSBuilder) Generate(option *resource.BuildOption) (interface{}, error)
func (*EDSBuilder) Init ¶ added in v1.17.3
func (eds *EDSBuilder) Init(svr service.DiscoverServer)
type LDSBuilder ¶ added in v1.17.3
type LDSBuilder struct {
// contains filtered or unexported fields
}
LDSBuilder .
func (*LDSBuilder) Generate ¶ added in v1.17.3
func (lds *LDSBuilder) Generate(option *resource.BuildOption) (interface{}, error)
func (*LDSBuilder) Init ¶ added in v1.17.3
func (lds *LDSBuilder) Init(svr service.DiscoverServer)
type RDSBuilder ¶ added in v1.17.3
type RDSBuilder struct { VHDSBuilder // contains filtered or unexported fields }
RDSBuilder .
func (*RDSBuilder) Generate ¶ added in v1.17.3
func (rds *RDSBuilder) Generate(option *resource.BuildOption) (interface{}, error)
func (*RDSBuilder) Init ¶ added in v1.17.3
func (rds *RDSBuilder) Init(svr service.DiscoverServer)
type ResourceServer ¶ added in v1.17.3
type ResourceServer interface {
Generate(versionLocal string, registryInfo ServiceInfos)
}
type ServiceInfos ¶ added in v1.18.0
type ServiceInfos map[string]map[model.ServiceKey]*resource.ServiceInfo
type VHDSBuilder ¶ added in v1.18.0
type VHDSBuilder struct {
// contains filtered or unexported fields
}
func (*VHDSBuilder) Generate ¶ added in v1.18.0
func (vhds *VHDSBuilder) Generate(option *resource.BuildOption) (interface{}, error)
Generate
func (*VHDSBuilder) Init ¶ added in v1.18.0
func (vhds *VHDSBuilder) Init(svr service.DiscoverServer)
Init
type XDSServer ¶
type XDSServer struct {
// contains filtered or unexported fields
}
XDSServer is the xDS server
func (*XDSServer) DebugHandlers ¶ added in v1.18.0
func (x *XDSServer) DebugHandlers() []model.DebugHandler
func (*XDSServer) FetchHealthCheck ¶ added in v1.18.0
func (x *XDSServer) FetchHealthCheck(ctx context.Context, req *healthservice.HealthCheckRequestOrEndpointHealthResponse) (*healthservice.HealthCheckSpecifier, error)
TODO(htuch): Unlike the gRPC version, there is no stream-based binding of request/response. Should we add an identifier to the HealthCheckSpecifier to bind with the response?
func (*XDSServer) Generate ¶ added in v1.17.3
func (x *XDSServer) Generate(needPush, needRemove ServiceInfos)
func (*XDSServer) Initialize ¶
func (x *XDSServer) Initialize(ctx context.Context, option map[string]interface{}, apiConf map[string]apiserver.APIConfig) error
Initialize 初始化
func (*XDSServer) OnCreateDeltaWatch ¶ added in v1.16.0
func (x *XDSServer) OnCreateDeltaWatch(request *cachev3.DeltaRequest, state stream.StreamState, value chan cachev3.DeltaResponse)
OnCreateDeltaWatch before call cachev3.SnapshotCache OnCreateDeltaWatch
func (*XDSServer) OnCreateWatch ¶ added in v1.16.0
func (x *XDSServer) OnCreateWatch(request *cachev3.Request, streamState stream.StreamState, value chan cachev3.Response)
OnCreateWatch before call cachev3.SnapshotCache CreateWatch
func (*XDSServer) Restart ¶
func (x *XDSServer) Restart(option map[string]interface{}, apiConf map[string]apiserver.APIConfig, errCh chan error) error
Restart 重启服务
func (*XDSServer) StreamHealthCheck ¶ added in v1.18.0
func (x *XDSServer) StreamHealthCheck(checksvr healthservice.HealthDiscoveryService_StreamHealthCheckServer) error
- Envoy starts up and if its can_healthcheck option in the static bootstrap config is enabled, sends HealthCheckRequest to the management server. It supplies its capabilities (which protocol it can health check with, what zone it resides in, etc.).
- In response to (1), the management server designates this Envoy as a healthchecker to health check a subset of all upstream hosts for a given cluster (for example upstream Host 1 and Host 2). It streams HealthCheckSpecifier messages with cluster related configuration for all clusters this Envoy is designated to health check. Subsequent HealthCheckSpecifier message will be sent on changes to: a. Endpoints to health checks b. Per cluster configuration change
- Envoy creates a health probe based on the HealthCheck config and sends it to endpoint(ip:port) of Host 1 and 2. Based on the HealthCheck configuration Envoy waits upon the arrival of the probe response and looks at the content of the response to decide whether the endpoint is healthy or not. If a response hasn't been received within the timeout interval, the endpoint health status is considered TIMEOUT.
- Envoy reports results back in an EndpointHealthResponse message. Envoy streams responses as often as the interval configured by the management server in HealthCheckSpecifier.
- The management Server collects health statuses for all endpoints in the cluster (for all clusters) and uses this information to construct EndpointDiscoveryResponse messages.
- Once Envoy has a list of upstream endpoints to send traffic to, it load balances traffic to them without additional health checking. It may use inline healthcheck (i.e. consider endpoint UNHEALTHY if connection failed to a particular endpoint to account for health status propagation delay between HDS and EDS).
By default, can_healthcheck is true. If can_healthcheck is false, Cluster configuration may not contain HealthCheck message. TODO(htuch): How is can_healthcheck communicated to CDS to ensure the above invariant? TODO(htuch): Add @amb67's diagram.
type XdsResourceGenerator ¶ added in v1.17.3
type XdsResourceGenerator struct {
// contains filtered or unexported fields
}
XdsResourceGenerator is the xDS resource generator
func (*XdsResourceGenerator) Generate ¶ added in v1.17.3
func (x *XdsResourceGenerator) Generate(versionLocal string, needUpdate, needRemove ServiceInfos)
Generate 构建 XDS 资源缓存数据信息