v1

package
v0.0.0-...-5a6645a Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

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

This section is empty.

Types

type Gateway deprecated

type Gateway struct {
	// if set to false, only use virtual services with no 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"`
	// names of the the virtual services, which contain the actual routes for the gateway
	// if the list is empty, all virtual services will apply to this gateway (with accordance to tls flag above).
	VirtualServices []core.ResourceRef `protobuf:"bytes,2,rep,name=virtual_services,json=virtualServices,proto3" json:"virtual_services"`
	// 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 in a namespace
	BindPort uint32 `protobuf:"varint,4,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"`
	// top level plugin configuration for all routes on the gateway
	Plugins *v1.HttpListenerPlugins `protobuf:"bytes,5,opt,name=plugins,proto3" json:"plugins,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"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

A gateway describes the routes to upstreams that are reachable via a specific port on the Gateway Proxy itself.

Deprecated: see gateway.solo.io.v2.Gateway

Deprecated: Do not use.

func NewGateway

func NewGateway(namespace, name string) *Gateway

func (*Gateway) DeepCopyInto

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) GetMetadata

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

func (*Gateway) GetObjectKind

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

func (*Gateway) GetPlugins

func (m *Gateway) GetPlugins() *v1.HttpListenerPlugins

func (*Gateway) GetSsl

func (m *Gateway) GetSsl() bool

func (*Gateway) GetStatus

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

func (*Gateway) GetUseProxyProto

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

func (*Gateway) GetVirtualServices

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

func (*Gateway) GroupVersionKind

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_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

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

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

type Route

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 []*v1.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 Plugins extend the behavior of routes.
	// Route plugins include configuration such as retries, rate limiting, and request/response transformation.
	// RoutePlugin behavior will be inherited by delegated routes which do not specify their own `routePlugins`
	RoutePlugins         *v1.RoutePlugins `protobuf:"bytes,6,opt,name=route_plugins,json=routePlugins,proto3" json:"route_plugins,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

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

func (*Route) Equal

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

func (*Route) GetAction

func (m *Route) GetAction() isRoute_Action

func (*Route) GetDelegateAction

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

func (*Route) GetDirectResponseAction

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

func (*Route) GetMatchers

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

func (*Route) GetRedirectAction

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

func (*Route) GetRouteAction

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

func (*Route) GetRoutePlugins

func (m *Route) GetRoutePlugins() *v1.RoutePlugins

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) Reset

func (m *Route) Reset()

func (*Route) String

func (m *Route) String() string

func (*Route) XXX_DiscardUnknown

func (m *Route) XXX_DiscardUnknown()

func (*Route) XXX_Marshal

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

func (*Route) XXX_Merge

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

func (*Route) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*Route) XXX_Size

func (m *Route) XXX_Size() int

func (*Route) XXX_Unmarshal

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

type RouteTable

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

func NewRouteTable(namespace, name string) *RouteTable

func (*RouteTable) DeepCopyInto

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

func (*RouteTable) DeepCopyObject

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

func (*RouteTable) Descriptor

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

func (*RouteTable) Equal

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

func (*RouteTable) GetMetadata

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

func (*RouteTable) GetObjectKind

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

func (*RouteTable) GetRoutes

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

func (*RouteTable) GetStatus

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

func (*RouteTable) GroupVersionKind

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

func (*RouteTable) Hash

func (r *RouteTable) Hash() uint64

func (*RouteTable) ProtoMessage

func (*RouteTable) ProtoMessage()

func (*RouteTable) Reset

func (m *RouteTable) Reset()

func (*RouteTable) SetMetadata

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

func (*RouteTable) SetStatus

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

func (*RouteTable) String

func (m *RouteTable) String() string

func (*RouteTable) XXX_DiscardUnknown

func (m *RouteTable) XXX_DiscardUnknown()

func (*RouteTable) XXX_Marshal

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

func (*RouteTable) XXX_Merge

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

func (*RouteTable) XXX_Size

func (m *RouteTable) XXX_Size() int

func (*RouteTable) XXX_Unmarshal

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

type RouteTableClient

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

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

func NewRouteTableClientWithBase

func NewRouteTableClientWithBase(rc clients.ResourceClient) RouteTableClient

func NewRouteTableClientWithToken

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

type RouteTableList

type RouteTableList []*RouteTable

func (RouteTableList) AsInputResources

func (list RouteTableList) AsInputResources() resources.InputResourceList

func (RouteTableList) AsInterfaces

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

func (RouteTableList) AsResources

func (list RouteTableList) AsResources() resources.ResourceList

func (RouteTableList) Clone

func (list RouteTableList) Clone() RouteTableList

func (RouteTableList) Each

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

func (RouteTableList) EachResource

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

func (RouteTableList) Find

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

func (list RouteTableList) Names() []string

func (RouteTableList) NamespacesDotNames

func (list RouteTableList) NamespacesDotNames() []string

func (RouteTableList) Sort

func (list RouteTableList) Sort() RouteTableList

type RouteTableReconciler

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

func NewRouteTableReconciler

func NewRouteTableReconciler(client RouteTableClient) RouteTableReconciler

type RouteTableWatcher

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

type Route_DelegateAction

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

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

type Route_DirectResponseAction

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

func (*Route_DirectResponseAction) Equal

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

type Route_RedirectAction

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

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

type Route_RouteAction

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

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

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

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

type VirtualHost struct {
	// deprecated. this field is ignored
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// 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 plugins contain additional configuration to be applied to all traffic served by the Virtual Host.
	// Some configuration here can be overridden by Route Plugins.
	VirtualHostPlugins *v1.VirtualHostPlugins `protobuf:"bytes,4,opt,name=virtual_host_plugins,json=virtualHostPlugins,proto3" json:"virtual_host_plugins,omitempty"`
	// Defines a CORS policy for the virtual host
	// If a CORS policy is also defined on the route matched by the request, the policies are merged.
	// DEPRECATED set cors policy through the Virtual Host Plugin
	CorsPolicy           *v1.CorsPolicy `protobuf:"bytes,5,opt,name=cors_policy,json=corsPolicy,proto3" json:"cors_policy,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

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

func (*VirtualHost) Equal

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

func (*VirtualHost) GetCorsPolicy

func (m *VirtualHost) GetCorsPolicy() *v1.CorsPolicy

func (*VirtualHost) GetDomains

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

func (*VirtualHost) GetName

func (m *VirtualHost) GetName() string

func (*VirtualHost) GetRoutes

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

func (*VirtualHost) GetVirtualHostPlugins

func (m *VirtualHost) GetVirtualHostPlugins() *v1.VirtualHostPlugins

func (*VirtualHost) ProtoMessage

func (*VirtualHost) ProtoMessage()

func (*VirtualHost) Reset

func (m *VirtualHost) Reset()

func (*VirtualHost) String

func (m *VirtualHost) String() string

func (*VirtualHost) XXX_DiscardUnknown

func (m *VirtualHost) XXX_DiscardUnknown()

func (*VirtualHost) XXX_Marshal

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

func (*VirtualHost) XXX_Merge

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

func (*VirtualHost) XXX_Size

func (m *VirtualHost) XXX_Size() int

func (*VirtualHost) XXX_Unmarshal

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 - VirtualHostPlugins 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. - `routePlugin` 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

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

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

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

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

Jump to

Keyboard shortcuts

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