Async::GRPC::XDSSourceAsyncGRPCXDSConfigSource

module ConfigSource

Builds Envoy xDS configuration sources.

Definitions

def ads

Build a configuration source that uses the global ADS server.

Signature

returns Envoy::Config::Core::V3::ConfigSource

The ADS configuration source.

Implementation

def ads
	Envoy::Config::Core::V3::ConfigSource.new(
		ads: Envoy::Config::Core::V3::AggregatedConfigSource.new
	)
end

def grpc(cluster_name)

Build a configuration source for a dedicated gRPC discovery service.

Signature

parameter cluster_name String

The static Envoy cluster used to reach the management server.

returns Envoy::Config::Core::V3::ConfigSource

The gRPC API configuration source.

Implementation

def grpc(cluster_name)
	Envoy::Config::Core::V3::ConfigSource.new(
		resource_api_version: :V3,
		api_config_source: Envoy::Config::Core::V3::ApiConfigSource.new(
			api_type: :GRPC,
			transport_api_version: :V3,
			grpc_services: [
				Envoy::Config::Core::V3::GrpcService.new(
					envoy_grpc: Envoy::Config::Core::V3::GrpcService::EnvoyGrpc.new(
						cluster_name: cluster_name.to_s
					)
				)
			]
		)
	)
end