routecfg

package
v1.1.4-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package routecfg contains types for the gateway route

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControlLists

type AccessControlLists struct {
	Blacklist []string `json:"Blacklist,omitempty"`
	Whitelist []string `json:"Whitelist,omitempty"`
}

AccessControlLists is the access control lists configuration

type BackendServiceConfig added in v1.1.1

type BackendServiceConfig struct {
	Weight  int32    `json:"Weight"`
	Filters []Filter `json:"Filters,omitempty" hash:"set"`
}

type Certificate

type Certificate struct {
	CertChain  string `json:"CertChain"`
	PrivateKey string `json:"PrivateKey"`
	IssuingCA  string `json:"IssuingCA,omitempty"`
}

Certificate is the certificate configuration

type Chains

type Chains struct {
	HTTPRoute      []string `json:"HTTPRoute"`
	HTTPSRoute     []string `json:"HTTPSRoute"`
	TLSPassthrough []string `json:"TLSPassthrough"`
	TLSTerminate   []string `json:"TLSTerminate"`
	TCPRoute       []string `json:"TCPRoute"`
}

Chains is the chains configuration

type CircuitBreaker

type CircuitBreaker struct {
	MinRequestAmount        int     `json:"MinRequestAmount"`
	StatTimeWindow          int     `json:"StatTimeWindow"`
	SlowTimeThreshold       float64 `json:"SlowTimeThreshold"`
	SlowAmountThreshold     int     `json:"SlowAmountThreshold"`
	SlowRatioThreshold      float64 `json:"SlowRatioThreshold"`
	ErrorAmountThreshold    int     `json:"ErrorAmountThreshold"`
	ErrorRatioThreshold     float64 `json:"ErrorRatioThreshold"`
	DegradedTimeWindow      int     `json:"DegradedTimeWindow"`
	DegradedStatusCode      int     `json:"DegradedStatusCode"`
	DegradedResponseContent string  `json:"DegradedResponseContent"`
}

CircuitBreaker is the circuit breaker configuration

type ConfigSpec

type ConfigSpec struct {
	Defaults    Defaults                 `json:"Configs"`
	Listeners   []Listener               `json:"Listeners" hash:"set"`
	Certificate *Certificate             `json:"Certificate,omitempty"`
	RouteRules  map[int32]RouteRule      `json:"RouteRules"`
	Services    map[string]ServiceConfig `json:"Services"`
	Chains      Chains                   `json:"Chains"`
	Features    Features                 `json:"Features"`
	Version     string                   `json:"Version" hash:"ignore"`
}

ConfigSpec is the configuration spec for the gateway

type ConnectionSettings

type ConnectionSettings struct {
	TCP  *TCPConnectionSettings  `json:"TCP,omitempty"`
	HTTP *HTTPConnectionSettings `json:"HTTP,omitempty"`
}

ConnectionSettings is the connection settings configuration

type Defaults

type Defaults struct {
	EnableDebug                    bool  `json:"EnableDebug"`
	DefaultPassthroughUpstreamPort int32 `json:"DefaultPassthroughUpstreamPort"`
	StripAnyHostPort               bool  `json:"StripAnyHostPort"`
	HTTP1PerRequestLoadBalancing   bool  `json:"HTTP1PerRequestLoadBalancing"`
	HTTP2PerRequestLoadBalancing   bool  `json:"HTTP2PerRequestLoadBalancing"`
}

Defaults is the default configuration

type Endpoint

type Endpoint struct {
	Weight       int               `json:"Weight"`
	Tags         map[string]string `json:"Tags,omitempty"`
	MTLS         bool              `json:"MTLS,omitempty"`
	UpstreamCert *UpstreamCert     `json:"UpstreamCert,omitempty"`
}

Endpoint is the endpoint configuration

type Features

type Features struct {
	Logging struct{} `json:"Logging"`
	Tracing struct{} `json:"Tracing"`
	Metrics struct{} `json:"Metrics"`
}

Features is the features configuration

type Filter

type Filter interface{}

Filter is the filter configuration

type GRPCMethod

