1package v1alpha1
2
3import (
4	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5	"k8s.io/apimachinery/pkg/util/intstr"
6)
7
8// +genclient
9// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
10// +kubebuilder:storageversion
11
12// ServersTransport is a specification for a ServersTransport resource.
13type ServersTransport struct {
14	metav1.TypeMeta   `json:",inline"`
15	metav1.ObjectMeta `json:"metadata"`
16
17	Spec ServersTransportSpec `json:"spec"`
18}
19
20// +k8s:deepcopy-gen=true
21
22// ServersTransportSpec options to configure communication between Traefik and the servers.
23type ServersTransportSpec struct {
24	// ServerName used to contact the server.
25	ServerName string `json:"serverName,omitempty"`
26	// Disable SSL certificate verification.
27	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
28	// Add cert file for self-signed certificate.
29	RootCAsSecrets []string `json:"rootCAsSecrets,omitempty"`
30	// Certificates for mTLS.
31	CertificatesSecrets []string `json:"certificatesSecrets,omitempty"`
32	// If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used.
33	MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost,omitempty"`
34	// Timeouts for requests forwarded to the backend servers.
35	ForwardingTimeouts *ForwardingTimeouts `json:"forwardingTimeouts,omitempty"`
36	// Disable HTTP/2 for connections with backend servers.
37	DisableHTTP2 bool `json:"disableHTTP2,omitempty"`
38	// URI used to match against SAN URI during the peer certificate verification.
39	PeerCertURI string `json:"peerCertURI,omitempty"`
40}
41
42// +k8s:deepcopy-gen=true
43
44// ForwardingTimeouts contains timeout configurations for forwarding requests to the backend servers.
45type ForwardingTimeouts struct {
46	// DialTimeout is the amount of time to wait until a connection to a backend server can be established. If zero, no timeout exists.
47	DialTimeout *intstr.IntOrString `json:"dialTimeout,omitempty"`
48	// ResponseHeaderTimeout is the amount of time to wait for a server's response headers after fully writing the request (including its body, if any).
49	// If zero, no timeout exists.
50	ResponseHeaderTimeout *intstr.IntOrString `json:"responseHeaderTimeout,omitempty"`
51	// IdleConnTimeout is the maximum period for which an idle HTTP keep-alive connection will remain open before closing itself.
52	IdleConnTimeout *intstr.IntOrString `json:"idleConnTimeout,omitempty"`
53	// ReadIdleTimeout is the timeout after which a health check using ping frame will be carried out if no frame is received on the HTTP/2 connection. If zero, no health check is performed.
54	ReadIdleTimeout *intstr.IntOrString `json:"readIdleTimeout,omitempty"`
55	// PingTimeout is the timeout after which the HTTP/2 connection will be closed if a response to ping is not received.
56	PingTimeout *intstr.IntOrString `json:"pingTimeout,omitempty"`
57}
58
59// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
60
61// ServersTransportList is a list of ServersTransport resources.
62type ServersTransportList struct {
63	metav1.TypeMeta `json:",inline"`
64	metav1.ListMeta `json:"metadata"`
65
66	Items []ServersTransport `json:"items"`
67}
68