ingress

package
v0.0.0-...-336e61a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DefaultSSLDirectory defines the location where the SSL certificates will be generated
	DefaultSSLDirectory = "/ingress-controller/ssl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	HealthzURL           string
	Upstreams            []*Upstream
	Servers              []*Server
	TCPUpstreams         []*Location
	UDPUpstreams         []*Location
	PassthroughUpstreams []*SSLPassthroughUpstreams
}

Configuration describes

type Controller

type Controller interface {
	// Start returns the command is executed to start the backend.
	// The command must run in foreground.
	Start()
	// Stop stops the backend
	Stop() error
	// Restart reload the backend with the a configuration file returning
	// the combined output of Stdout and Stderr
	Restart(data []byte) ([]byte, error)
	// Tests returns a commands that checks if the configuration file is valid
	// Example: nginx -t -c <file>
	Test(file string) *exec.Cmd
	// OnUpdate callback invoked from the sync queue https://github.com/aledbf/ingress-controller/blob/master/pkg/ingress/controller/controller.go#L355
	// when an update occurs. This is executed frequently because Ingress
	// controllers watches changes in:
	// - Ingresses: main work
	// - Secrets: referenced from Ingress rules with TLS configured
	// - ConfigMaps: where the controller reads custom configuration
	// - Services: referenced from Ingress rules and required to obtain
	//	 information about ports and annotations
	// - Endpoints: referenced from Services and what the backend uses
	//	 to route traffic
	//
	// ConfigMap content of --configmap
	// Configuration returns the translation from Ingress rules containing
	// information about all the upstreams (service endpoints ) "virtual"
	// servers (FQDN)
	// and all the locations inside each server. Each location contains
	// information about all the annotations were configured
	// https://github.com/aledbf/ingress-controller/blob/master/pkg/ingress/types.go#L48
	OnUpdate(*api.ConfigMap, Configuration) ([]byte, error)
	// UpstreamDefaults returns the minimum settings required to configure the
	// communication to upstream servers (endpoints)
	UpstreamDefaults() defaults.Backend
	// IsReloadRequired checks if the backend must be reloaded or not.
	// The parameter contains the new rendered template
	IsReloadRequired([]byte) bool
	// Info returns information about the ingress controller
	// This can include build version, repository, etc.
	Info() string
}

Controller ...

type Location

type Location struct {
	IsDefBackend    bool
	SecureUpstream  bool
	EnableCORS      bool
	Path            string
	Upstream        Upstream
	BasicDigestAuth auth.BasicDigest
	RateLimit       ratelimit.RateLimit
	Redirect        rewrite.Redirect
	Whitelist       ipwhitelist.SourceRange
	ExternalAuth    authreq.External
	Proxy           proxy.Configuration
	CertificateAuth authtls.SSLCert
}

Location describes a server location

type LocationByPath

type LocationByPath []*Location

LocationByPath sorts location by path Location / is the last one

func (LocationByPath) Len

func (c LocationByPath) Len() int

func (LocationByPath) Less

func (c LocationByPath) Less(i, j int) bool

func (LocationByPath) Swap

func (c LocationByPath) Swap(i, j int)

type SSLCert

type SSLCert struct {
	api.ObjectMeta

	//CertFileName string
	//KeyFileName  string
	CAFileName string

	// PemFileName contains the path to the file with the certificate and key concatenated
	PemFileName string
	// PemSHA contains the sha1 of the pem file.
	// This is used to detect changes in the secret that contains the certificates
	PemSHA string
	// CN contains all the common names defined in the SSL certificate
	CN []string
}

SSLCert describes a SSL certificate to be used in a server

func (SSLCert) GetObjectKind

func (s SSLCert) GetObjectKind() unversioned.ObjectKind

GetObjectKind implements the ObjectKind interface as a noop

type SSLPassthroughUpstreams

type SSLPassthroughUpstreams struct {
	Upstream

	Host string
}

SSLPassthroughUpstreams describes an SSL upstream server configured as passthrough (no TLS termination)

type Server

type Server struct {
	Name           string
	SSL            bool
	SSLPassthrough bool
	SSLCertificate string
	//SSLCertificateKey string
	SSLPemChecksum string
	Locations      []*Location
}

Server describes a virtual server

type ServerByName

type ServerByName []*Server

ServerByName sorts server by name

func (ServerByName) Len

func (c ServerByName) Len() int

func (ServerByName) Less

func (c ServerByName) Less(i, j int) bool

func (ServerByName) Swap

func (c ServerByName) Swap(i, j int)

type Upstream

type Upstream struct {
	// Secure indicates if the communication with the en
	Secure bool
	// Name represents an unique api.Service name formatted
	// as <namespace>-<name>-<port>
	Name string
	// Backends
	Backends []UpstreamServer
}

Upstream describes an upstream server (endpoint)

type UpstreamByNameServers

type UpstreamByNameServers []*Upstream

UpstreamByNameServers sorts upstreams by name

func (UpstreamByNameServers) Len

func (c UpstreamByNameServers) Len() int

func (UpstreamByNameServers) Less

func (c UpstreamByNameServers) Less(i, j int) bool

func (UpstreamByNameServers) Swap

func (c UpstreamByNameServers) Swap(i, j int)

type UpstreamServer

type UpstreamServer struct {
	// Address IP address of the endpoint
	Address string
	Port    string
	// MaxFails returns the maximum number of check failures
	// allowed before this should be considered dow.
	// Setting 0 indicates that the check is performed by a Kubernetes probe
	MaxFails    int
	FailTimeout int
}

UpstreamServer describes a server in an upstream

type UpstreamServerByAddrPort

type UpstreamServerByAddrPort []UpstreamServer

UpstreamServerByAddrPort sorts upstream servers by address and port

func (UpstreamServerByAddrPort) Len

func (c UpstreamServerByAddrPort) Len() int

func (UpstreamServerByAddrPort) Less

func (c UpstreamServerByAddrPort) Less(i, j int) bool

func (UpstreamServerByAddrPort) Swap

func (c UpstreamServerByAddrPort) Swap(i, j int)

Jump to

Keyboard shortcuts

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