@@ -295,24 +295,12 @@ type GatewaySpec struct {
295
295
//
296
296
// +optional
297
297
AllowedListeners * AllowedListeners `json:"allowedListeners,omitempty"`
298
-
299
- // TLSConfigs stores TLS configurations for a Gateway.
298
+ // GatewayTLSConfig specifies frontend tls configuration for gateway.
300
299
//
301
- // - If the `port` field in `TLSConfig` is not set, the TLS configuration applies
302
- // to all listeners in the gateway. We call this `default` configuration.
303
- // - If the `port` field in `TLSConfig` is set, the TLS configuration applies
304
- // only to listeners with a matching port. Each port requires a unique TLS configuration.
305
- // - Per-port configurations can override the `default` configuration.
306
- // - The `default` configuration is optional. Clients can apply TLS configuration
307
- // to a subset of listeners by creating only per-port configurations.
308
- // Listeners with a port that does not match any TLS configuration will
309
- // not have `frontendValidation` set.
300
+ // <gateway:experimental>
310
301
//
311
- // Support: Core
312
302
// +optional
313
- //
314
- // <gateway:experimental>
315
- TLSConfigs []TLSConfig `json:"tlsConfigs,omitempty"`
303
+ TLS * GatewayTLSConfig `json:"tls,omitempty"`
316
304
}
317
305
318
306
// AllowedListeners defines which ListenerSets can be attached to this Gateway.
@@ -612,6 +600,31 @@ type ListenerTLSConfig struct {
612
600
Options map [AnnotationKey ]AnnotationValue `json:"options,omitempty"`
613
601
}
614
602
603
+ // GatewayTLSConfig specifies frontend tls configuration for gateway.
604
+ type GatewayTLSConfig struct {
605
+ // defaultTLS specifies the default client certificate validation configuration
606
+ // for all Listeners handling HTTPS traffic, unless a per-port configuration
607
+ // is defined.
608
+ //
609
+ // support: Core
610
+ //
611
+ // +required
612
+ // <gateway:experimental>
613
+ defaultTLS FrontendTLSValidation
614
+
615
+ // tlsPerPort specifies tls configuration assigned per port.
616
+ // Per port configuration is optional. Once set this configuration overrides
617
+ // the default configuration for all Listeners handling HTTPS traffic
618
+ // that match this port.
619
+ // Each override port requires a unique TLS configuration.
620
+ //
621
+ // support: Core
622
+ //
623
+ // +optional
624
+ // <gateway:experimental>
625
+ tlsPerPort []TLSConfig
626
+ }
627
+
615
628
// TLSModeType type defines how a Gateway handles TLS sessions.
616
629
//
617
630
// +kubebuilder:validation:Enum=Terminate;Passthrough
@@ -630,18 +643,17 @@ const (
630
643
TLSModePassthrough TLSModeType = "Passthrough"
631
644
)
632
645
633
- // TLSConfig describes a TLS configuration that can be applied to all Gateway
634
- // Listeners or to all Listeners matching the Port if set.
646
+ // TLSConfig describes a TLS configuration defined per port.
635
647
type TLSConfig struct {
636
648
// The Port indicates the Port Number to which the TLS configuration will be
637
- // applied. If the field is not set the TLS Configuration will be applied to
638
- // all Listeners .
649
+ // applied. This configuration will be applied to all Listeners handling HTTPS
650
+ // traffic that match this port .
639
651
//
640
652
// Support: Extended
641
653
//
642
- // +optional
654
+ // +required
643
655
// <gateway:experimental>
644
- Port * PortNumber `json:"port,omitempty"`
656
+ Port PortNumber `json:"port,omitempty"`
645
657
//
646
658
// FrontendValidation holds configuration information for validating the frontend (client).
647
659
// Setting this field will result in mutual authentication when connecting to the gateway.
@@ -651,9 +663,8 @@ type TLSConfig struct {
651
663
//
652
664
// Support: Extended
653
665
//
654
- // +optional
655
666
// <gateway:experimental>
656
- FrontendValidation * FrontendTLSValidation `json:"frontendValidation,omitempty"`
667
+ FrontendValidation FrontendTLSValidation `json:"frontendValidation,omitempty"`
657
668
}
658
669
659
670
// FrontendTLSValidation holds configuration information that can be used to validate
0 commit comments