v1alpha3

package
v0.0.0-...-fd0897c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLbType set to round robin
	DefaultLbType = networking.LoadBalancerSettings_ROUND_ROBIN
	// ManagementClusterHostname indicates the hostname used for building inbound clusters for management ports
	ManagementClusterHostname = "mgmtCluster"
)
View Source
const (
	HeaderMethod    = ":method"
	HeaderAuthority = ":authority"
	HeaderScheme    = ":scheme"
)

Headers with special meaning in Envoy

View Source
const (
	// UnresolvedCluster for destinations pointing to unknown clusters.
	UnresolvedCluster = "unresolved-cluster"

	// DefaultRoute is the default decorator
	DefaultRoute = "default-route"
)
View Source
const (

	// HTTPStatPrefix indicates envoy stat prefix for http listeners
	HTTPStatPrefix = "http"

	// RDSName is the name of route-discovery-service (RDS) cluster
	RDSName = "rds"

	// RDSHttpProxy is the special name for HTTP PROXY route
	RDSHttpProxy = "http_proxy"

	// VirtualListenerName is the name for traffic capture listener
	VirtualListenerName = "virtual"

	// WildcardAddress binds to all IP addresses
	WildcardAddress = "0.0.0.0"

	// LocalhostAddress for local binding
	LocalhostAddress = "127.0.0.1"
)

Variables

View Source
var ListenersALPNProtocols = []string{"h2", "http/1.1"}

ListenersALPNProtocols denotes the the list of ALPN protocols that the listener should expose

Functions

func MatchServiceHosts

func MatchServiceHosts(in model.Config, serviceIndex map[string]*model.Service) ([]string, []*model.Service)

MatchServiceHosts splits the virtual service hosts into services and literal hosts

func TranslateCORSPolicy

func TranslateCORSPolicy(in *networking.CorsPolicy) *route.CorsPolicy

TranslateCORSPolicy translates CORS policy

func TranslateHeaderMatcher

func TranslateHeaderMatcher(name string, in *networking.StringMatch) route.HeaderMatcher

TranslateHeaderMatcher translates to HeaderMatcher

func TranslateRetryPolicy

func TranslateRetryPolicy(in *networking.HTTPRetry) *route.RouteAction_RetryPolicy

TranslateRetryPolicy translates retry policy

func TranslateRouteMatch

func TranslateRouteMatch(in *networking.HTTPMatchRequest) route.RouteMatch

TranslateRouteMatch translates match condition

func TranslateTime

func TranslateTime(in *types.Duration) *time.Duration

TranslateTime converts time protos.

Types

type ClusterNaming

type ClusterNaming func(*networking.Destination) string

ClusterNaming specifies cluster name for a destination

func TranslateDestination

func TranslateDestination(
	serviceIndex map[string]*model.Service,
	defaultPort int) ClusterNaming

TranslateDestination produces a cluster naming function using the config context.

type ConfigGeneratorImpl

type ConfigGeneratorImpl struct {
	// List of plugins that modify code generated by this config generator
	Plugins []plugin.Plugin
}

func NewConfigGenerator

func NewConfigGenerator(plugins []plugin.Plugin) *ConfigGeneratorImpl

func (*ConfigGeneratorImpl) BuildClusters

func (configgen *ConfigGeneratorImpl) BuildClusters(env model.Environment, proxy model.Proxy) ([]*v2.Cluster, error)

BuildClusters returns the list of clusters for the given proxy. This is the CDS output For outbound: Cluster for each service/subset hostname or cidr with SNI set to service hostname Cluster type based on resolution For inbound (sidecar only): Cluster for each inbound endpoint port and for each service port

func (*ConfigGeneratorImpl) BuildListeners

func (configgen *ConfigGeneratorImpl) BuildListeners(env model.Environment,
	node model.Proxy) ([]*xdsapi.Listener, error)

BuildListeners produces a list of listeners and referenced clusters for all proxies

func (*ConfigGeneratorImpl) BuildRoutes

func (_ *ConfigGeneratorImpl) BuildRoutes(env model.Environment, node model.Proxy, routeName string) ([]*xdsapi.RouteConfiguration, error)

TODO

type DeprecatedFilterConfigInV2

type DeprecatedFilterConfigInV2 struct {
	DeprecatedV1 bool                            `json:"deprecated_v1"`
	Value        *DeprecatedTCPProxyFilterConfig `json:"value"`
}

DeprecatedFilterConfigInV2 definition

type DeprecatedTCPProxyFilterConfig

type DeprecatedTCPProxyFilterConfig struct {
	StatPrefix  string                    `json:"stat_prefix"`
	RouteConfig *DeprecatedTCPRouteConfig `json:"route_config"`
}

DeprecatedTCPProxyFilterConfig definition

type DeprecatedTCPRoute

type DeprecatedTCPRoute struct {
	Cluster           string   `json:"cluster"`
	DestinationIPList []string `json:"destination_ip_list,omitempty"`
	DestinationPorts  string   `json:"destination_ports,omitempty"`
	SourceIPList      []string `json:"source_ip_list,omitempty"`
	SourcePorts       string   `json:"source_ports,omitempty"`
}

DeprecatedTCPRoute definition

type DeprecatedTCPRouteByRoute

type DeprecatedTCPRouteByRoute []*DeprecatedTCPRoute

DeprecatedTCPRouteByRoute sorts TCP routes over all route sub fields.

func (DeprecatedTCPRouteByRoute) Len

func (DeprecatedTCPRouteByRoute) Less

func (r DeprecatedTCPRouteByRoute) Less(i, j int) bool

func (DeprecatedTCPRouteByRoute) Swap

func (r DeprecatedTCPRouteByRoute) Swap(i, j int)

type DeprecatedTCPRouteConfig

type DeprecatedTCPRouteConfig struct {
	Routes []*DeprecatedTCPRoute `json:"routes"`
}

DeprecatedTCPRouteConfig (or generalize as RouteConfig or L4RouteConfig for TCP/UDP?)

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 []GuardedRoute
}

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

func TranslateVirtualHost

func TranslateVirtualHost(in model.Config, serviceIndex map[string]*model.Service) []GuardedHost

TranslateVirtualHost creates virtual hosts corresponding to a virtual service.

func TranslateVirtualHosts

func TranslateVirtualHosts(
	serviceConfigs []model.Config,
	services map[string]*model.Service) []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").

type GuardedRoute

type GuardedRoute struct {
	route.Route

	// SourceLabels guarding the route
	SourceLabels map[string]string

	// Gateways pre-condition
	Gateways []string
}

GuardedRoute are routes for a destination guarded by deployment conditions.

func TranslateRoute

func TranslateRoute(in *networking.HTTPRoute,
	match *networking.HTTPMatchRequest,
	operation string,
	name ClusterNaming) GuardedRoute

TranslateRoute translates HTTP routes TODO: fault filters -- issue https://github.com/istio/api/issues/388

func TranslateRoutes

func TranslateRoutes(in model.Config, name ClusterNaming) []GuardedRoute

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.

Jump to

Keyboard shortcuts

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