@@ -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.
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
+ // Support: Extended
310
301
//
311
- // Support: Core
312
302
// +optional
313
- //
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
+ // default 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
+ Default TLSConfig `json:"default"`
615
+
616
+ // PerPort 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
+ PerPort []TLSPortConfig `json:"perport,omitempty"`
627
+ }
628
+
615
629
// TLSModeType type defines how a Gateway handles TLS sessions.
616
630
//
617
631
// +kubebuilder:validation:Enum=Terminate;Passthrough
@@ -630,30 +644,40 @@ 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. Currently, it stores only the client
648
+ // certificate validation configuration, but this may be extended in the future .
635
649
type TLSConfig struct {
636
- // 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.
639
- //
640
- // Support: Extended
641
- //
642
- // +optional
643
- // <gateway:experimental>
644
- Port * PortNumber `json:"port,omitempty"`
645
- //
646
650
// FrontendValidation holds configuration information for validating the frontend (client).
647
651
// Setting this field will result in mutual authentication when connecting to the gateway.
648
652
// In browsers this may result in a dialog appearing
649
653
// that requests a user to specify the client certificate.
650
654
// The maximum depth of a certificate chain accepted in verification is Implementation specific.
651
655
//
652
- // Support: Extended
656
+ // Support: Core
653
657
//
654
- // +optional
658
+ // +required
659
+ // <gateway:experimental>
660
+ FrontendValidation FrontendTLSValidation `json:"frontendValidation"`
661
+ }
662
+
663
+ type TLSPortConfig struct {
664
+ // The Port indicates the Port Number to which the TLS configuration will be
665
+ // applied. This configuration will be applied to all Listeners handling HTTPS
666
+ // traffic that match this port.
667
+ //
668
+ // Support: Core
669
+ //
670
+ // +required
671
+ // <gateway:experimental>
672
+ Port PortNumber `json:"port"`
673
+ // TLS store the configuration that will be applied to all Listeners handling
674
+ // HTTPS traffic and matching given port.
675
+ //
676
+ // Support: Core
677
+ //
678
+ // +required
655
679
// <gateway:experimental>
656
- FrontendValidation * FrontendTLSValidation `json:"frontendValidation,omitempty "`
680
+ TLS TLSConfig `json:"tls "`
657
681
}
658
682
659
683
// FrontendTLSValidation holds configuration information that can be used to validate
@@ -685,7 +709,7 @@ type FrontendTLSValidation struct {
685
709
// +listType=atomic
686
710
// +kubebuilder:validation:MaxItems=8
687
711
// +kubebuilder:validation:MinItems=1
688
- CACertificateRefs []ObjectReference `json:"caCertificateRefs,omitempty "`
712
+ CACertificateRefs []ObjectReference `json:"caCertificateRefs"`
689
713
690
714
// FrontendValidationMode defines the mode for validating the client certificate.
691
715
// There are two possible modes:
0 commit comments