Documentation
¶
Overview ¶
Package controller implements a generic controller for monitoring ingress resources in Kubernetes. It delegates update logic to an Updater interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { KubernetesClient k8s.Client Updaters []Updater DefaultAllow string DefaultStripPath bool DefaultExactPath bool DefaultBackendTimeoutSeconds int DefaultBackendMaxConnections int DefaultProxyBufferSize int DefaultProxyBufferBlocks int Name string IncludeClasslessIngresses bool NamespaceSelector *k8s.NamespaceSelector }
Config for creating a new ingress controller.
type Controller ¶
type Controller interface { // Run the controller, returning immediately after it starts or an error occurs. Start() error // Stop the controller, blocking until it stops or an error occurs. Stop() error // Healthy returns true for a healthy controller, false for unhealthy. Health() error }
Controller operates on ingress resources, listening for updates and notifying its Updaters.
type IngressEntry ¶
type IngressEntry struct { // The name of the feed-ingress instance that will manage the ingress resource. IngressClass string // Namespace of the ingress. Namespace string // Name of the ingress. Name string // Host is the fully qualified domain name used for external access. Host string // Path is the url path after the hostname. Must be non-empty. Path string // ServiceAddress is a routable address for the Kubernetes backend service to proxy traffic to. // Must be non-empty. ServiceAddress string // ServicePort is the port to proxy traffic to. Must be non-zero. ServicePort int32 // Allow are the ips or cidrs that are allowed to access the service. Allow []string // LbScheme internet-facing or internal will dictate which kind of load balancer to attach to. LbScheme string // StripPaths before forwarding to the backend StripPaths bool // ExactPath indicates that the Path should be treated as an exact match rather than a prefix ExactPath bool // BackendTimeoutSeconds backend timeout BackendTimeoutSeconds int // BackendMaxConnections maximum backend connections BackendMaxConnections int // Ingress creation time CreationTimestamp time.Time // Ingress resource Ingress *v1beta1.Ingress // Size of the buffer used for reading the first part of the response received from the proxied server. ProxyBufferSize int // Number of buffers used for reading a response from the proxied server, for a single connection. ProxyBufferBlocks int }
IngressEntry describes the ingress for a single host, path, and service.
func (IngressEntry) NamespaceName ¶
func (e IngressEntry) NamespaceName() string
NamespaceName returns the string "Namespace/Name".
type Updater ¶
type Updater interface { // Start the ingress updater, returning immediately after it's started. Start() error // Stop the ingress updater. Blocks until the ingress updater stops or an error occurs. Stop() error // Update the ingress updater configuration. // Not thread safe, should only be called by a single go routine Update(IngressEntries) error // Health returns nil if healthy, otherwise an error. Should be fast to respond, as it // may be called often. Any long running checks should be done separately. Health() error }
Updater that the Controller delegates to.
Click to show internal directories.
Click to hide internal directories.