type GRPCMethod struct {
	MatchType MatchType `json:"Type"`
	Service   *string   `json:"Service,omitempty"`
	Method    *string   `json:"Method,omitempty"`
}

GRPCMethod is the GRPC method configuration

type GRPCRouteFilter added in v1.1.1

type GRPCRouteFilter struct {
	// Type identifies the type of filter to apply. As with other API fields,
	// types are classified into three conformance levels:
	Type gwv1alpha2.GRPCRouteFilterType `json:"Type"`

	// RequestHeaderModifier defines a schema for a filter that modifies request
	// headers.
	RequestHeaderModifier *HTTPHeaderFilter `json:"RequestHeaderModifier,omitempty"`

	// ResponseHeaderModifier defines a schema for a filter that modifies response
	// headers.
	ResponseHeaderModifier *HTTPHeaderFilter `json:"ResponseHeaderModifier,omitempty"`

	// RequestMirror defines a schema for a filter that mirrors requests.
	// Requests are sent to the specified destination, but responses from
	// that destination are ignored.
	RequestMirror *HTTPRequestMirrorFilter `json:"RequestMirror,omitempty"`

	// ExtensionRef is an optional, implementation-specific extension to the
	// "filter" behavior.  For example, resource "myroutefilter" in group
	// "networking.example.net"). ExtensionRef MUST NOT be used for core and
	// extended filters.
	ExtensionRef *gwv1alpha2.LocalObjectReference `json:"ExtensionRef,omitempty"`
}

GRPCRouteFilter defines processing steps that must be completed during the request or response lifecycle. GRPCRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.

type GRPCRouteRuleSpec

type GRPCRouteRuleSpec struct {
	RouteType L7RouteType        `json:"RouteType"`
	Matches   []GRPCTrafficMatch `json:"Matches" hash:"set"`
}

GRPCRouteRuleSpec is the GRPC route rule configuration

type GRPCTrafficMatch

type GRPCTrafficMatch struct {
	Headers        map[MatchType]map[string]string `json:"Headers,omitempty"`
	Method         *GRPCMethod                     `json:"Method,omitempty"`
	BackendService map[string]BackendServiceConfig `json:"BackendService"`
	Filters        []Filter                        `json:"Filters,omitempty" hash:"set"`
}

GRPCTrafficMatch is the GRPC traffic match configuration

type HTTPConnectionSettings

type HTTPConnectionSettings struct {
	MaxRequestsPerConnection int             `json:"MaxRequestsPerConnection"`
	MaxPendingRequests       int             `json:"MaxPendingRequests"`
	CircuitBreaker           *CircuitBreaker `json:"CircuitBreaker,omitempty"`
}

HTTPConnectionSettings is the HTTP connection settings configuration

type HTTPHeader added in v1.1.1

type HTTPHeader struct {
	Name  string `json:"Name"`
	Value string `json:"Value"`
}

type HTTPHeaderFilter added in v1.1.1

type HTTPHeaderFilter struct {
	Set    []HTTPHeader `json:"Set,omitempty" hash:"set"`
	Add    []HTTPHeader `json:"Add,omitempty" hash:"set"`
	Remove []string     `json:"Remove,omitempty" hash:"set"`
}

type HTTPPathModifier added in v1.1.1

type HTTPPathModifier struct {
	Type               gwv1beta1.HTTPPathModifierType `json:"Type"`
	ReplaceFullPath    *string                        `json:"ReplaceFullPath,omitempty"`
	ReplacePrefixMatch *string                        `json:"ReplacePrefixMatch,omitempty"`
}

HTTPPathModifier defines configuration for path modifiers.

type HTTPRequestMirrorFilter added in v1.1.1

type HTTPRequestMirrorFilter struct {
	BackendService string `json:"BackendService"`
}

type HTTPRequestRedirectFilter added in v1.1.1

type HTTPRequestRedirectFilter struct {
	Scheme     *string           `json:"Scheme,omitempty"`
	Hostname   *string           `json:"Hostname,omitempty"`
	Path       *HTTPPathModifier `json:"Path,omitempty"`
	Port       *int32            `json:"Port,omitempty"`
	StatusCode *int              `json:"StatusCode,omitempty"`
}

