1
0
Fork 0

Merge branch v3.5 into master

This commit is contained in:
romain 2025-09-09 17:47:13 +02:00
commit c09d3fb03c
243 changed files with 6720 additions and 4386 deletions

View file

@ -490,6 +490,10 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client)
}
}
if serversTransportTCP.Spec.ProxyProtocol != nil {
tcpServerTransport.ProxyProtocol = serversTransportTCP.Spec.ProxyProtocol
}
if serversTransportTCP.Spec.TLS != nil {
if len(serversTransportTCP.Spec.TLS.RootCAsSecrets) > 0 {
logger.Warn().Msg("RootCAsSecrets option is deprecated, please use the RootCA option instead.")

View file

@ -86,6 +86,7 @@ type ServiceTCP struct {
TerminationDelay *int `json:"terminationDelay,omitempty"`
// ProxyProtocol defines the PROXY protocol configuration.
// More info: https://doc.traefik.io/traefik/v3.5/routing/services/#proxy-protocol
// Deprecated: ProxyProtocol will not be supported in future APIVersions, please use ServersTransport to configure ProxyProtocol instead.
ProxyProtocol *dynamic.ProxyProtocol `json:"proxyProtocol,omitempty"`
// ServersTransport defines the name of ServersTransportTCP resource to use.
// It allows to configure the transport between Traefik and your servers.

View file

@ -35,12 +35,14 @@ type ServersTransportTCPSpec struct {
// +kubebuilder:validation:Pattern="^([0-9]+(ns|us|µs|ms|s|m|h)?)+$"
// +kubebuilder:validation:XIntOrString
DialKeepAlive *intstr.IntOrString `json:"dialKeepAlive,omitempty"`
// ProxyProtocol holds the PROXY Protocol configuration.
ProxyProtocol *dynamic.ProxyProtocol `json:"proxyProtocol,omitempty"`
// TerminationDelay defines the delay to wait before fully terminating the connection, after one connected peer has closed its writing capability.
// +kubebuilder:validation:Pattern="^([0-9]+(ns|us|µs|ms|s|m|h)?)+$"
// +kubebuilder:validation:XIntOrString
TerminationDelay *intstr.IntOrString `json:"terminationDelay,omitempty"`
// TLS defines the TLS configuration
TLS *TLSClientConfig `description:"Defines the TLS configuration." json:"tls,omitempty"`
TLS *TLSClientConfig `json:"tls,omitempty"`
}
// TLSClientConfig defines the desired state of a TLSClientConfig.

View file

@ -1522,6 +1522,11 @@ func (in *ServersTransportTCPSpec) DeepCopyInto(out *ServersTransportTCPSpec) {
*out = new(intstr.IntOrString)
**out = **in
}
if in.ProxyProtocol != nil {
in, out := &in.ProxyProtocol, &out.ProxyProtocol
*out = new(dynamic.ProxyProtocol)
**out = **in
}
if in.TerminationDelay != nil {
in, out := &in.TerminationDelay, &out.TerminationDelay
*out = new(intstr.IntOrString)

View file

@ -59,3 +59,13 @@ spec:
weight: 1
kind: Service
group: ""
- name: whoami-HTTP
port: 80
weight: 1
kind: Service
group: ""
- name: whoami-HTTPS
port: 443
weight: 1
kind: Service
group: ""

View file

@ -430,6 +430,80 @@ spec:
name: wss
appProtocol: kubernetes.io/wss
---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
name: whoami-HTTPS-abc
namespace: default
labels:
kubernetes.io/service-name: whoami-HTTPS
addressType: IPv4
ports:
- name: websecure
port: 8443
endpoints:
- addresses:
- 10.10.0.16
conditions:
ready: true
---
apiVersion: v1
kind: Service
metadata:
name: whoami-HTTPS
namespace: default
spec:
ports:
- name: websecure
protocol: TCP
appProtocol: HTTPS
port: 443
targetPort: websecure
selector:
app: containous
task: whoami-HTTPS
---
kind: EndpointSlice
apiVersion: discovery.k8s.io/v1
metadata:
name: whoami-HTTP-abc
namespace: default
labels:
kubernetes.io/service-name: whoami-HTTP
addressType: IPv4
ports:
- name: web
port: 8080
endpoints:
- addresses:
- 10.10.0.17
conditions:
ready: true
---
apiVersion: v1
kind: Service
metadata:
name: whoami-HTTP
namespace: default
spec:
ports:
- name: web
protocol: TCP
port: 80
appProtocol: HTTP
targetPort: web
selector:
app: containous
task: whoami-HTTP
---
apiVersion: v1
kind: Service

View file

@ -430,7 +430,7 @@ func getGRPCServiceProtocol(portSpec corev1.ServicePort) (string, error) {
return schemeH2C, nil
}
switch ap := *portSpec.AppProtocol; ap {
switch ap := strings.ToLower(*portSpec.AppProtocol); ap {
case appProtocolH2C:
return schemeH2C, nil
case appProtocolHTTPS:

View file

@ -817,7 +817,7 @@ func getHTTPServiceProtocol(portSpec corev1.ServicePort) (string, error) {
return protocol, nil
}
switch ap := *portSpec.AppProtocol; ap {
switch ap := strings.ToLower(*portSpec.AppProtocol); ap {
case appProtocolH2C:
return schemeH2C, nil
case appProtocolHTTP, appProtocolWS:

View file

@ -2959,6 +2959,14 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) {
Name: "default-whoami-wss-http-80",
Weight: ptr.To(1),
},
{
Name: "default-whoami-HTTP-http-80",
Weight: ptr.To(1),
},
{
Name: "default-whoami-HTTPS-http-443",
Weight: ptr.To(1),
},
},
},
},
@ -3004,6 +3012,34 @@ func TestLoadHTTPRoutes_backendExtensionRef(t *testing.T) {
},
},
},
"default-whoami-HTTPS-http-443": {
LoadBalancer: &dynamic.ServersLoadBalancer{
Strategy: dynamic.BalancerStrategyWRR,
Servers: []dynamic.Server{
{
URL: "https://10.10.0.16:8443",
},
},
PassHostHeader: ptr.To(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"default-whoami-HTTP-http-80": {
LoadBalancer: &dynamic.ServersLoadBalancer{
Strategy: dynamic.BalancerStrategyWRR,
Servers: []dynamic.Server{
{
URL: "http://10.10.0.17:8080",
},
},
PassHostHeader: ptr.To(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
ServersTransports: map[string]*dynamic.ServersTransport{},
},