-
Notifications
You must be signed in to change notification settings - Fork 589
/
ingress_rules.go
60 lines (53 loc) · 2.3 KB
/
ingress_rules.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package v1beta1
// UDPIngressRule represents a rule to apply against incoming requests
// wherein no Host matching is available for request routing, only the port
// is used to match requests.
type UDPIngressRule struct {
// Port indicates the port for the Kong proxy to accept incoming traffic
// on, which will then be routed to the service Backend.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
// +kubebuilder:validation:Format=int32
Port int `json:"port"`
// Backend defines the Kubernetes service which accepts traffic from the
// listening Port defined above.
Backend IngressBackend `json:"backend"`
}
// IngressRule represents a rule to apply against incoming requests.
// Matching is performed based on an (optional) SNI and port.
type IngressRule struct {
// Host is the fully qualified domain name of a network host, as defined
// by RFC 3986.
// If a Host is not specified, then port-based TCP routing is performed. Kong
// doesn't care about the content of the TCP stream in this case.
// If a Host is specified, the protocol must be TLS over TCP.
// A plain-text TCP request cannot be routed based on Host. It can only
// be routed based on Port.
// +kubebuilder:validation:Optional
Host string `json:"host,omitempty"`
// Port is the port on which to accept TCP or TLS over TCP sessions and
// route. It is a required field. If a Host is not specified, the requested
// are routed based only on Port.
// +kubebuilder:validation:Required
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
// +kubebuilder:validation:Format=int32
Port int `json:"port"`
// Backend defines the referenced service endpoint to which the traffic
// will be forwarded to.
// +kubebuilder:validation:Required
Backend IngressBackend `json:"backend"`
}
// IngressBackend describes all endpoints for a given service and port.
type IngressBackend struct {
// Specifies the name of the referenced service.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
ServiceName string `json:"serviceName"`
// Specifies the port of the referenced service.
// +kubebuilder:validation:Required
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
// +kubebuilder:validation:Format=int32
ServicePort int `json:"servicePort"`
}