Documentation ¶
Index ¶
- Constants
- func PathsFromIngressPaths(httpIngressPath netv1.HTTPIngressPath, addRegexPrefix bool) []*string
- func PortDefFromIntStr(is intstr.IntOrString) kongstate.PortDef
- func PortDefFromServiceBackendPort(sbp *netv1.ServiceBackendPort) kongstate.PortDef
- func TranslateIngress(ingress *netv1.Ingress, addRegexPrefix bool) []*kongstate.Service
- type KongRouteTranslation
- type KongServiceTranslation
Constants ¶
const ( // KongPathRegexPrefix is the reserved prefix string that instructs Kong 3.0+ to interpret a path as a regex. KongPathRegexPrefix = "~" // ControllerPathRegePrefix is the prefix string used to indicate that the controller should treat a path as a // regular expression. The controller replaces this prefix with KongPathRegexPrefix when sending routes to Kong. ControllerPathRegexPrefix = "/~" )
Variables ¶
This section is empty.
Functions ¶
func PathsFromIngressPaths ¶ added in v2.6.0
func PathsFromIngressPaths(httpIngressPath netv1.HTTPIngressPath, addRegexPrefix bool) []*string
PathsFromIngressPaths takes a path and Ingress path type and returns a set of Kong route paths that satisfy that path type. It optionally adds the Kong 3.x regex path prefix for path types that require a regex path. It rejects unknown path types with an error.
func PortDefFromIntStr ¶ added in v2.8.1
func PortDefFromIntStr(is intstr.IntOrString) kongstate.PortDef
func PortDefFromServiceBackendPort ¶ added in v2.8.1
func PortDefFromServiceBackendPort(sbp *netv1.ServiceBackendPort) kongstate.PortDef
Types ¶
type KongRouteTranslation ¶ added in v2.8.0
type KongRouteTranslation struct { Name string Matches []gatewayv1beta1.HTTPRouteMatch Filters []gatewayv1beta1.HTTPRouteFilter }
KongRouteTranslation is a translation of a single HTTPRoute rule into metadata that can be used to instantiate Kong routes.
type KongServiceTranslation ¶ added in v2.8.0
type KongServiceTranslation struct { Name string BackendRefs []gatewayv1beta1.HTTPBackendRef KongRoutes []KongRouteTranslation }
KongServiceTranslation is a translation of a single HTTPRoute into metadata that can be used to instantiate Kong routes and services. Routes from this object should route traffic to BackendRefs from this object.
func TranslateHTTPRoute ¶ added in v2.8.0
func TranslateHTTPRoute(route *gatewayv1beta1.HTTPRoute) []*KongServiceTranslation
TranslateHTTPRoute translates a list of HTTPRoutes into a list of HTTPRouteTranslationMeta objects that can be used to instantiate Kong routes and services. The translation is done by grouping the HTTPRoutes by their backendRefs. This means that all the rules of a single HTTPRoute will be grouped together if they share the same backendRefs.