route

package
v0.0.0-...-062eff5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderMethod    = ":method"
	HeaderAuthority = ":authority"
	HeaderScheme    = ":scheme"
)

Headers with special meaning in Envoy

Variables

This section is empty.

Functions

func BuildDefaultHTTPRoute

func BuildDefaultHTTPRoute(clusterName string, operation string) *route.Route

BuildDefaultHTTPRoute builds a default route.

func GetDestinationCluster

func GetDestinationCluster(destination *networking.Destination, service *model.Service, listenerPort int) string

GetDestinationCluster generate a cluster name for the route, or error if no cluster can be found. Called by translateRule to determine if

func TranslateRoutes

func TranslateRoutes(
	virtualService model.Config,
	serviceIndex map[model.Hostname]*model.Service,
	port int,
	proxyLabels model.LabelsCollection,
	gatewayNames map[string]bool) ([]route.Route, error)

TranslateRoutes creates virtual host routes from the v1alpha3 config. The rule should be adapted to destination names (outbound clusters). Each rule is guarded by source labels.

This is called for each port to compute virtual hosts. Each VirtualService is tried, with a list of services that listen on the port. Error indicates the given virtualService can't be used on the port.

Types

type GuardedHost

type GuardedHost struct {
	// Port is the capture port (e.g. service port)
	Port int

	// Services are the services matching the virtual host.
	// The service host names need to be contextualized by the source.
	Services []*model.Service

	// Hosts is a list of alternative literal host names for the host.
	Hosts []string

	// Routes in the virtual host
	Routes []route.Route
}

GuardedHost is a context-dependent virtual host entry with guarded routes.

func TranslateVirtualHosts

func TranslateVirtualHosts(
	serviceConfigs []model.Config, services map[model.Hostname]*model.Service, proxyLabels model.LabelsCollection, gatewayNames map[string]bool) []GuardedHost

TranslateVirtualHosts creates the entire routing table for Istio v1alpha3 configs. Services are indexed by FQDN hostnames. Cluster domain is used to resolve short service names (e.g. "svc.cluster.local").

Jump to

Keyboard shortcuts

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