xdsserverv3

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SniTemp = "outbound_.default_.%s.%s.svc.cluster.local"
)
View Source
const (
	SubsetSep = "|"
)

Variables

View Source
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

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) GetPort

func (x *XDSServer) GetPort() uint32

GetPort 服务注册到北极星中的端口

func (*XDSServer) GetProtocol

func (x *XDSServer) GetProtocol() string

GetProtocol 服务注册到北极星中的协议

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) OnFetch added in v1.16.0

func (x *XDSServer) OnFetch(ctx context.Context, request *cachev3.Request)

OnFetch before call cachev3.SnapshotCache OnFetch

func (*XDSServer) Restart

func (x *XDSServer) Restart(option map[string]interface{}, apiConf map[string]apiserver.APIConfig,
	errCh chan error) error

Restart 重启服务

func (*XDSServer) Run

func (x *XDSServer) Run(errCh chan error)

Run 启动运行

func (*XDSServer) Stop

func (x *XDSServer) Stop()

Stop 停止服务

func (*XDSServer) StreamHealthCheck added in v1.18.0

  1. 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.).
  2. 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
  3. 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.
  4. Envoy reports results back in an EndpointHealthResponse message. Envoy streams responses as often as the interval configured by the management server in HealthCheckSpecifier.
  5. The management Server collects health statuses for all endpoints in the cluster (for all clusters) and uses this information to construct EndpointDiscoveryResponse messages.
  6. 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 资源缓存数据信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL