@@ -30,8 +30,6 @@ package extensions
30
30
31
31
import (
32
32
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
33
- "k8s.io/apimachinery/pkg/util/intstr"
34
- api "k8s.io/kubernetes/pkg/apis/core"
35
33
)
36
34
37
35
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -40,172 +38,3 @@ import (
40
38
type ReplicationControllerDummy struct {
41
39
metav1.TypeMeta
42
40
}
43
-
44
- // +genclient
45
- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
46
-
47
- // Ingress is a collection of rules that allow inbound connections to reach the
48
- // endpoints defined by a backend. An Ingress can be configured to give services
49
- // externally-reachable urls, load balance traffic, terminate SSL, offer name
50
- // based virtual hosting etc.
51
- type Ingress struct {
52
- metav1.TypeMeta
53
- // Standard object's metadata.
54
- // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
55
- // +optional
56
- metav1.ObjectMeta
57
-
58
- // Spec is the desired state of the Ingress.
59
- // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
60
- // +optional
61
- Spec IngressSpec
62
-
63
- // Status is the current state of the Ingress.
64
- // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
65
- // +optional
66
- Status IngressStatus
67
- }
68
-
69
- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
70
-
71
- // IngressList is a collection of Ingress.
72
- type IngressList struct {
73
- metav1.TypeMeta
74
- // Standard object's metadata.
75
- // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
76
- // +optional
77
- metav1.ListMeta
78
-
79
- // Items is the list of Ingress.
80
- Items []Ingress
81
- }
82
-
83
- // IngressSpec describes the Ingress the user wishes to exist.
84
- type IngressSpec struct {
85
- // A default backend capable of servicing requests that don't match any
86
- // rule. At least one of 'backend' or 'rules' must be specified. This field
87
- // is optional to allow the loadbalancer controller or defaulting logic to
88
- // specify a global default.
89
- // +optional
90
- Backend * IngressBackend
91
-
92
- // TLS configuration. Currently the Ingress only supports a single TLS
93
- // port, 443. If multiple members of this list specify different hosts, they
94
- // will be multiplexed on the same port according to the hostname specified
95
- // through the SNI TLS extension, if the ingress controller fulfilling the
96
- // ingress supports SNI.
97
- // +optional
98
- TLS []IngressTLS
99
-
100
- // A list of host rules used to configure the Ingress. If unspecified, or
101
- // no rule matches, all traffic is sent to the default backend.
102
- // +optional
103
- Rules []IngressRule
104
- // TODO: Add the ability to specify load-balancer IP through claims
105
- }
106
-
107
- // IngressTLS describes the transport layer security associated with an Ingress.
108
- type IngressTLS struct {
109
- // Hosts are a list of hosts included in the TLS certificate. The values in
110
- // this list must match the name/s used in the tlsSecret. Defaults to the
111
- // wildcard host setting for the loadbalancer controller fulfilling this
112
- // Ingress, if left unspecified.
113
- // +optional
114
- Hosts []string
115
- // SecretName is the name of the secret used to terminate SSL traffic on 443.
116
- // Field is left optional to allow SSL routing based on SNI hostname alone.
117
- // If the SNI host in a listener conflicts with the "Host" header field used
118
- // by an IngressRule, the SNI host is used for termination and value of the
119
- // Host header is used for routing.
120
- // +optional
121
- SecretName string
122
- // TODO: Consider specifying different modes of termination, protocols etc.
123
- }
124
-
125
- // IngressStatus describe the current state of the Ingress.
126
- type IngressStatus struct {
127
- // LoadBalancer contains the current status of the load-balancer.
128
- // +optional
129
- LoadBalancer api.LoadBalancerStatus
130
- }
131
-
132
- // IngressRule represents the rules mapping the paths under a specified host to
133
- // the related backend services. Incoming requests are first evaluated for a host
134
- // match, then routed to the backend associated with the matching IngressRuleValue.
135
- type IngressRule struct {
136
- // Host is the fully qualified domain name of a network host, as defined
137
- // by RFC 3986. Note the following deviations from the "host" part of the
138
- // URI as defined in the RFC:
139
- // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the
140
- // IP in the Spec of the parent Ingress.
141
- // 2. The `:` delimiter is not respected because ports are not allowed.
142
- // Currently the port of an Ingress is implicitly :80 for http and
143
- // :443 for https.
144
- // Both these may change in the future.
145
- // Incoming requests are matched against the host before the IngressRuleValue.
146
- // If the host is unspecified, the Ingress routes all traffic based on the
147
- // specified IngressRuleValue.
148
- // +optional
149
- Host string
150
- // IngressRuleValue represents a rule to route requests for this IngressRule.
151
- // If unspecified, the rule defaults to a http catch-all. Whether that sends
152
- // just traffic matching the host to the default backend or all traffic to the
153
- // default backend, is left to the controller fulfilling the Ingress. Http is
154
- // currently the only supported IngressRuleValue.
155
- // +optional
156
- IngressRuleValue
157
- }
158
-
159
- // IngressRuleValue represents a rule to apply against incoming requests. If the
160
- // rule is satisfied, the request is routed to the specified backend. Currently
161
- // mixing different types of rules in a single Ingress is disallowed, so exactly
162
- // one of the following must be set.
163
- type IngressRuleValue struct {
164
- //TODO:
165
- // 1. Consider renaming this resource and the associated rules so they
166
- // aren't tied to Ingress. They can be used to route intra-cluster traffic.
167
- // 2. Consider adding fields for ingress-type specific global options
168
- // usable by a loadbalancer, like http keep-alive.
169
-
170
- // +optional
171
- HTTP * HTTPIngressRuleValue
172
- }
173
-
174
- // HTTPIngressRuleValue is a list of http selectors pointing to backends.
175
- // In the example: http://<host>/<path>?<searchpart> -> backend where
176
- // where parts of the url correspond to RFC 3986, this resource will be used
177
- // to match against everything after the last '/' and before the first '?'
178
- // or '#'.
179
- type HTTPIngressRuleValue struct {
180
- // A collection of paths that map requests to backends.
181
- Paths []HTTPIngressPath
182
- // TODO: Consider adding fields for ingress-type specific global
183
- // options usable by a loadbalancer, like http keep-alive.
184
- }
185
-
186
- // HTTPIngressPath associates a path regex with a backend. Incoming urls matching
187
- // the path are forwarded to the backend.
188
- type HTTPIngressPath struct {
189
- // Path is an extended POSIX regex as defined by IEEE Std 1003.1,
190
- // (i.e this follows the egrep/unix syntax, not the perl syntax)
191
- // matched against the path of an incoming request. Currently it can
192
- // contain characters disallowed from the conventional "path"
193
- // part of a URL as defined by RFC 3986. Paths must begin with
194
- // a '/'. If unspecified, the path defaults to a catch all sending
195
- // traffic to the backend.
196
- // +optional
197
- Path string
198
-
199
- // Backend defines the referenced service endpoint to which the traffic
200
- // will be forwarded to.
201
- Backend IngressBackend
202
- }
203
-
204
- // IngressBackend describes all endpoints for a given service and port.
205
- type IngressBackend struct {
206
- // Specifies the name of the referenced service.
207
- ServiceName string
208
-
209
- // Specifies the port of the referenced service.
210
- ServicePort intstr.IntOrString
211
- }
0 commit comments