dag

package
v0.6.0-beta.1 Latest Latest
Warning

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

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

Documentation

Overview

Package dag provides a data model, in the form of a directed acyclic graph, of the relationship between Kubernetes Ingress, Service, and Secret objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

type DAG struct {
	// IngressRouteRootNamespaces specifies the namespaces where root
	// IngressRoutes can be defined. If empty, roots can be defined in any
	// namespace.
	IngressRouteRootNamespaces []string
	// contains filtered or unexported fields
}

A DAG represents a directed acylic graph of objects representing the relationship between Kubernetes Ingress objects, the backend Services, and Secret objects. The DAG models these relationships as Roots and Vertices.

func (*DAG) Insert

func (d *DAG) Insert(obj interface{})

Insert inserts obj into the DAG. If an object with a matching type, name, and namespace exists, it will be overwritten.

func (*DAG) Recompute

func (d *DAG) Recompute() IngressrouteStatus

Recompute recomputes the DAG.

func (*DAG) Remove

func (d *DAG) Remove(obj interface{})

Remove removes obj from the DAG. If no object with a matching type, name, and namespace exists in the DAG, no action is taken.

func (*DAG) Visit

func (d *DAG) Visit(f func(Vertex))

Visit calls f for every root of this DAG.

type IngressrouteStatus

type IngressrouteStatus struct {
	// contains filtered or unexported fields
}

IngressrouteStatus contains the status for an IngressRoute (valid / invalid / orphan, etc)

func (*IngressrouteStatus) GetStatuses

func (irs *IngressrouteStatus) GetStatuses() []Status

func (*IngressrouteStatus) GetVersion

func (irs *IngressrouteStatus) GetVersion() int

type ResourceEventHandler

type ResourceEventHandler struct {
	DAG
}

ResourceEventHandler converts its embedded DAG into a classic cache.ResourceEventHandler.

func (*ResourceEventHandler) OnAdd

func (r *ResourceEventHandler) OnAdd(obj interface{}) IngressrouteStatus

func (*ResourceEventHandler) OnDelete

func (r *ResourceEventHandler) OnDelete(obj interface{}) IngressrouteStatus

func (*ResourceEventHandler) OnUpdate

func (r *ResourceEventHandler) OnUpdate(oldObj, newObj interface{}) IngressrouteStatus

type Root

type Root interface {
	Vertex
}

type Route

type Route struct {

	// Should this route generate a 301 upgrade if accessed
	// over HTTP?
	HTTPSUpgrade bool

	// Is this a websocket route?
	// TODO(dfc) this should go on the service
	Websocket bool

	// A timeout applied to requests on this route.
	// A timeout of zero implies "use envoy's default"
	// A timeout of -1 represents "infinity"
	// TODO(dfc) should this move to service?
	Timeout time.Duration
	// contains filtered or unexported fields
}

func (*Route) Prefix

func (r *Route) Prefix() string

func (*Route) Visit

func (r *Route) Visit(f func(Vertex))

type Secret

type Secret struct {
	// contains filtered or unexported fields
}

Secret represents a K8s Secret for TLS usage as a DAG Vertex. A Secret is a leaf in the DAG.

func (*Secret) Data

func (s *Secret) Data() map[string][]byte

Data returns the contents of the backing secret's map.

func (*Secret) Name

func (s *Secret) Name() string

func (*Secret) Namespace

func (s *Secret) Namespace() string

func (*Secret) Visit

func (s *Secret) Visit(func(Vertex))

type SecureVirtualHost

type SecureVirtualHost struct {
	// Port is the port that the VirtualHost will listen on.
	// Expected values are 80 and 443, but others are possible
	// if the VirtualHost is generated inside Contour.
	Port int

	// TLS minimum protocol version. Defaults to auth.TlsParameters_TLS_AUTO
	MinProtoVersion auth.TlsParameters_TlsProtocol
	// contains filtered or unexported fields
}

A SecureVirtualHost represents a HTTP host protected by TLS.

func (*SecureVirtualHost) Data

func (s *SecureVirtualHost) Data() map[string][]byte

func (*SecureVirtualHost) FQDN

func (s *SecureVirtualHost) FQDN() string

func (*SecureVirtualHost) Visit

func (s *SecureVirtualHost) Visit(f func(Vertex))

type Service

type Service struct {
	*v1.ServicePort
	Weight int

	// Protocol is the layer 7 protocol of this service
	Protocol string

	HealthCheck          *ingressroutev1.HealthCheck
	LoadBalancerStrategy string

	// Max connections is maximum number of connections
	// that Envoy will make to the upstream cluster.
	MaxConnections int

	// MaxPendingRequests is maximum number of pending
	// requests that Envoy will allow to the upstream cluster.
	MaxPendingRequests int

	// MaxRequests is the maximum number of parallel requests that
	// Envoy will make to the upstream cluster.
	MaxRequests int

	// MaxRetries is the maximum number of parallel retries that
	// Envoy will allow to the upstream cluster.
	MaxRetries int
	// contains filtered or unexported fields
}

Service represents a K8s Sevice as a DAG vertex. A Service is a leaf in the DAG.

func (*Service) Name

func (s *Service) Name() string

func (*Service) Namespace

func (s *Service) Namespace() string

func (*Service) Visit

func (s *Service) Visit(func(Vertex))

type Status

type Status struct {
	// contains filtered or unexported fields
}

func (*Status) GetDescription

func (s *Status) GetDescription() string

func (*Status) GetIngressRouteName

func (s *Status) GetIngressRouteName() string

func (*Status) GetIngressRouteNamespace

func (s *Status) GetIngressRouteNamespace() string

func (*Status) GetObject

func (s *Status) GetObject() *ingressroutev1.IngressRoute

func (*Status) GetStatus

func (s *Status) GetStatus() string

type Vertex

type Vertex interface {
	Visit(func(Vertex))
}

type VirtualHost

type VirtualHost struct {
	// Port is the port that the VirtualHost will listen on.
	// Expected values are 80 and 443, but others are possible
	// if the VirtualHost is generated inside Contour.
	Port int
	// contains filtered or unexported fields
}

A VirtualHost represents an insecure HTTP host.

func (*VirtualHost) FQDN

func (v *VirtualHost) FQDN() string

func (*VirtualHost) Visit

func (v *VirtualHost) Visit(f func(Vertex))

Jump to

Keyboard shortcuts

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