This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 279
/
egress_types.go
64 lines (53 loc) · 2.84 KB
/
egress_types.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
61
62
63
64
package trafficpolicy
// EgressTrafficPolicy is the type used to represent the different egress traffic policy configurations
// applicable to a client of Egress destinations.
type EgressTrafficPolicy struct {
// TrafficMatches defines the list of traffic matches for matching Egress traffic.
// The matches specified are used to match outbound traffic as Egress traffic, and
// subject matching traffic to Egress traffic policies.
TrafficMatches []*TrafficMatch
// HTTPRouteConfigsPerPort defines the Egress HTTP route configurations per port.
// Egress HTTP routes are grouped based on their port to avoid route conflicts that
// can arise when the same host headers are to be routed differently based on the
// port specified in an egress policy.
HTTPRouteConfigsPerPort map[int][]*EgressHTTPRouteConfig
// ClustersConfigs defines the list of Egress cluster configurations.
// The specified config is used to program external clusters corresponding to
// the external endpoints defined in an Egress policy.
ClustersConfigs []*EgressClusterConfig
}
// EgressClusterConfig is the type used to represent an external cluster corresponding to a
// destination specified in an Egress policy.
type EgressClusterConfig struct {
// Name defines the name of the external cluster
Name string
// Host defines the DNS resolvabe hostname for the external cluster.
// If specified, the cluster's address will be resolved using DNS.
// HTTP based clusters will set the Host attribute.
// If unspecified, the cluster's address will be resolved to its original
// destination in the request prior to being redirected by iptables.
// TCP based clusters will not set the Host attribute.
// +optional
Host string
// Port defines the port number of the external cluster's endpoint
Port int
}
// EgressHTTPRouteConfig is the type used to represent an HTTP route configuration along with associated routing rules
type EgressHTTPRouteConfig struct {
// Name defines the name of the Egress HTTP route configuration
Name string
// Hostnames defines the list of hostnames corresponding to the Egress HTTP route configuration.
// The Hostnames match against the :host header in the HTTP request and subject matching requests
// to the routing rules defined by `RoutingRules`.
Hostnames []string
// RoutingRules defines the list of routes for the Egress HTTP route configuration, and corresponding
// rules to be applied to those routes.
RoutingRules []*EgressHTTPRoutingRule
}
// EgressHTTPRoutingRule is the type used to represent an Egress HTTP routing rule with its route and associated permissions
type EgressHTTPRoutingRule struct {
// Route defines the HTTP route match and its associated cluster.
Route RouteWeightedClusters
// AllowedDestinationIPRanges defines the destination IP ranges allowed for the `Route` defined in the routing rule.
AllowedDestinationIPRanges []string
}