@@ -235,10 +235,23 @@ type IngressList struct {
235
235
236
236
// IngressSpec describes the Ingress the user wishes to exist.
237
237
type IngressSpec struct {
238
- // A default backend capable of servicing requests that don't match any
239
- // rule. At least one of 'backend' or 'rules' must be specified. This field
240
- // is optional to allow the loadbalancer controller or defaulting logic to
241
- // specify a global default.
238
+ // IngressClassName is the name of the IngressClass cluster resource. The
239
+ // associated IngressClass defines which controller will implement the
240
+ // resource. This replaces the deprecated `kubernetes.io/ingress.class`
241
+ // annotation. For backwards compatibility, when that annotation is set, it
242
+ // must be given precedence over this field. The controller may emit a
243
+ // warning if the field and annotation have different values.
244
+ // Implementations of this API should ignore Ingresses without a class
245
+ // specified. An IngressClass resource may be marked as default, which can
246
+ // be used to set a default value for this field. For more information,
247
+ // refer to the IngressClass documentation.
248
+ // +optional
249
+ IngressClassName * string
250
+
251
+ // Backend is a default backend capable of servicing requests that don't
252
+ // match any rule. At least one of 'backend' or 'rules' must be specified.
253
+ // This field is optional to allow the loadbalancer controller or defaulting
254
+ // logic to specify a global default.
242
255
// +optional
243
256
Backend * IngressBackend
244
257
@@ -257,6 +270,55 @@ type IngressSpec struct {
257
270
// TODO: Add the ability to specify load-balancer IP through claims
258
271
}
259
272
273
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
274
+
275
+ // IngressClass represents the class of the Ingress, referenced by the Ingress
276
+ // Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be
277
+ // used to indicate that an IngressClass should be considered default. When a
278
+ // single IngressClass resource has this annotation set to true, new Ingress
279
+ // resources without a class specified will be assigned this default class.
280
+ type IngressClass struct {
281
+ metav1.TypeMeta
282
+ metav1.ObjectMeta
283
+
284
+ // Spec is the desired state of the IngressClass.
285
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
286
+ // +optional
287
+ Spec IngressClassSpec
288
+ }
289
+
290
+ // IngressClassSpec provides information about the class of an Ingress.
291
+ type IngressClassSpec struct {
292
+ // Controller refers to the name of the controller that should handle this
293
+ // class. This allows for different "flavors" that are controlled by the
294
+ // same controller. For example, you may have different Parameters for the
295
+ // same implementing controller. This should be specified as a
296
+ // domain-prefixed path no more than 250 characters in length, e.g.
297
+ // "acme.io/ingress-controller". This field is immutable.
298
+ Controller string
299
+
300
+ // Parameters is a link to a resource containing additional configuration
301
+ // for the controller. This is optional if the controller does not require
302
+ // extra parameters. Example configuration resources include
303
+ // `core.ConfigMap` or a controller specific Custom Resource.
304
+ // +optional
305
+ Parameters * api.TypedLocalObjectReference
306
+ }
307
+
308
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
309
+
310
+ // IngressClassList is a collection of IngressClasses.
311
+ type IngressClassList struct {
312
+ metav1.TypeMeta
313
+ // Standard object's metadata.
314
+ // +optional
315
+ metav1.ListMeta
316
+
317
+ // Items is the list of IngressClasses.
318
+ // +listType=set
319
+ Items []IngressClass
320
+ }
321
+
260
322
// IngressTLS describes the transport layer security associated with an Ingress.
261
323
type IngressTLS struct {
262
324
// Hosts are a list of hosts included in the TLS certificate. The values in
@@ -265,11 +327,11 @@ type IngressTLS struct {
265
327
// Ingress, if left unspecified.
266
328
// +optional
267
329
Hosts []string
268
- // SecretName is the name of the secret used to terminate SSL traffic on 443.
269
- // Field is left optional to allow SSL routing based on SNI hostname alone.
270
- // If the SNI host in a listener conflicts with the "Host" header field used
271
- // by an IngressRule, the SNI host is used for termination and value of the
272
- // Host header is used for routing.
330
+ // SecretName is the name of the secret used to terminate TLS traffic on
331
+ // port 443. Field is left optional to allow TLS routing based on SNI
332
+ // hostname alone. If the SNI host in a listener conflicts with the "Host"
333
+ // header field used by an IngressRule, the SNI host is used for termination
334
+ // and value of the Host header is used for routing.
273
335
// +optional
274
336
SecretName string
275
337
// TODO: Consider specifying different modes of termination, protocols etc.
0 commit comments