2016-11-16 18:24:26 +00:00
|
|
|
/*
|
|
|
|
Copyright 2016 The Kubernetes Authors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package ingress
|
|
|
|
|
|
|
|
import (
|
2017-09-17 18:42:31 +00:00
|
|
|
apiv1 "k8s.io/api/core/v1"
|
2017-07-28 22:57:33 +00:00
|
|
|
extensions "k8s.io/api/extensions/v1beta1"
|
2017-04-01 14:39:42 +00:00
|
|
|
"k8s.io/apimachinery/pkg/util/intstr"
|
2018-11-19 21:52:10 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations"
|
2018-11-04 04:14:27 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/modsecurity"
|
2016-11-16 18:24:26 +00:00
|
|
|
|
2017-11-07 22:02:12 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/auth"
|
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/authreq"
|
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/authtls"
|
2018-01-30 04:29:03 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/connection"
|
2017-11-07 22:02:12 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/cors"
|
2018-05-17 12:25:38 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/influxdb"
|
2017-11-07 22:02:12 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/ipwhitelist"
|
2018-02-25 14:38:54 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/log"
|
2018-04-08 20:37:13 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/luarestywaf"
|
2017-11-07 22:02:12 +00:00
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/proxy"
|
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/ratelimit"
|
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/redirect"
|
|
|
|
"k8s.io/ingress-nginx/internal/ingress/annotations/rewrite"
|
|
|
|
"k8s.io/ingress-nginx/internal/ingress/resolver"
|
2016-11-16 18:24:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// DefaultSSLDirectory defines the location where the SSL certificates will be generated
|
|
|
|
// This directory contains all the SSL certificates that are specified in Ingress rules.
|
|
|
|
// The name of each file is <namespace>-<secret name>.pem. The content is the concatenated
|
|
|
|
// certificate and key.
|
|
|
|
DefaultSSLDirectory = "/ingress-controller/ssl"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Configuration holds the definition of all the parts required to describe all
|
|
|
|
// ingresses reachable by the ingress controller (using a filter by namespace)
|
|
|
|
type Configuration struct {
|
|
|
|
// Backends are a list of backends used by all the Ingress rules in the
|
|
|
|
// ingress controller. This list includes the default backend
|
2018-03-12 10:36:35 +00:00
|
|
|
Backends []*Backend `json:"backends,omitempty"`
|
2018-11-02 03:50:08 +00:00
|
|
|
// Servers save the website config
|
2018-03-12 10:36:35 +00:00
|
|
|
Servers []*Server `json:"servers,omitempty"`
|
2018-11-16 16:48:47 +00:00
|
|
|
// TCPEndpoints contain endpoints for tcp streams handled by this backend
|
|
|
|
// +optional
|
|
|
|
TCPEndpoints []L4Service `json:"tcpEndpoints,omitempty"`
|
|
|
|
// UDPEndpoints contain endpoints for udp streams handled by this backend
|
|
|
|
// +optional
|
|
|
|
UDPEndpoints []L4Service `json:"udpEndpoints,omitempty"`
|
2018-11-02 03:50:08 +00:00
|
|
|
// PassthroughBackends contains the backends used for SSL passthrough.
|
2016-11-16 18:24:26 +00:00
|
|
|
// It contains information about the associated Server Name Indication (SNI).
|
|
|
|
// +optional
|
|
|
|
PassthroughBackends []*SSLPassthroughBackend `json:"passthroughBackends,omitempty"`
|
2018-06-21 14:50:57 +00:00
|
|
|
|
2018-07-07 17:46:18 +00:00
|
|
|
// BackendConfigChecksum contains the particular checksum of a Configuration object
|
|
|
|
BackendConfigChecksum string `json:"BackendConfigChecksum,omitempty"`
|
|
|
|
|
2018-06-21 14:50:57 +00:00
|
|
|
// ConfigurationChecksum contains the particular checksum of a Configuration object
|
|
|
|
ConfigurationChecksum string `json:"configurationChecksum,omitempty"`
|
2018-11-27 14:53:51 +00:00
|
|
|
|
|
|
|
// ControllerPodsCount contains the list of running ingress controller Pod(s)
|
|
|
|
ControllerPodsCount int `json:"controllerPodsCount,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Backend describes one or more remote server/s (endpoints) associated with a service
|
2017-08-25 15:50:08 +00:00
|
|
|
// +k8s:deepcopy-gen=true
|
2016-11-16 18:24:26 +00:00
|
|
|
type Backend struct {
|
2017-09-17 18:42:31 +00:00
|
|
|
// Name represents an unique apiv1.Service name formatted as <namespace>-<name>-<port>
|
2017-04-09 23:51:38 +00:00
|
|
|
Name string `json:"name"`
|
2017-09-17 18:42:31 +00:00
|
|
|
Service *apiv1.Service `json:"service,omitempty"`
|
2017-04-09 23:51:38 +00:00
|
|
|
Port intstr.IntOrString `json:"port"`
|
2017-05-14 22:14:27 +00:00
|
|
|
// SecureCACert has the filename and SHA1 of the certificate authorities used to validate
|
|
|
|
// a secured connection to the backend
|
2017-08-22 20:16:59 +00:00
|
|
|
SecureCACert resolver.AuthSSLCert `json:"secureCACert"`
|
2017-04-02 02:32:22 +00:00
|
|
|
// SSLPassthrough indicates that Ingress controller will delegate TLS termination to the endpoints.
|
|
|
|
SSLPassthrough bool `json:"sslPassthrough"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// Endpoints contains the list of endpoints currently running
|
2017-06-14 23:40:25 +00:00
|
|
|
Endpoints []Endpoint `json:"endpoints,omitempty"`
|
2018-03-22 11:14:06 +00:00
|
|
|
// StickySessionAffinitySession contains the StickyConfig object with stickyness configuration
|
2017-06-14 23:40:25 +00:00
|
|
|
SessionAffinity SessionAffinityConfig `json:"sessionAffinityConfig"`
|
2017-09-30 21:29:16 +00:00
|
|
|
// Consistent hashing by NGINX variable
|
|
|
|
UpstreamHashBy string `json:"upstream-hash-by,omitempty"`
|
2018-03-09 21:09:41 +00:00
|
|
|
// LB algorithm configuration per ingress
|
|
|
|
LoadBalancing string `json:"load-balance,omitempty"`
|
2018-09-18 18:05:32 +00:00
|
|
|
// Denotes if a backend has no server. The backend instead shares a server with another backend and acts as an
|
|
|
|
// alternative backend.
|
|
|
|
// This can be used to share multiple upstreams in the sam nginx server block.
|
|
|
|
NoServer bool `json:"noServer"`
|
|
|
|
// Policies to describe the characteristics of an alternative backend.
|
|
|
|
// +optional
|
|
|
|
TrafficShapingPolicy TrafficShapingPolicy `json:"trafficShapingPolicy,omitempty"`
|
|
|
|
// Contains a list of backends without servers that are associated with this backend.
|
|
|
|
// +optional
|
|
|
|
AlternativeBackends []string `json:"alternativeBackends,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// TrafficShapingPolicy describes the policies to put in place when a backend has no server and is used as an
|
|
|
|
// alternative backend
|
|
|
|
// +k8s:deepcopy-gen=true
|
|
|
|
type TrafficShapingPolicy struct {
|
|
|
|
// Weight (0-100) of traffic to redirect to the backend.
|
|
|
|
// e.g. Weight 20 means 20% of traffic will be redirected to the backend and 80% will remain
|
|
|
|
// with the other backend. 0 weight will not send any traffic to this backend
|
|
|
|
Weight int `json:"weight"`
|
|
|
|
// Header on which to redirect requests to this backend
|
|
|
|
Header string `json:"header"`
|
|
|
|
// Cookie on which to redirect requests to this backend
|
|
|
|
Cookie string `json:"cookie"`
|
2017-02-12 23:13:39 +00:00
|
|
|
}
|
|
|
|
|
2018-07-13 13:46:40 +00:00
|
|
|
// HashInclude defines if a field should be used or not to calculate the hash
|
|
|
|
func (s Backend) HashInclude(field string, v interface{}) (bool, error) {
|
|
|
|
return (field != "Endpoints"), nil
|
|
|
|
}
|
|
|
|
|
2017-02-12 23:13:39 +00:00
|
|
|
// SessionAffinityConfig describes different affinity configurations for new sessions.
|
|
|
|
// Once a session is mapped to a backend based on some affinity setting, it
|
|
|
|
// retains that mapping till the backend goes down, or the ingress controller
|
|
|
|
// restarts. Exactly one of these values will be set on the upstream, since multiple
|
|
|
|
// affinity values are incompatible. Once set, the backend makes no guarantees
|
|
|
|
// about honoring updates.
|
2017-08-25 15:50:08 +00:00
|
|
|
// +k8s:deepcopy-gen=true
|
2017-02-12 23:13:39 +00:00
|
|
|
type SessionAffinityConfig struct {
|
2017-06-14 23:40:25 +00:00
|
|
|
AffinityType string `json:"name"`
|
|
|
|
CookieSessionAffinity CookieSessionAffinity `json:"cookieSessionAffinity"`
|
2017-02-12 23:13:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CookieSessionAffinity defines the structure used in Affinity configured by Cookies.
|
2017-08-25 15:50:08 +00:00
|
|
|
// +k8s:deepcopy-gen=true
|
2017-02-12 23:13:39 +00:00
|
|
|
type CookieSessionAffinity struct {
|
2017-06-16 00:43:17 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Hash string `json:"hash"`
|
2018-10-29 07:21:10 +00:00
|
|
|
Expires string `json:"expires,omitempty"`
|
|
|
|
MaxAge string `json:"maxage,omitempty"`
|
2017-06-16 00:43:17 +00:00
|
|
|
Locations map[string][]string `json:"locations,omitempty"`
|
2018-11-19 14:15:24 +00:00
|
|
|
Path string `json:"path,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
}
|
|
|
|
|
2017-02-10 17:16:43 +00:00
|
|
|
// Endpoint describes a kubernetes endpoint in a backend
|
2017-08-25 15:50:08 +00:00
|
|
|
// +k8s:deepcopy-gen=true
|
2016-11-16 18:24:26 +00:00
|
|
|
type Endpoint struct {
|
|
|
|
// Address IP address of the endpoint
|
|
|
|
Address string `json:"address"`
|
|
|
|
// Port number of the TCP port
|
|
|
|
Port string `json:"port"`
|
2017-07-29 13:27:56 +00:00
|
|
|
// Target returns a reference to the object providing the endpoint
|
2018-03-12 10:36:35 +00:00
|
|
|
Target *apiv1.ObjectReference `json:"target,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Server describes a website
|
|
|
|
type Server struct {
|
|
|
|
// Hostname returns the FQDN of the server
|
|
|
|
Hostname string `json:"hostname"`
|
|
|
|
// SSLPassthrough indicates if the TLS termination is realized in
|
|
|
|
// the server or in the remote endpoint
|
|
|
|
SSLPassthrough bool `json:"sslPassthrough"`
|
2018-06-11 17:42:40 +00:00
|
|
|
// SSLCert describes the certificate that will be used on the server
|
|
|
|
SSLCert SSLCert `json:"sslCert"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// Locations list of URIs configured in the server.
|
|
|
|
Locations []*Location `json:"locations,omitempty"`
|
2017-08-19 21:13:02 +00:00
|
|
|
// Alias return the alias of the server name
|
2017-08-10 03:22:54 +00:00
|
|
|
Alias string `json:"alias,omitempty"`
|
2017-08-19 21:13:02 +00:00
|
|
|
// RedirectFromToWWW returns if a redirect to/from prefix www is required
|
|
|
|
RedirectFromToWWW bool `json:"redirectFromToWWW,omitempty"`
|
2017-08-22 20:16:59 +00:00
|
|
|
// CertificateAuth indicates the this server requires mutual authentication
|
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
CertificateAuth authtls.Config `json:"certificateAuth"`
|
2017-09-20 09:35:16 +00:00
|
|
|
// ServerSnippet returns the snippet of server
|
2017-09-27 06:59:10 +00:00
|
|
|
// +optional
|
2017-09-20 09:35:16 +00:00
|
|
|
ServerSnippet string `json:"serverSnippet"`
|
2018-01-31 16:53:07 +00:00
|
|
|
// SSLCiphers returns list of ciphers to be enabled
|
|
|
|
SSLCiphers string `json:"sslCiphers,omitempty"`
|
2018-02-25 20:20:14 +00:00
|
|
|
// AuthTLSError contains the reason why the access to a server should be denied
|
|
|
|
AuthTLSError string `json:"authTLSError,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Location describes an URI inside a server.
|
|
|
|
// Also contains additional information about annotations in the Ingress.
|
|
|
|
//
|
|
|
|
// In some cases when more than one annotations is defined a particular order in the execution
|
|
|
|
// is required.
|
|
|
|
// The chain in the execution order of annotations should be:
|
|
|
|
// - Whitelist
|
|
|
|
// - RateLimit
|
|
|
|
// - BasicDigestAuth
|
|
|
|
// - ExternalAuth
|
|
|
|
// - Redirect
|
|
|
|
type Location struct {
|
|
|
|
// Path is an extended POSIX regex as defined by IEEE Std 1003.1,
|
|
|
|
// (i.e this follows the egrep/unix syntax, not the perl syntax)
|
|
|
|
// matched against the path of an incoming request. Currently it can
|
|
|
|
// contain characters disallowed from the conventional "path"
|
|
|
|
// part of a URL as defined by RFC 3986. Paths must begin with
|
|
|
|
// a '/'. If unspecified, the path defaults to a catch all sending
|
|
|
|
// traffic to the backend.
|
|
|
|
Path string `json:"path"`
|
|
|
|
// IsDefBackend indicates if service specified in the Ingress
|
|
|
|
// contains active endpoints or not. Returning true means the location
|
|
|
|
// uses the default backend.
|
|
|
|
IsDefBackend bool `json:"isDefBackend"`
|
2017-08-25 15:50:08 +00:00
|
|
|
// Ingress returns the ingress from which this location was generated
|
2018-11-19 21:52:10 +00:00
|
|
|
Ingress *Ingress `json:"ingress"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// Backend describes the name of the backend to use.
|
|
|
|
Backend string `json:"backend"`
|
2017-08-25 15:50:08 +00:00
|
|
|
// Service describes the referenced services from the ingress
|
2017-09-17 18:42:31 +00:00
|
|
|
Service *apiv1.Service `json:"service,omitempty"`
|
2017-08-25 15:50:08 +00:00
|
|
|
// Port describes to which port from the service
|
|
|
|
Port intstr.IntOrString `json:"port"`
|
2017-05-15 19:17:58 +00:00
|
|
|
// Overwrite the Host header passed into the backend. Defaults to
|
|
|
|
// vhost of the incoming request.
|
|
|
|
// +optional
|
|
|
|
UpstreamVhost string `json:"upstream-vhost"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// BasicDigestAuth returns authentication configuration for
|
|
|
|
// an Ingress rule.
|
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
BasicDigestAuth auth.Config `json:"basicDigestAuth,omitempty"`
|
2016-12-29 20:02:06 +00:00
|
|
|
// Denied returns an error when this location cannot not be allowed
|
|
|
|
// Requesting a denied location should return HTTP code 403.
|
2017-06-14 23:40:25 +00:00
|
|
|
Denied error `json:"denied,omitempty"`
|
2018-02-08 03:15:50 +00:00
|
|
|
// CorsConfig returns the Cors Configuration for the ingress rule
|
2016-11-16 18:24:26 +00:00
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
CorsConfig cors.Config `json:"corsConfig,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// ExternalAuth indicates the access to this location requires
|
|
|
|
// authentication using an external provider
|
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
ExternalAuth authreq.Config `json:"externalAuth,omitempty"`
|
2018-10-12 19:48:10 +00:00
|
|
|
// HTTP2PushPreload allows to configure the HTTP2 Push Preload from backend
|
|
|
|
// original location.
|
|
|
|
// +optional
|
|
|
|
HTTP2PushPreload bool `json:"http2PushPreload,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// RateLimit describes a limit in the number of connections per IP
|
|
|
|
// address or connections per second.
|
|
|
|
// The Redirect annotation precedes RateLimit
|
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
RateLimit ratelimit.Config `json:"rateLimit,omitempty"`
|
2017-08-19 21:13:02 +00:00
|
|
|
// Redirect describes a temporal o permanent redirection this location.
|
2016-11-16 18:24:26 +00:00
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
Redirect redirect.Config `json:"redirect,omitempty"`
|
2017-08-19 21:13:02 +00:00
|
|
|
// Rewrite describes the redirection this location.
|
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
Rewrite rewrite.Config `json:"rewrite,omitempty"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// Whitelist indicates only connections from certain client
|
|
|
|
// addresses or networks are allowed.
|
|
|
|
// +optional
|
|
|
|
Whitelist ipwhitelist.SourceRange `json:"whitelist,omitempty"`
|
|
|
|
// Proxy contains information about timeouts and buffer sizes
|
|
|
|
// to be used in connections against endpoints
|
|
|
|
// +optional
|
2017-11-07 16:36:51 +00:00
|
|
|
Proxy proxy.Config `json:"proxy,omitempty"`
|
2017-01-20 22:37:59 +00:00
|
|
|
// UsePortInRedirects indicates if redirects must specify the port
|
|
|
|
// +optional
|
2017-08-25 15:50:08 +00:00
|
|
|
UsePortInRedirects bool `json:"usePortInRedirects"`
|
2017-02-23 18:10:32 +00:00
|
|
|
// ConfigurationSnippet contains additional configuration for the backend
|
|
|
|
// to be considered in the configuration of the location
|
2017-08-25 15:50:08 +00:00
|
|
|
ConfigurationSnippet string `json:"configurationSnippet"`
|
2018-03-12 10:36:35 +00:00
|
|
|
// Connection contains connection header to override the default Connection header
|
2018-01-30 04:29:03 +00:00
|
|
|
// to the request.
|
|
|
|
// +optional
|
|
|
|
Connection connection.Config `json:"connection"`
|
2017-08-20 07:00:01 +00:00
|
|
|
// ClientBodyBufferSize allows for the configuration of the client body
|
|
|
|
// buffer size for a specific location.
|
|
|
|
// +optional
|
2017-08-25 15:50:08 +00:00
|
|
|
ClientBodyBufferSize string `json:"clientBodyBufferSize,omitempty"`
|
|
|
|
// DefaultBackend allows the use of a custom default backend for this location.
|
|
|
|
// +optional
|
2017-09-17 18:42:31 +00:00
|
|
|
DefaultBackend *apiv1.Service `json:"defaultBackend,omitempty"`
|
2017-12-06 20:11:18 +00:00
|
|
|
// XForwardedPrefix allows to add a header X-Forwarded-Prefix to the request with the
|
|
|
|
// original location.
|
|
|
|
// +optional
|
|
|
|
XForwardedPrefix bool `json:"xForwardedPrefix,omitempty"`
|
2018-02-25 14:38:54 +00:00
|
|
|
// Logs allows to enable or disable the nginx logs
|
2018-04-27 12:28:57 +00:00
|
|
|
// By default access logs are enabled and rewrite logs are disabled
|
2018-02-25 14:38:54 +00:00
|
|
|
Logs log.Config `json:"logs,omitempty"`
|
2018-04-08 20:37:13 +00:00
|
|
|
// LuaRestyWAF contains parameters to configure lua-resty-waf
|
|
|
|
LuaRestyWAF luarestywaf.Config `json:"luaRestyWAF"`
|
2018-05-17 12:25:38 +00:00
|
|
|
// InfluxDB allows to monitor the incoming request by sending them to an influxdb database
|
|
|
|
// +optional
|
|
|
|
InfluxDB influxdb.Config `json:"influxDB,omitempty"`
|
2018-08-05 22:43:45 +00:00
|
|
|
// BackendProtocol indicates which protocol should be used to communicate with the service
|
|
|
|
// By default this is HTTP
|
|
|
|
BackendProtocol string `json:"backend-protocol"`
|
2018-10-25 16:35:48 +00:00
|
|
|
// CustomHTTPErrors specifies the error codes that should be intercepted.
|
|
|
|
// +optional
|
|
|
|
CustomHTTPErrors []int `json:"custom-http-errors"`
|
2018-11-04 04:14:27 +00:00
|
|
|
// ModSecurity allows to enable and configure modsecurity
|
|
|
|
// +optional
|
|
|
|
ModSecurity modsecurity.Config `json:"modsecurity"`
|
2016-11-16 18:24:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SSLPassthroughBackend describes a SSL upstream server configured
|
|
|
|
// as passthrough (no TLS termination in the ingress controller)
|
|
|
|
// The endpoints must provide the TLS termination exposing the required SSL certificate.
|
|
|
|
// The ingress controller only pipes the underlying TCP connection
|
|
|
|
type SSLPassthroughBackend struct {
|
2018-03-12 10:36:35 +00:00
|
|
|
Service *apiv1.Service `json:"service,omitempty"`
|
2017-04-09 23:51:38 +00:00
|
|
|
Port intstr.IntOrString `json:"port"`
|
2016-11-16 18:24:26 +00:00
|
|
|
// Backend describes the endpoints to use.
|
|
|
|
Backend string `json:"namespace,omitempty"`
|
|
|
|
// Hostname returns the FQDN of the server
|
|
|
|
Hostname string `json:"hostname"`
|
|
|
|
}
|
2017-02-24 21:46:39 +00:00
|
|
|
|
|
|
|
// L4Service describes a L4 Ingress service.
|
|
|
|
type L4Service struct {
|
|
|
|
// Port external port to expose
|
|
|
|
Port int `json:"port"`
|
|
|
|
// Backend of the service
|
|
|
|
Backend L4Backend `json:"backend"`
|
|
|
|
// Endpoints active endpoints of the service
|
2018-03-12 10:36:35 +00:00
|
|
|
Endpoints []Endpoint `json:"endpoints,omitempty"`
|
2017-02-24 21:46:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// L4Backend describes the kubernetes service behind L4 Ingress service
|
|
|
|
type L4Backend struct {
|
|
|
|
Port intstr.IntOrString `json:"port"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Namespace string `json:"namespace"`
|
2017-09-17 18:42:31 +00:00
|
|
|
Protocol apiv1.Protocol `json:"protocol"`
|
2017-07-02 20:46:15 +00:00
|
|
|
// +optional
|
2017-09-27 14:10:16 +00:00
|
|
|
ProxyProtocol ProxyProtocol `json:"proxyProtocol"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProxyProtocol describes the proxy protocol configuration
|
|
|
|
type ProxyProtocol struct {
|
|
|
|
Decode bool `json:"decode"`
|
|
|
|
Encode bool `json:"encode"`
|
2017-02-24 21:46:39 +00:00
|
|
|
}
|
2018-11-19 21:52:10 +00:00
|
|
|
|
|
|
|
// Ingress holds the definition of an Ingress plus its annotations
|
|
|
|
type Ingress struct {
|
|
|
|
extensions.Ingress
|
|
|
|
ParsedAnnotations *annotations.Ingress
|
|
|
|
}
|
2018-11-27 14:53:51 +00:00
|
|
|
|
|
|
|
// GeneralConfig holds the definition of lua general configuration data
|
|
|
|
type GeneralConfig struct {
|
|
|
|
ControllerPodsCount int `json:"controllerPodsCount"`
|
|
|
|
}
|