Documentation ¶
Index ¶
- Constants
- func DeleteMatchRule(url string, headerValue string, routeSpec *IngressRouteSpec) error
- func InsertMatchRule(url string, headerValue string, serviceName string, port int32, ...)
- func IsRulePresent(url string, headerValue string, routeSpec IngressRouteSpec) bool
- func ValidateMatchRule(url string, headerValue string, route Route) bool
- type IngressRoute
- type IngressRouteList
- type IngressRouteSpec
- type LoadBalancerSpec
- type MiddlewareRef
- type Route
- type Service
Constants ¶
const ( HEADER_KEY = "rzpctx-dev-serve-user" KIND = "Rule" INGRESS_ABS_PATH = "/apis/traefik.containo.us/v1alpha1/namespaces/%s/ingressroutes" RETRY_LIMIT = 3 INGRESS_URL = "INGRESS_URL" NAMESPACE = "NAMESPACE" HEADER_VALUE = "HEADER_VALUE" INGRESS_ROUTE_NAME = "INGRESS_ROUTE_NAME" SERVICE_NAME = "SERVICE_NAME" SERVICE_PORT = "SERVICE_PORT" )
Variables ¶
This section is empty.
Functions ¶
func DeleteMatchRule ¶
func DeleteMatchRule(url string, headerValue string, routeSpec *IngressRouteSpec) error
DeleteMatchRule deletes the match rule from the ingressroute spec
func InsertMatchRule ¶
func InsertMatchRule(url string, headerValue string, serviceName string, port int32, routeSpec *IngressRouteSpec)
InsertMatchRule inserts the match rule to the ingressroute spec
func IsRulePresent ¶
func IsRulePresent(url string, headerValue string, routeSpec IngressRouteSpec) bool
IsRulePresent validates if there is already an entry for routes in the Ingress route object
Types ¶
type IngressRoute ¶
type IngressRoute struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` Spec IngressRouteSpec `json:"spec"` }
IngressRoute is an Ingress CRD specification.
func GetIngressRoute ¶
func GetIngressRoute(clientset *kubernetes.Clientset, namespace string, resourceName string) (*IngressRoute, error)
GetIngressRoute gets the ingressroute for the provided arguments
func PatchIngressRoute ¶
func PatchIngressRoute(clientset *kubernetes.Clientset, namespace string, resourceName string, ingressroute IngressRoute) (*IngressRoute, error)
PatchIngressRoute patches the ingress route with the provided arguments
type IngressRouteList ¶
type IngressRouteList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []IngressRoute `json:"items"` }
IngressRouteList is a list of IngressRoutes.
type IngressRouteSpec ¶
type IngressRouteSpec struct { Routes []Route `json:"routes"` EntryPoints []string `json:"entryPoints,omitempty"` }
IngressRouteSpec is a specification for a IngressRouteSpec resource.
type LoadBalancerSpec ¶
type LoadBalancerSpec struct { // Name is a reference to a Kubernetes Service object (for a load-balancer of servers), // or to a TraefikService object (service load-balancer, mirroring, etc). // The differentiation between the two is specified in the Kind field. Name string `json:"name"` // +kubebuilder:validation:Enum=Service;TraefikService Kind string `json:"kind,omitempty"` Namespace string `json:"namespace,omitempty"` Port int32 `json:"port,omitempty"` Scheme string `json:"scheme,omitempty"` Strategy string `json:"strategy,omitempty"` PassHostHeader *bool `json:"passHostHeader,omitempty"` ServersTransport string `json:"serversTransport,omitempty"` // Weight should only be specified when Name references a TraefikService object // (and to be precise, one that embeds a Weighted Round Robin). Weight *int `json:"weight,omitempty"` }
LoadBalancerSpec can reference either a Kubernetes Service object (a load-balancer of servers), or a TraefikService object (a traefik load-balancer of services).
type MiddlewareRef ¶
type MiddlewareRef struct { Name string `json:"name"` Namespace string `json:"namespace,omitempty"` }
MiddlewareRef is a ref to the Middleware resources.
type Route ¶
type Route struct { Match string `json:"match"` // +kubebuilder:validation:Enum=Rule Kind string `json:"kind"` Priority int `json:"priority,omitempty"` Services []Service `json:"services,omitempty"` Middlewares []MiddlewareRef `json:"middlewares,omitempty"` }
Route contains the set of routes.
type Service ¶
type Service struct {
LoadBalancerSpec `json:",inline"`
}
Service defines an upstream to proxy traffic.