@@ -295,24 +295,13 @@ type GatewaySpec struct {
295
295
//
296
296
// +optional
297
297
AllowedListeners * AllowedListeners `json:"allowedListeners,omitempty"`
298
-
299
- // TLSConfigs stores TLS configurations for a Gateway.
300
- //
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.
298
+ // GatewayTLSConfig specifies frontend tls configuration for gateway.
310
299
//
311
300
// Support: Core
312
- // +optional
313
301
//
302
+ // +optional
314
303
// <gateway:experimental>
315
- TLSConfigs [] TLSConfig `json:"tlsConfigs ,omitempty"`
304
+ TLS * GatewayTLSConfig `json:"tls ,omitempty"`
316
305
}
317
306
318
307
// AllowedListeners defines which ListenerSets can be attached to this Gateway.
@@ -612,6 +601,31 @@ type ListenerTLSConfig struct {
612
601
Options map [AnnotationKey ]AnnotationValue `json:"options,omitempty"`
613
602
}
614
603
604
+ // GatewayTLSConfig specifies frontend tls configuration for gateway.
605
+ type GatewayTLSConfig struct {
606
+ // defaultTLS specifies the default client certificate validation configuration
607
+ // for all Listeners handling HTTPS traffic, unless a per-port configuration
608
+ // is defined.
609
+ //
610
+ // support: Core
611
+ //
612
+ // +required
613
+ // <gateway:experimental>
614
+ DefaultTLS FrontendTLSValidation `json:"defaultTLS"`
615
+
616
+ // tlsPerPort specifies tls configuration assigned per port.
617
+ // Per port configuration is optional. Once set this configuration overrides
618
+ // the default configuration for all Listeners handling HTTPS traffic
619
+ // that match this port.
620
+ // Each override port requires a unique TLS configuration.
621
+ //
622
+ // support: Core
623
+ //
624
+ // +optional
625
+ // <gateway:experimental>
626
+ TLSPerPort []TLSConfig `json:"tlsPerPort,omitempty"`
627
+ }
628
+
615
629
// TLSModeType type defines how a Gateway handles TLS sessions.
616
630
//
617
631
// +kubebuilder:validation:Enum=Terminate;Passthrough
@@ -630,18 +644,17 @@ const (
630
644
TLSModePassthrough TLSModeType = "Passthrough"
631
645
)
632
646
633
- // TLSConfig describes a TLS configuration that can be applied to all Gateway
634
- // Listeners or to all Listeners matching the Port if set.
647
+ // TLSConfig describes a TLS configuration defined per port.
635
648
type TLSConfig struct {
636
649
// 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 .
650
+ // applied. This configuration will be applied to all Listeners handling HTTPS
651
+ // traffic that match this port .
639
652
//
640
653
// Support: Extended
641
654
//
642
- // +optional
655
+ // +required
643
656
// <gateway:experimental>
644
- Port * PortNumber `json:"port,omitempty "`
657
+ Port PortNumber `json:"port"`
645
658
//
646
659
// FrontendValidation holds configuration information for validating the frontend (client).
647
660
// Setting this field will result in mutual authentication when connecting to the gateway.
@@ -651,9 +664,9 @@ type TLSConfig struct {
651
664
//
652
665
// Support: Extended
653
666
//
654
- // +optional
667
+ // +required
655
668
// <gateway:experimental>
656
- FrontendValidation * FrontendTLSValidation `json:"frontendValidation,omitempty "`
669
+ FrontendValidation FrontendTLSValidation `json:"frontendValidation"`
657
670
}
658
671
659
672
// FrontendTLSValidation holds configuration information that can be used to validate
@@ -685,7 +698,7 @@ type FrontendTLSValidation struct {
685
698
// +listType=atomic
686
699
// +kubebuilder:validation:MaxItems=8
687
700
// +kubebuilder:validation:MinItems=1
688
- CACertificateRefs []ObjectReference `json:"caCertificateRefs,omitempty "`
701
+ CACertificateRefs []ObjectReference `json:"caCertificateRefs"`
689
702
690
703
// FrontendValidationMode defines the mode for validating the client certificate.
691
704
// There are two possible modes:
0 commit comments