HTTPRequestRedirectFilter defines a filter that redirects a request. This filter MUST NOT be used on the same Route rule as a HTTPURLRewrite filter.

type HTTPRouteFilter added in v1.1.1

type HTTPRouteFilter struct {
	// Type identifies the type of filter to apply. As with other API fields,
	// types are classified into three conformance levels:
	Type gwv1beta1.HTTPRouteFilterType `json:"Type"`

	// RequestHeaderModifier defines a schema for a filter that modifies request
	RequestHeaderModifier *HTTPHeaderFilter `json:"RequestHeaderModifier,omitempty"`

	// ResponseHeaderModifier defines a schema for a filter that modifies response
	ResponseHeaderModifier *HTTPHeaderFilter `json:"ResponseHeaderModifier,omitempty"`

	// RequestMirror defines a schema for a filter that mirrors requests.
	// Requests are sent to the specified destination, but responses from
	// that destination are ignored.
	RequestMirror *HTTPRequestMirrorFilter `json:"RequestMirror,omitempty"`

	// RequestRedirect defines a schema for a filter that responds to the
	// request with an HTTP redirection.
	RequestRedirect *HTTPRequestRedirectFilter `json:"RequestRedirect,omitempty"`

	// URLRewrite defines a schema for a filter that modifies a request during forwarding.
	URLRewrite *HTTPURLRewriteFilter `json:"UrlRewrite,omitempty"`

	// ExtensionRef is an optional, implementation-specific extension to the
	// "filter" behavior.  For example, resource "myroutefilter" in group
	// "networking.example.net"). ExtensionRef MUST NOT be used for core and
	// extended filters.
	ExtensionRef *gwv1beta1.LocalObjectReference `json:"ExtensionRef,omitempty"`
}

HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.

type HTTPRouteRuleSpec

type HTTPRouteRuleSpec struct {
	RouteType L7RouteType        `json:"RouteType"`
	Matches   []HTTPTrafficMatch `json:"Matches" hash:"set"`
	RateLimit *RateLimit         `json:"RateLimit,omitempty"`
}

HTTPRouteRuleSpec is the HTTP route rule configuration

type HTTPTrafficMatch

type HTTPTrafficMatch struct {
	Path           *Path                           `json:"Path,omitempty"`
	Headers        map[MatchType]map[string]string `json:"Headers,omitempty"`
	RequestParams  map[MatchType]map[string]string `json:"RequestParams,omitempty"`
	Methods        []string                        `json:"Methods,omitempty" hash:"set"`
	BackendService map[string]BackendServiceConfig `json:"BackendService"`
	RateLimit      *RateLimit                      `json:"RateLimit,omitempty"`
	Filters        []Filter                        `json:"Filters,omitempty" hash:"set"`
}

HTTPTrafficMatch is the HTTP traffic match configuration

type HTTPURLRewriteFilter added in v1.1.1

type HTTPURLRewriteFilter struct {
	Hostname *string           `json:"Hostname,omitempty"`
	Path     *HTTPPathModifier `json:"Path,omitempty"`
}

HTTPURLRewriteFilter defines a filter that modifies a request during forwarding. At most one of these filters may be used on a Route rule.

type L7RouteRule

type L7RouteRule map[string]L7RouteRuleSpec

L7RouteRule is the L7 route rule configuration

type L7RouteRuleSpec

type L7RouteRuleSpec interface{}

L7RouteRuleSpec is the L7 route rule configuration

type L7RouteType

type L7RouteType string

L7RouteType is the type of route

const (
	// L7RouteTypeHTTP is the HTTP route type
	L7RouteTypeHTTP L7RouteType = "HTTP"

	// L7RouteTypeGRPC is the GRPC route type
	L7RouteTypeGRPC L7RouteType = "GRPC"
)

type Listener

