v1

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 33 Imported by: 49

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GatewayCrd = crd.NewCrd(
		"gateways",
		GatewayGVK.Group,
		GatewayGVK.Version,
		GatewayGVK.Kind,
		"gw",
		false,
		&Gateway{})
)
View Source
var (
	GatewayGVK = schema.GroupVersionKind{
		Version: "v1",
		Group:   "gateway.solo.io",
		Kind:    "Gateway",
	}
)
View Source
var (
	RouteTableCrd = crd.NewCrd(
		"routetables",
		RouteTableGVK.Group,
		RouteTableGVK.Version,
		RouteTableGVK.Kind,
		"rt",
		false,
		&RouteTable{})
)
View Source
var (
	RouteTableGVK = schema.GroupVersionKind{
		Version: "v1",
		Group:   "gateway.solo.io",
		Kind:    "RouteTable",
	}
)
View Source
var (
	VirtualServiceCrd = crd.NewCrd(
		"virtualservices",
		VirtualServiceGVK.Group,
		VirtualServiceGVK.Version,
		VirtualServiceGVK.Kind,
		"vs",
		false,
		&VirtualService{})
)
View Source
var (
	VirtualServiceGVK = schema.GroupVersionKind{
		Version: "v1",
		Group:   "gateway.solo.io",
		Kind:    "VirtualService",
	}
)

Functions

func NewApiEventLoop

func NewApiEventLoop(emitter ApiSnapshotEmitter, syncer ApiSyncer) eventloop.EventLoop

func NewApiSimpleEventLoop added in v0.13.21

func NewApiSimpleEventLoop(emitter ApiSimpleEmitter, syncers ...ApiSyncer) eventloop.SimpleEventLoop

Types

type ApiEmitter

type ApiEmitter interface {
	ApiSnapshotEmitter
	Register() error
	VirtualService() VirtualServiceClient
	RouteTable() RouteTableClient
	Gateway() GatewayClient
}

func NewApiEmitter

func NewApiEmitter(virtualServiceClient VirtualServiceClient, routeTableClient RouteTableClient, gatewayClient GatewayClient) ApiEmitter

func NewApiEmitterWithEmit

func NewApiEmitterWithEmit(virtualServiceClient VirtualServiceClient, routeTableClient RouteTableClient, gatewayClient GatewayClient, emit <-chan struct{}) ApiEmitter

type ApiSimpleEmitter added in v0.13.21

type ApiSimpleEmitter interface {
	Snapshots(ctx context.Context) (<-chan *ApiSnapshot, <-chan error, error)
}

func NewApiSimpleEmitter added in v0.13.21

func NewApiSimpleEmitter(aggregatedWatch clients.ResourceWatch) ApiSimpleEmitter

func NewApiSimpleEmitterWithEmit added in v0.13.21

func NewApiSimpleEmitterWithEmit(aggregatedWatch clients.ResourceWatch, emit <-chan struct{}) ApiSimpleEmitter

type ApiSnapshot

type ApiSnapshot struct {
	VirtualServices VirtualServiceList
	RouteTables     RouteTableList
	Gateways        GatewayList
}

func (ApiSnapshot) Clone

func (s ApiSnapshot) Clone() ApiSnapshot

func (ApiSnapshot) Hash

func (s ApiSnapshot) Hash() uint64

func (ApiSnapshot) HashFields

func (s ApiSnapshot) HashFields() []zap.Field

func (ApiSnapshot) Stringer

func (s ApiSnapshot) Stringer() ApiSnapshotStringer

type ApiSnapshotEmitter added in v1.0.0

type ApiSnapshotEmitter interface {
	Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *ApiSnapshot, <-chan error, error)
}

type ApiSnapshotStringer

type ApiSnapshotStringer struct {
	Version         uint64
	VirtualServices []string
	RouteTables     []string
	Gateways        []string
}

func (ApiSnapshotStringer) String

func (ss ApiSnapshotStringer) String() string

type ApiSyncDecider deprecated added in v0.13.21

type ApiSyncDecider interface {
	ApiSyncer
	ShouldSync(old, new *ApiSnapshot) bool
}

Deprecated: use ApiSyncDeciderWithContext

type ApiSyncDeciderWithContext added in v0.15.0

type ApiSyncDeciderWithContext interface {
	ApiSyncer
	ShouldSync(ctx context.Context, old, new *ApiSnapshot) bool
}

type ApiSyncer

type ApiSyncer interface {
	Sync(context.Context, *ApiSnapshot) error
}

type ApiSyncers

type ApiSyncers []ApiSyncer

func (ApiSyncers) Sync

func (s ApiSyncers) Sync(ctx context.Context, snapshot *ApiSnapshot) error

type Gateway

