Documentation ¶
Index ¶
- Constants
- Variables
- func PortDefFromIntStr(is intstr.IntOrString) kongstate.PortDef
- func PortDefFromServiceBackendPort(sbp *netv1.ServiceBackendPort) kongstate.PortDef
- type Parser
- func (p *Parser) Build() (*kongstate.KongState, []failures.ResourceFailure)
- func (p *Parser) EnableCombinedServiceRoutes()
- func (p *Parser) EnableKubernetesObjectReports()
- func (p *Parser) EnableRegexPathPrefix()
- func (p *Parser) GenerateKubernetesObjectReport() []client.Object
- func (p *Parser) ReportKubernetesObjectUpdate(obj client.Object)
- type SNIs
- type SecretNameToSNIs
Constants ¶
const ( // DefaultServiceTimeout indicates the amount of time (by default) for // connections, reads and writes to a service over a network should // be given before timing out by default. DefaultServiceTimeout = 60000 // DefaultRetries indicates the number of times a connection should be // retried by default. DefaultRetries = 5 // DefaultHTTPPort is the network port that should be assumed by default // for HTTP traffic to services. DefaultHTTPPort = 80 )
const (
KindGateway = gatewayv1beta1.Kind("Gateway")
)
Variables ¶
var LegacyRegexPathExpression = regexp.MustCompile(`^[a-zA-Z0-9\.\-_~/%]*$`)
LegacyRegexPathExpression is the regular expression used by Kong <3.0 to determine if a path is not a regex.
Functions ¶
func PortDefFromIntStr ¶
func PortDefFromIntStr(is intstr.IntOrString) kongstate.PortDef
func PortDefFromServiceBackendPort ¶
func PortDefFromServiceBackendPort(sbp *netv1.ServiceBackendPort) kongstate.PortDef
Types ¶
type Parser ¶ added in v2.3.0
type Parser struct {
// contains filtered or unexported fields
}
Parser parses Kubernetes objects and configurations into their equivalent Kong objects and configurations, producing a complete state configuration for the Kong Admin API.
func NewParser ¶ added in v2.3.0
NewParser produces a new Parser object provided a logging mechanism and a Kubernetes object store.
func (*Parser) Build ¶ added in v2.3.0
func (p *Parser) Build() (*kongstate.KongState, []failures.ResourceFailure)
Build creates a Kong configuration from Ingress and Custom resources defined in Kubernetes. It returns a slice of ResourceFailures which should be used to provide users with feedback on Kubernetes objects validity.
func (*Parser) EnableCombinedServiceRoutes ¶ added in v2.4.0
func (p *Parser) EnableCombinedServiceRoutes()
EnableCombinedServiceRoutes changes the translation logic from the legacy mode which would create a kong.Route object per each individual path on an Ingress object to a mode that can combine routes for paths where the service name, host and port match for those paths.
func (*Parser) EnableKubernetesObjectReports ¶ added in v2.3.0
func (p *Parser) EnableKubernetesObjectReports()
EnableKubernetesObjectReports turns on object reporting for this parser: each subsequent call to Build() will track the Kubernetes objects which were successfully parsed. Objects tracked this way can be retrieved by calling GenerateKubernetesObjectReport().
func (*Parser) EnableRegexPathPrefix ¶ added in v2.6.0
func (p *Parser) EnableRegexPathPrefix()
EnableRegexPathPrefix enables adding the Kong 3.x+ regex path prefix on regex paths generated by the controller (to satisfy the Ingress Prefix and Exact path types) or indicated by a resource (e.g. when an HTTPRoute uses a RegularExpression Match). It does _not_ enable heuristic regex path detection for Ingress ImplementationSpecific paths, which require an IngressClass setting.
func (*Parser) GenerateKubernetesObjectReport ¶ added in v2.3.0
GenerateKubernetesObjectReport provides a list of all the Kubernetes objects that have been successfully parsed as part of Build() calls so far. The objects are consumed: the parser's internal list will be emptied once this method is called, until more builds are run.
func (*Parser) ReportKubernetesObjectUpdate ¶ added in v2.3.0
ReportKubernetesObjectUpdate reports an update to a Kubernetes object if updates have been requested. If the parser has not been configured to report Kubernetes object updates this is a no-op.
type SecretNameToSNIs ¶
type SecretNameToSNIs struct {
// contains filtered or unexported fields
}
func (SecretNameToSNIs) Hosts ¶ added in v2.8.0
func (m SecretNameToSNIs) Hosts(secretKey string) []string
Source Files ¶
- ingressrules.go
- parser.go
- service_names.go
- translate.go
- translate_errors.go
- translate_httproute.go
- translate_ingress.go
- translate_knative.go
- translate_kong_l4.go
- translate_routes_helpers.go
- translate_secrets.go
- translate_tcproute.go
- translate_tlsroute.go
- translate_udproute.go
- translate_utils.go
- translate_vars.go
- wrappers_backendref.go
- wrappers_refchecker.go