type Listener struct {
	Protocol           gwv1beta1.ProtocolType `json:"Protocol"`
	Port               gwv1beta1.PortNumber   `json:"Port"`
	Listen             gwv1beta1.PortNumber   `json:"Listen"`
	TLS                *TLS                   `json:"TLS,omitempty"`
	AccessControlLists *AccessControlLists    `json:"AccessControlLists,omitempty"`
	BpsLimit           *int64                 `json:"BpsLimit,omitempty"`
}

Listener is the listener configuration

type MatchType

type MatchType string

MatchType is the type of match

const (
	// MatchTypeExact is the exact match type
	MatchTypeExact MatchType = "Exact"

	// MatchTypePrefix is the prefix match type
	MatchTypePrefix MatchType = "Prefix"

	// MatchTypeRegex is the regex match type
	MatchTypeRegex MatchType = "Regex"
)

type PassthroughRouteMapping

type PassthroughRouteMapping map[string]string

PassthroughRouteMapping is the passthrough route mapping configuration

type Path

type Path struct {
	MatchType MatchType `json:"Type"`
	Path      string    `json:"Path"`
}

Path is the path configuration

type RateLimit

type RateLimit struct {
	Backlog              int               `json:"Backlog"`
	Requests             int               `json:"Requests"`
	Burst                int               `json:"Burst"`
	StatTimeWindow       int               `json:"StatTimeWindow"`
	ResponseStatusCode   int               `json:"ResponseStatusCode"`
	ResponseHeadersToAdd map[string]string `json:"ResponseHeadersToAdd,omitempty" hash:"set"`
}

RateLimit is the rate limit configuration

type RetryPolicy

type RetryPolicy struct {
	RetryOn                  string `json:"RetryOn"`
	PerTryTimeout            int    `json:"PerTryTimeout"`
	NumRetries               int    `json:"NumRetries"`
	RetryBackoffBaseInterval int    `json:"RetryBackoffBaseInterval"`
}

RetryPolicy is the retry policy configuration

type RouteRule

type RouteRule interface{}

RouteRule is the route rule configuration

type ServiceConfig

type ServiceConfig struct {
	Endpoints          map[string]Endpoint   `json:"Endpoints"`
	ConnectionSettings *ConnectionSettings   `json:"ConnectionSettings,omitempty"`
	RetryPolicy        *RetryPolicy          `json:"RetryPolicy,omitempty"`
	MTLS               bool                  `json:"MTLS,omitempty"`
	UpstreamCert       *UpstreamCert         `json:"UpstreamCert,omitempty"`
	SessionSticky      bool                  `json:"SessionSticky,omitempty"`
	LoadBalancer       *commons.AlgoBalancer `json:"LoadBalancer,omitempty"`
}

ServiceConfig is the service configuration

type ServicePortName

type ServicePortName struct {
	types.NamespacedName
	Port *int32
}

ServicePortName is a combination of a service name, namespace, and port

func (*ServicePortName) String

func (spn *ServicePortName) String() string

type TCPConnectionSettings

type TCPConnectionSettings struct {
	MaxConnections int `json:"MaxConnections"`
}

TCPConnectionSettings is the TCP connection settings configuration

type TCPRouteRule

type TCPRouteRule map[string]int32

TCPRouteRule is the TCP route rule configuration

type TLS

type TLS struct {
	TLSModeType  gwv1beta1.TLSModeType `json:"TLSModeType"`
	MTLS         bool                  `json:"MTLS,omitempty"`
	Certificates []Certificate         `json:"Certificates,omitempty"`
}

TLS is the TLS configuration

type TLSBackendService

type TLSBackendService map[string]int32

TLSBackendService is the TLS backend service configuration

type TLSPassthroughRouteRule

type TLSPassthroughRouteRule map[string]string

TLSPassthroughRouteRule is the TLS passthrough route rule configuration

type TLSTerminateRouteRule

type TLSTerminateRouteRule map[string]TLSBackendService

TLSTerminateRouteRule is the TLS terminate route rule configuration

type UDPRouteRule

type UDPRouteRule map[string]int32

UDPRouteRule is the UDP route rule configuration

type UpstreamCert

type UpstreamCert Certificate

UpstreamCert is the upstream certificate configuration

Jump to

Keyboard shortcuts

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