type Gateway struct {
	// if set to false, only use virtual services without ssl configured.
	// if set to true, only use virtual services with ssl configured.
	Ssl bool `protobuf:"varint,1,opt,name=ssl,proto3" json:"ssl,omitempty"`
	// the bind address the gateway should serve traffic on
	BindAddress string `protobuf:"bytes,3,opt,name=bind_address,json=bindAddress,proto3" json:"bind_address,omitempty"`
	// bind ports must not conflict across gateways for a single proxy
	BindPort uint32 `protobuf:"varint,4,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"`
	// top level optional configuration for all routes on the gateway
	Options *v1.ListenerOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"`
	// Status indicates the validation status of this resource.
	// Status is read-only by clients, and set by gloo during validation
	Status core.Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status" testdiff:"ignore"`
	// Metadata contains the object metadata for this resource
	Metadata core.Metadata `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata"`
	// Enable ProxyProtocol support for this listener
	UseProxyProto *types.BoolValue `protobuf:"bytes,8,opt,name=use_proxy_proto,json=useProxyProto,proto3" json:"use_proxy_proto,omitempty"`
	// The type of gateway being created
	// HttpGateway creates a listener with an http_connection_manager
	// TcpGateway creates a listener with a tcp proxy filter
	//
	// Types that are valid to be assigned to GatewayType:
	//	*Gateway_HttpGateway
	//	*Gateway_TcpGateway
	GatewayType isGateway_GatewayType `protobuf_oneof:"GatewayType"`
	//
	// Names of the [`Proxy`](https://gloo.solo.io/api/github.com/solo-io/gloo/projects/gloo/api/v1/proxy.proto.sk/)
	// resources to generate from this gateway. If other gateways exist which point to the same proxy,
	// Gloo will join them together.
	//
	// Proxies have a one-to-many relationship with Envoy bootstrap configuration.
	// In order to connect to Gloo, the Envoy bootstrap configuration sets a `role` in
	// the [node metadata](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/base.proto#envoy-api-msg-core-node)
	// Envoy instances announce their `role` to Gloo, which maps to the  `{{ .Namespace }}~{{ .Name }}`
	// of the Proxy resource.
	//
	// The template for this value can be seen in the [Gloo Helm chart](https://github.com/solo-io/gloo/blob/master/install/helm/gloo/templates/9-gateway-proxy-configmap.yaml#L22)
	//
	// Note: this field also accepts fields written in camel-case. They will be converted
	// to kebab-case in the Proxy name. This allows use of the [Gateway Name Helm value](https://github.com/solo-io/gloo/blob/master/install/helm/gloo/values-gateway-template.yaml#L47)
	// for this field
	//
	// Defaults to `["gateway-proxy"]`
	ProxyNames           []string `protobuf:"bytes,12,rep,name=proxy_names,json=proxyNames,proto3" json:"proxy_names,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A Gateway describes a single Listener (bind address:port) and the routing configuration to upstreams that are reachable via a specific port on the Gateway Proxy itself.

func NewGateway

func NewGateway(namespace, name string) *Gateway

func (*Gateway) DeepCopyInto added in v0.20.9

func (o *Gateway) DeepCopyInto(out *Gateway)

func (*Gateway) DeepCopyObject

func (o *Gateway) DeepCopyObject() runtime.Object

func (*Gateway) Descriptor

func (*Gateway) Descriptor() ([]byte, []int)

func (*Gateway) Equal

func (this *Gateway) Equal(that interface{}) bool

func (*Gateway) GetBindAddress

func (m *Gateway) GetBindAddress() string

func (*Gateway) GetBindPort

func (m *Gateway) GetBindPort() uint32

func (*Gateway) GetGatewayType added in v1.0.0

func (m *Gateway) GetGatewayType() isGateway_GatewayType

func (*Gateway) GetHttpGateway added in v1.0.0

func (m *Gateway) GetHttpGateway() *HttpGateway

func (*Gateway) GetMetadata

func (m *Gateway) GetMetadata() core.Metadata

func (*Gateway) GetObjectKind

func (o *Gateway) GetObjectKind() schema.ObjectKind

func (*Gateway) GetOptions added in v1.0.0

func (m *Gateway) GetOptions() *v1.ListenerOptions

func (*Gateway) GetProxyNames added in v1.0.0

func (m *Gateway) GetProxyNames() []string

func (*Gateway) GetSsl

func (m *Gateway) GetSsl() bool

func (*Gateway) GetStatus

func (m *Gateway) GetStatus() core.Status

func (*Gateway) GetTcpGateway added in v1.0.0

func (m *Gateway) GetTcpGateway() *TcpGateway

func (*Gateway) GetUseProxyProto added in v0.13.15

func (m *Gateway) GetUseProxyProto() *types.BoolValue

func (*Gateway) GroupVersionKind added in v0.18.0

func (r *Gateway) GroupVersionKind() schema.GroupVersionKind

func (*Gateway) Hash

func (r *Gateway) Hash() uint64

func (*Gateway) ProtoMessage

func (*Gateway) ProtoMessage()

func (*Gateway) Reset

func (m *Gateway) Reset()

func (*Gateway) SetMetadata

func (r *Gateway) SetMetadata(meta core.Metadata)

func (*Gateway) SetStatus

func (r *Gateway) SetStatus(status core.Status)

func (*Gateway) String

func (m *Gateway) String() string

func (*Gateway) XXX_DiscardUnknown

func (m *Gateway) XXX_DiscardUnknown()

func (*Gateway) XXX_Marshal

func (m *Gateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Gateway) XXX_Merge

func (m *Gateway) XXX_Merge(src proto.Message)

func (*Gateway) XXX_OneofWrappers added in v1.0.0

func (*Gateway) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Gateway) XXX_Size

func (m *Gateway) XXX_Size() int

func (*Gateway) XXX_Unmarshal

func (m *Gateway) XXX_Unmarshal(b []byte) error

type GatewayClient

type GatewayClient interface {
	BaseClient() clients.ResourceClient
	Register() error
	Read(namespace, name string, opts clients.ReadOpts) (*Gateway, error)
	Write(resource *Gateway, opts clients.WriteOpts) (*Gateway, error)
	Delete(namespace, name string, opts clients.DeleteOpts) error
	List(namespace string, opts clients.ListOpts) (GatewayList, error)
	GatewayWatcher
}

func NewGatewayClient

func NewGatewayClient(rcFactory factory.ResourceClientFactory) (GatewayClient, error)

func NewGatewayClientWithBase

func NewGatewayClientWithBase(rc clients.ResourceClient) GatewayClient

func NewGatewayClientWithToken

func NewGatewayClientWithToken(rcFactory factory.ResourceClientFactory, token string) (GatewayClient, error)

type GatewayList

type GatewayList []*Gateway

func (GatewayList) AsInputResources

func (list GatewayList) AsInputResources() resources.InputResourceList

func (GatewayList) AsInterfaces

func (list GatewayList) AsInterfaces() []interface{}

func (GatewayList) AsResources

func (list GatewayList) AsResources() resources.ResourceList

func (GatewayList) Clone

func (list GatewayList) Clone() GatewayList

func (GatewayList) Each

func (list GatewayList) Each(f func(element *Gateway))

func (GatewayList) EachResource added in v0.13.21

func (list GatewayList) EachResource(f func(element resources.Resource))

func (GatewayList) Find

func (list GatewayList) Find(namespace, name string) (*Gateway, error)

namespace is optional, if left empty, names can collide if the list contains more than one with the same name

func (GatewayList) Names

func (list GatewayList) Names() []string

func (GatewayList) NamespacesDotNames

func (list GatewayList) NamespacesDotNames() []string

func (GatewayList) Sort

func (list GatewayList) Sort() GatewayList

type GatewayReconciler

type GatewayReconciler interface {
	Reconcile(namespace string, desiredResources GatewayList, transition TransitionGatewayFunc, opts clients.ListOpts) error
}

func NewGatewayReconciler

func NewGatewayReconciler(client GatewayClient) GatewayReconciler

type GatewayWatcher added in v0.13.21

type GatewayWatcher interface {
	// watch namespace-scoped Gateways
	Watch(namespace string, opts clients.WatchOpts) (<-chan GatewayList, <-chan error, error)
}

type Gateway_HttpGateway added in v1.0.0

type Gateway_HttpGateway struct {
	HttpGateway *HttpGateway `protobuf:"bytes,9,opt,name=http_gateway,json=httpGateway,proto3,oneof" json:"http_gateway,omitempty"`
}

func (*Gateway_HttpGateway) Equal added in v1.0.0

func (this *Gateway_HttpGateway) Equal(that interface{}) bool

type Gateway_TcpGateway added in v1.0.0

type Gateway_TcpGateway struct {
	TcpGateway *TcpGateway `protobuf:"bytes,10,opt,name=tcp_gateway,json=tcpGateway,proto3,oneof" json:"tcp_gateway,omitempty"`
}

func (*Gateway_TcpGateway) Equal added in v1.0.0

func (this *Gateway_TcpGateway) Equal(that interface{}) bool

type HttpGateway added in v1.0.0

type HttpGateway struct {
	// Names & namespace refs of the the virtual services which contain the actual routes for the gateway.
	// If the list is empty, all virtual services in the same namespace as this gateway will apply,
	// with accordance to `ssl` flag on `Gateway` above.
	// The default namespace matching behavior can be overridden via `virtual_service_namespaces` flag below.
	// Only one of `virtualServices` or `virtualServiceSelector` should be provided.
	VirtualServices []core.ResourceRef `protobuf:"bytes,1,rep,name=virtual_services,json=virtualServices,proto3" json:"virtual_services"`
	// Select virtual services by their label. This will apply only to virtual services in the same namespace
	// as the gateway resource, unless `virtual_service_namespaces` is provided below.
	// Only one of `virtualServices` or `virtualServiceSelector` should be provided.
	VirtualServiceSelector map[string]string `` /* 217-byte string literal not displayed */
	// Expand the search by providing a list of valid search namespaces here, or search all namespaces by setting '*'
	VirtualServiceNamespaces []string `` /* 135-byte string literal not displayed */
	// HTTP Gateway configuration
	Options              *v1.HttpListenerOptions `protobuf:"bytes,8,opt,name=options,proto3" json:"options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (*HttpGateway) Descriptor added in v1.0.0

func (*HttpGateway) Descriptor() ([]byte, []int)

func (*HttpGateway) Equal added in v1.0.0

func (this *HttpGateway) Equal(that interface{}) bool

func (*HttpGateway) GetOptions added in v1.0.0

func (m *HttpGateway) GetOptions() *v1.HttpListenerOptions

func (*HttpGateway) GetVirtualServiceNamespaces added in v1.2.0

func (m *HttpGateway) GetVirtualServiceNamespaces() []string

func (*HttpGateway) GetVirtualServiceSelector added in v1.0.0

func (m *HttpGateway) GetVirtualServiceSelector() map[string]string

func (*HttpGateway) GetVirtualServices added in v1.0.0

func (m *HttpGateway) GetVirtualServices() []core.ResourceRef

func (*HttpGateway) ProtoMessage added in v1.0.0

func (*HttpGateway) ProtoMessage()

func (*HttpGateway) Reset added in v1.0.0

func (m *HttpGateway) Reset()

func (*HttpGateway) String added in v1.0.0

func (m *HttpGateway) String() string

func (*HttpGateway) XXX_DiscardUnknown added in v1.0.0

func (m *HttpGateway) XXX_DiscardUnknown()

func (*HttpGateway) XXX_Marshal added in v1.0.0

func (m *HttpGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HttpGateway) XXX_Merge added in v1.0.0

func (m *HttpGateway) XXX_Merge(src proto.Message)

func (*HttpGateway) XXX_Size added in v1.0.0

func (m *HttpGateway) XXX_Size() int

func (*HttpGateway) XXX_Unmarshal added in v1.0.0

func (m *HttpGateway) XXX_Unmarshal(b []byte) error

type Route added in v0.18.32

type Route struct {
	// Matchers contain parameters for matching requests (i.e., based on HTTP path, headers, etc.)
	// If empty, the route will match all requests (i.e, a single "/" path prefix matcher)
	// For delegated routes, the matcher must contain only a `prefix` path matcher and no other config
	Matchers []*matchers.Matcher `protobuf:"bytes,1,rep,name=matchers,proto3" json:"matchers,omitempty"`
	// The Route Action Defines what action the proxy should take when a request matches the route.
	//
	// Types that are valid to be assigned to Action:
	//	*Route_RouteAction
	//	*Route_RedirectAction
	//	*Route_DirectResponseAction
	//	*Route_DelegateAction
	Action isRoute_Action `protobuf_oneof:"action"`
	// Route Options extend the behavior of routes.
	// Route options include configuration such as retries, rate limiting, and request/response transformation.
	// RouteOption behavior will be inherited by delegated routes which do not specify their own `options`
	Options              *v1.RouteOptions `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

A route specifies how to match a request and what action to take when the request is matched.

When a request matches on a route, the route can perform one of the following actions: - *Route* the request to a destination - Reply with a *Direct Response* - Send a *Redirect* response to the client - *Delegate* the action for the request to a top-level [`RouteTable`]({{< ref "/api/github.com/solo-io/gloo/projects/gateway/api/v1/route_table.proto.sk.md" >}}) resource DelegateActions can be used to delegate the behavior for a set out routes with a given *prefix* to a top-level `RouteTable` resource.

func (*Route) Descriptor added in v0.18.32

func (*Route) Descriptor() ([]byte, []int)

func (*Route) Equal added in v0.18.32

func (this *Route) Equal(that interface{}) bool

func (*Route) GetAction added in v0.18.32

func (m *Route) GetAction() isRoute_Action

func (*Route) GetDelegateAction added in v0.18.32

func (m *Route) GetDelegateAction() *core.ResourceRef

func (*Route) GetDirectResponseAction added in v0.18.32

func (m *Route) GetDirectResponseAction() *v1.DirectResponseAction

func (*Route) GetMatchers added in v1.0.0

func (m *Route) GetMatchers() []*matchers.Matcher

func (*Route) GetOptions added in v1.0.0

func (m *Route) GetOptions() *v1.RouteOptions

func (*Route) GetRedirectAction added in v0.18.32

func (m *Route) GetRedirectAction() *v1.RedirectAction

func (*Route) GetRouteAction added in v0.18.32

func (m *Route) GetRouteAction() *v1.RouteAction

func (*Route) ProtoMessage added in v0.18.32

func (*Route) ProtoMessage()

func (*Route) Reset added in v0.18.32

func (m *Route) Reset()

func (*Route) String added in v0.18.32

func (m *Route) String() string

func (*Route) XXX_DiscardUnknown added in v0.18.32

func (m *Route) XXX_DiscardUnknown()

func (*Route) XXX_Marshal added in v0.18.32

func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Route) XXX_Merge added in v0.18.32

func (m *Route) XXX_Merge(src proto.Message)

func (*Route) XXX_OneofWrappers added in v0.18.32

func (*Route) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Route) XXX_Size added in v0.18.32

func (m *Route) XXX_Size() int

func (*Route) XXX_Unmarshal added in v0.18.32

func (m *Route) XXX_Unmarshal(b []byte) error

type RouteTable added in v0.18.32

type RouteTable struct {
	// the list of routes for the route table
	Routes []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"`
	// Status indicates the validation status of this resource.
	// Status is read-only by clients, and set by gloo during validation
	Status core.Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status" testdiff:"ignore"`
	// Metadata contains the object metadata for this resource
	Metadata             core.Metadata `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

The **RouteTable** is a child Routing object for the Gloo Gateway.

A **RouteTable** gets built into the complete routing configuration when it is referenced by a `delegateAction`, either in a parent VirtualService or another RouteTable.

Routes specified in a RouteTable must have their paths start with the prefix provided in the parent's matcher.

For example, the following configuration:

``` virtualService: mydomain.com match: /a delegate: a-routes --- routeTable: a-routes match: /1

```

would *not be valid*, while

``` virtualService: mydomain.com match: /a delegate: a-routes --- routeTable: a-routes match: /a/1

```

*would* be valid.

A complete configuration might look as follows:

```yaml apiVersion: gateway.solo.io/v1 kind: VirtualService metadata:

name: 'any'
namespace: 'any'

spec:

virtualHost:
  domains:
  - 'any.com'
  routes:
  - matcher:
      prefix: '/a' # delegate ownership of routes for `any.com/a`
    delegateAction:
      name: 'a-routes'
      namespace: 'a'
  - matcher:
      prefix: '/b' # delegate ownership of routes for `any.com/b`
    delegateAction:
      name: 'b-routes'
      namespace: 'b'

```

* A root-level **VirtualService** which delegates routing to to the `a-routes` and `b-routes` **RouteTables**. * Routes with `delegateActions` can only use a `prefix` matcher.

```yaml apiVersion: gateway.solo.io/v1 kind: RouteTable metadata:

name: 'a-routes'
namespace: 'a'

spec:

routes:
  - matcher:
      # the path matchers in this RouteTable must begin with the prefix `/a/`
      prefix: '/a/1'
    routeAction:
      single:
        upstream:
          name: 'foo-upstream'

  - matcher:
      prefix: '/a/2'
    routeAction:
      single:
        upstream:
          name: 'bar-upstream'

```

* A **RouteTable** which defines two routes.

```yaml apiVersion: gateway.solo.io/v1 kind: RouteTable metadata:

name: 'b-routes'
namespace: 'b'

spec:

routes:
  - matcher:
      # the path matchers in this RouteTable must begin with the prefix `/b/`
      regex: '/b/3'
    routeAction:
      single:
        upstream:
          name: 'bar-upstream'
  - matcher:
      prefix: '/b/c/'
    # routes in the RouteTable can perform any action, including a delegateAction
    delegateAction:
      name: 'c-routes'
      namespace: 'c'

```

* A **RouteTable** which both *defines a route* and *delegates to* another **RouteTable**.

```yaml apiVersion: gateway.solo.io/v1 kind: RouteTable metadata:

name: 'c-routes'
namespace: 'c'

spec:

routes:
  - matcher:
      exact: '/b/c/4'
    routeAction:
      single:
        upstream:
          name: 'qux-upstream'

```

* A RouteTable which is a child of another route table.

Would produce the following route config for `mydomain.com`:

``` /a/1 -> foo-upstream /a/2 -> bar-upstream /b/3 -> baz-upstream /b/c/4 -> qux-upstream ```

func NewRouteTable added in v0.18.32

func NewRouteTable(namespace, name string) *RouteTable

func (*RouteTable) DeepCopyInto added in v0.20.9

func (o *RouteTable) DeepCopyInto(out *RouteTable)

func (*RouteTable) DeepCopyObject added in v0.18.32

func (o *RouteTable) DeepCopyObject() runtime.Object

func (*RouteTable) Descriptor added in v0.18.32

func (*RouteTable) Descriptor() ([]byte, []int)

func (*RouteTable) Equal added in v0.18.32

func (this *RouteTable) Equal(that interface{}) bool

func (*RouteTable) GetMetadata added in v0.18.32

func (m *RouteTable) GetMetadata() core.Metadata

func (*RouteTable) GetObjectKind added in v0.18.32

func (o *RouteTable) GetObjectKind() schema.ObjectKind

func (*RouteTable) GetRoutes added in v0.18.32

func (m *RouteTable) GetRoutes() []*Route

func (*RouteTable) GetStatus added in v0.18.32

func (m *RouteTable) GetStatus() core.Status

func (*RouteTable) GroupVersionKind added in v0.18.32

func (r *RouteTable) GroupVersionKind() schema.GroupVersionKind

func (*RouteTable) Hash added in v0.18.32

func (r *RouteTable) Hash() uint64

func (*RouteTable) ProtoMessage added in v0.18.32

func (*RouteTable) ProtoMessage()

func (*RouteTable) Reset added in v0.18.32

func (m *RouteTable) Reset()

func (*RouteTable) SetMetadata added in v0.18.32

func (r *RouteTable) SetMetadata(meta core.Metadata)

func (*RouteTable) SetStatus added in v0.18.32

func (r *RouteTable) SetStatus(status core.Status)

func (*RouteTable) String added in v0.18.32

func (m *RouteTable) String() string

func (*RouteTable) XXX_DiscardUnknown added in v0.18.32

func (m *RouteTable) XXX_DiscardUnknown()

func (*RouteTable) XXX_Marshal added in v0.18.32

func (m *RouteTable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RouteTable) XXX_Merge added in v0.18.32

func (m *RouteTable) XXX_Merge(src proto.Message)

func (*RouteTable) XXX_Size added in v0.18.32

func (m *RouteTable) XXX_Size() int

func (*RouteTable) XXX_Unmarshal added in v0.18.32

func (m *RouteTable) XXX_Unmarshal(b []byte) error

type RouteTableClient added in v0.18.32

type RouteTableClient interface {
	BaseClient() clients.ResourceClient
	Register() error
	Read(namespace, name string, opts clients.ReadOpts) (*RouteTable, error)
	Write(resource *RouteTable, opts clients.WriteOpts) (*RouteTable, error)
	Delete(namespace, name string, opts clients.DeleteOpts) error
	List(namespace string, opts clients.ListOpts) (RouteTableList, error)
	RouteTableWatcher
}

func NewRouteTableClient added in v0.18.32

func NewRouteTableClient(rcFactory factory.ResourceClientFactory) (RouteTableClient, error)

func NewRouteTableClientWithBase added in v0.18.32

func NewRouteTableClientWithBase(rc clients.ResourceClient) RouteTableClient

func NewRouteTableClientWithToken added in v0.18.32

func NewRouteTableClientWithToken(rcFactory factory.ResourceClientFactory, token string) (RouteTableClient, error)

type RouteTableList added in v0.18.32

type RouteTableList []*RouteTable

func (RouteTableList) AsInputResources added in v0.18.32

func (list RouteTableList) AsInputResources() resources.InputResourceList

func (RouteTableList) AsInterfaces added in v0.18.32

func (list RouteTableList) AsInterfaces() []interface{}

func (RouteTableList) AsResources added in v0.18.32

func (list RouteTableList) AsResources() resources.ResourceList

func (RouteTableList) Clone added in v0.18.32

func (list RouteTableList) Clone() RouteTableList

func (RouteTableList) Each added in v0.18.32

func (list RouteTableList) Each(f func(element *RouteTable))

func (RouteTableList) EachResource added in v0.18.32

func (list RouteTableList) EachResource(f func(element resources.Resource))

func (RouteTableList) Find added in v0.18.32

func (list RouteTableList) Find(namespace, name string) (*RouteTable, error)

namespace is optional, if left empty, names can collide if the list contains more than one with the same name

func (RouteTableList) Names added in v0.18.32

func (list RouteTableList) Names() []string

func (RouteTableList) NamespacesDotNames added in v0.18.32

func (list RouteTableList) NamespacesDotNames() []string

func (RouteTableList) Sort added in v0.18.32

func (list RouteTableList) Sort() RouteTableList

type RouteTableReconciler added in v0.18.32

type RouteTableReconciler interface {
	Reconcile(namespace string, desiredResources RouteTableList, transition TransitionRouteTableFunc, opts clients.ListOpts) error
}

func NewRouteTableReconciler added in v0.18.32

func NewRouteTableReconciler(client RouteTableClient) RouteTableReconciler

type RouteTableWatcher added in v0.18.32

type RouteTableWatcher interface {
	// watch namespace-scoped RouteTables
	Watch(namespace string, opts clients.WatchOpts) (<-chan RouteTableList, <-chan error, error)
}

type Route_DelegateAction added in v0.18.32

type Route_DelegateAction struct {
	DelegateAction *core.ResourceRef `protobuf:"bytes,5,opt,name=delegate_action,json=delegateAction,proto3,oneof" json:"delegate_action,omitempty"`
}

func (*Route_DelegateAction) Equal added in v0.18.32

func (this *Route_DelegateAction) Equal(that interface{}) bool

type Route_DirectResponseAction added in v0.18.32

type Route_DirectResponseAction struct {
	DirectResponseAction *v1.DirectResponseAction `` /* 129-byte string literal not displayed */
}

func (*Route_DirectResponseAction) Equal added in v0.18.32

func (this *Route_DirectResponseAction) Equal(that interface{}) bool

type Route_RedirectAction added in v0.18.32

type Route_RedirectAction struct {
	RedirectAction *v1.RedirectAction `protobuf:"bytes,3,opt,name=redirect_action,json=redirectAction,proto3,oneof" json:"redirect_action,omitempty"`
}

func (*Route_RedirectAction) Equal added in v0.18.32

func (this *Route_RedirectAction) Equal(that interface{}) bool

type Route_RouteAction added in v0.18.32

type Route_RouteAction struct {
	RouteAction *v1.RouteAction `protobuf:"bytes,2,opt,name=route_action,json=routeAction,proto3,oneof" json:"route_action,omitempty"`
}

func (*Route_RouteAction) Equal added in v0.18.32

func (this *Route_RouteAction) Equal(that interface{}) bool

type TcpGateway added in v1.0.0

type TcpGateway struct {
	// TCP hosts that the gateway can route to
	TcpHosts []*v1.TcpHost `protobuf:"bytes,1,rep,name=tcp_hosts,json=tcpHosts,proto3" json:"tcp_hosts,omitempty"`
	// TCP Gateway configuration
	Options              *v1.TcpListenerOptions `protobuf:"bytes,8,opt,name=options,proto3" json:"options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (*TcpGateway) Descriptor added in v1.0.0

func (*TcpGateway) Descriptor() ([]byte, []int)

func (*TcpGateway) Equal added in v1.0.0

func (this *TcpGateway) Equal(that interface{}) bool

func (*TcpGateway) GetOptions added in v1.0.0

func (m *TcpGateway) GetOptions() *v1.TcpListenerOptions

func (*TcpGateway) GetTcpHosts added in v1.0.0

func (m *TcpGateway) GetTcpHosts() []*v1.TcpHost

func (*TcpGateway) ProtoMessage added in v1.0.0

func (*TcpGateway) ProtoMessage()

func (*TcpGateway) Reset added in v1.0.0

func (m *TcpGateway) Reset()

func (*TcpGateway) String added in v1.0.0

func (m *TcpGateway) String() string

func (*TcpGateway) XXX_DiscardUnknown added in v1.0.0

func (m *TcpGateway) XXX_DiscardUnknown()

func (*TcpGateway) XXX_Marshal added in v1.0.0

func (m *TcpGateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TcpGateway) XXX_Merge added in v1.0.0

func (m *TcpGateway) XXX_Merge(src proto.Message)

func (*TcpGateway) XXX_Size added in v1.0.0

func (m *TcpGateway) XXX_Size() int

func (*TcpGateway) XXX_Unmarshal added in v1.0.0

func (m *TcpGateway) XXX_Unmarshal(b []byte) error

type TransitionGatewayFunc

type TransitionGatewayFunc func(original, desired *Gateway) (bool, error)

Option to copy anything from the original to the desired before writing. Return value of false means don't update

type TransitionRouteTableFunc added in v0.18.32

type TransitionRouteTableFunc func(original, desired *RouteTable) (bool, error)

Option to copy anything from the original to the desired before writing. Return value of false means don't update

type TransitionVirtualServiceFunc

type TransitionVirtualServiceFunc func(original, desired *VirtualService) (bool, error)

Option to copy anything from the original to the desired before writing. Return value of false means don't update

type VirtualHost added in v0.18.32

type VirtualHost struct {
	// The list of domains (i.e.: matching the `Host` header of a request) that belong to this virtual host.
	// Note that the wildcard will not match the empty string. e.g. “*-bar.foo.com” will match “baz-bar.foo.com”
	// but not “-bar.foo.com”. Additionally, a special entry “*” is allowed which will match any host/authority header.
	// Only a single virtual host on a gateway can match on “*”. A domain must be unique across all
	// virtual hosts on a gateway or the config will be invalidated by Gloo
	// Domains on virtual hosts obey the same rules as [Envoy Virtual Hosts](https://github.com/envoyproxy/envoy/blob/master/api/envoy/api/v2/route/route.proto)
	Domains []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"`
	// The list of HTTP routes define routing actions to be taken for incoming HTTP requests whose host header matches
	// this virtual host. If the request matches more than one route in the list, the first route matched will be selected.
	// If the list of routes is empty, the virtual host will be ignored by Gloo.
	Routes []*Route `protobuf:"bytes,3,rep,name=routes,proto3" json:"routes,omitempty"`
	// Virtual host options contain additional configuration to be applied to all traffic served by the Virtual Host.
	// Some configuration here can be overridden by Route Options.
	Options              *v1.VirtualHostOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

Virtual Hosts serve an ordered list of routes for a set of domains.

An HTTP request is first matched to a virtual host based on its host header, then to a route within the virtual host.

If a request is not matched to any virtual host or a route therein, the target proxy will reply with a 404.

Unlike the [Gloo Virtual Host]({{< ref "/api/github.com/solo-io/gloo/projects/gloo/api/v1/proxy.proto.sk.md" >}}/#virtualhost), Gateway* Virtual Hosts can **delegate** their routes to `RouteTables`.

func (*VirtualHost) Descriptor added in v0.18.32

func (*VirtualHost) Descriptor() ([]byte, []int)

func (*VirtualHost) Equal added in v0.18.32

func (this *VirtualHost) Equal(that interface{}) bool

func (*VirtualHost) GetDomains added in v0.18.32

func (m *VirtualHost) GetDomains() []string

func (*VirtualHost) GetOptions added in v1.0.0

func (m *VirtualHost) GetOptions() *v1.VirtualHostOptions

func (*VirtualHost) GetRoutes added in v0.18.32

func (m *VirtualHost) GetRoutes() []*Route

func (*VirtualHost) ProtoMessage added in v0.18.32

func (*VirtualHost) ProtoMessage()

func (*VirtualHost) Reset added in v0.18.32

func (m *VirtualHost) Reset()

func (*VirtualHost) String added in v0.18.32

func (m *VirtualHost) String() string

func (*VirtualHost) XXX_DiscardUnknown added in v0.18.32

func (m *VirtualHost) XXX_DiscardUnknown()

func (*VirtualHost) XXX_Marshal added in v0.18.32

func (m *VirtualHost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VirtualHost) XXX_Merge added in v0.18.32

func (m *VirtualHost) XXX_Merge(src proto.Message)

func (*VirtualHost) XXX_Size added in v0.18.32

func (m *VirtualHost) XXX_Size() int

func (*VirtualHost) XXX_Unmarshal added in v0.18.32

func (m *VirtualHost) XXX_Unmarshal(b []byte) error

type VirtualService

type VirtualService struct {
	// The VirtualHost contains the
	// The list of HTTP routes define routing actions to be taken
	// for incoming HTTP requests whose host header matches
	// this virtual host. If the request matches more than one route in the list, the first route matched will be selected.
	// If the list of routes is empty, the virtual host will be ignored by Gloo.
	VirtualHost *VirtualHost `protobuf:"bytes,1,opt,name=virtual_host,json=virtualHost,proto3" json:"virtual_host,omitempty"`
	// If provided, the Gateway will serve TLS/SSL traffic for this set of routes
	SslConfig *v1.SslConfig `protobuf:"bytes,2,opt,name=ssl_config,json=sslConfig,proto3" json:"ssl_config,omitempty"`
	// Display only, optional descriptive name.
	// Unlike metadata.name, DisplayName can be any string
	// and can be changed after creating the resource.
	DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// Status indicates the validation status of this resource.
	// Status is read-only by clients, and set by gloo during validation
	Status core.Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status" testdiff:"ignore"`
	// Metadata contains the object metadata for this resource
	Metadata             core.Metadata `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

The **VirtualService** is the root Routing object for the Gloo Gateway. A virtual service describes the set of routes to match for a set of domains.

It defines: - a set of domains - the root set of routes for those domains - an optional SSL configuration for server TLS Termination - VirtualHostOptions that will apply configuration to all routes that live on the VirtualService.

Domains must be unique across all virtual services within a gateway (i.e. no overlap between sets).

VirtualServices can delegate routing behavior to the RouteTable resource by using the `delegateAction` on routes.

An example configuration using two VirtualServices (one with TLS termination and one without) which share a RouteTable looks as follows:

```yaml # HTTP VirtualService: apiVersion: gateway.solo.io/v1 kind: VirtualService metadata:

name: 'http'
namespace: 'usernamespace'

spec:

virtualHost:
  domains:
  - '*.mydomain.com'
  - 'mydomain.com'
  routes:
  - matcher:
      prefix: '/'
    # delegate all traffic to the `shared-routes` RouteTable
    delegateAction:
      name: 'shared-routes'
      namespace: 'usernamespace'

```

```yaml # HTTPS VirtualService: apiVersion: gateway.solo.io/v1 kind: VirtualService metadata:

name: 'https'
namespace: 'usernamespace'

spec:

virtualHost:
  domains:
  - '*.mydomain.com'
  - 'mydomain.com'
  routes:
  - matcher:
      prefix: '/'
    # delegate all traffic to the `shared-routes` RouteTable
    delegateAction:
      name: 'shared-routes'
      namespace: 'usernamespace'
sslConfig:
  secretRef:
    name: gateway-tls
    namespace: gloo-system

```

```yaml # the RouteTable shared by both VirtualServices: apiVersion: gateway.solo.io/v1 kind: RouteTable metadata:

name: 'shared-routes'
namespace: 'usernamespace'

spec:

routes:
  - matcher:
      prefix: '/some-route'
    routeAction:
      single:
        upstream:
          name: 'some-upstream'
   ...

```

**Delegated Routes** are routes that use the `delegateAction` routing action. Delegated Routes obey the following constraints:

- delegate routes must use `prefix` path matchers - delegated routes cannot specify header, query, or methods portion of the normal route matcher. - `routeOptions` configuration will be inherited from parent routes, but can be overridden by the child

func NewVirtualService

func NewVirtualService(namespace, name string) *VirtualService

func (*VirtualService) DeepCopyInto added in v0.20.9

func (o *VirtualService) DeepCopyInto(out *VirtualService)

func (*VirtualService) DeepCopyObject

func (o *VirtualService) DeepCopyObject() runtime.Object

func (*VirtualService) Descriptor

func (*VirtualService) Descriptor() ([]byte, []int)

func (*VirtualService) Equal

func (this *VirtualService) Equal(that interface{}) bool

func (*VirtualService) GetDisplayName

func (m *VirtualService) GetDisplayName() string

func (*VirtualService) GetMetadata

func (m *VirtualService) GetMetadata() core.Metadata

func (*VirtualService) GetObjectKind

func (o *VirtualService) GetObjectKind() schema.ObjectKind

func (*VirtualService) GetSslConfig

func (m *VirtualService) GetSslConfig() *v1.SslConfig

func (*VirtualService) GetStatus

func (m *VirtualService) GetStatus() core.Status

func (*VirtualService) GetVirtualHost

func (m *VirtualService) GetVirtualHost() *VirtualHost

func (*VirtualService) GroupVersionKind added in v0.18.0

func (r *VirtualService) GroupVersionKind() schema.GroupVersionKind

func (*VirtualService) Hash

func (r *VirtualService) Hash() uint64

func (*VirtualService) ProtoMessage

func (*VirtualService) ProtoMessage()

func (*VirtualService) Reset

func (m *VirtualService) Reset()

func (*VirtualService) SetMetadata

func (r *VirtualService) SetMetadata(meta core.Metadata)

func (*VirtualService) SetStatus

func (r *VirtualService) SetStatus(status core.Status)

func (*VirtualService) String

func (m *VirtualService) String() string

func (*VirtualService) XXX_DiscardUnknown

func (m *VirtualService) XXX_DiscardUnknown()

func (*VirtualService) XXX_Marshal

func (m *VirtualService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VirtualService) XXX_Merge

func (m *VirtualService) XXX_Merge(src proto.Message)

func (*VirtualService) XXX_Size

func (m *VirtualService) XXX_Size() int

func (*VirtualService) XXX_Unmarshal

func (m *VirtualService) XXX_Unmarshal(b []byte) error

type VirtualServiceClient

type VirtualServiceClient interface {
	BaseClient() clients.ResourceClient
	Register() error
	Read(namespace, name string, opts clients.ReadOpts) (*VirtualService, error)
	Write(resource *VirtualService, opts clients.WriteOpts) (*VirtualService, error)
	Delete(namespace, name string, opts clients.DeleteOpts) error
	List(namespace string, opts clients.ListOpts) (VirtualServiceList, error)
	VirtualServiceWatcher
}

func NewVirtualServiceClient

func NewVirtualServiceClient(rcFactory factory.ResourceClientFactory) (VirtualServiceClient, error)

func NewVirtualServiceClientWithBase

func NewVirtualServiceClientWithBase(rc clients.ResourceClient) VirtualServiceClient

func NewVirtualServiceClientWithToken

func NewVirtualServiceClientWithToken(rcFactory factory.ResourceClientFactory, token string) (VirtualServiceClient, error)

type VirtualServiceList

type VirtualServiceList []*VirtualService

func (VirtualServiceList) AsInputResources

func (list VirtualServiceList) AsInputResources() resources.InputResourceList

func (VirtualServiceList) AsInterfaces

func (list VirtualServiceList) AsInterfaces() []interface{}

func (VirtualServiceList) AsResources

func (list VirtualServiceList) AsResources() resources.ResourceList

func (VirtualServiceList) Clone

func (VirtualServiceList) Each

func (list VirtualServiceList) Each(f func(element *VirtualService))

func (VirtualServiceList) EachResource added in v0.13.21

func (list VirtualServiceList) EachResource(f func(element resources.Resource))

func (VirtualServiceList) Find

func (list VirtualServiceList) Find(namespace, name string) (*VirtualService, error)

namespace is optional, if left empty, names can collide if the list contains more than one with the same name

func (VirtualServiceList) Names

func (list VirtualServiceList) Names() []string

func (VirtualServiceList) NamespacesDotNames

func (list VirtualServiceList) NamespacesDotNames() []string

func (VirtualServiceList) Sort

type VirtualServiceReconciler

type VirtualServiceReconciler interface {
	Reconcile(namespace string, desiredResources VirtualServiceList, transition TransitionVirtualServiceFunc, opts clients.ListOpts) error
}

func NewVirtualServiceReconciler

func NewVirtualServiceReconciler(client VirtualServiceClient) VirtualServiceReconciler

type VirtualServiceWatcher added in v0.13.21

type VirtualServiceWatcher interface {
	// watch namespace-scoped VirtualServices
	Watch(namespace string, opts clients.WatchOpts) (<-chan VirtualServiceList, <-chan error, error)
}

Directories

Path Synopsis
kube
apis/gateway.solo.io/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/gateway.solo.io/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/gateway.solo.io/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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