2020-09-11 13:40:03 +00:00
|
|
|
package v1alpha1
|
|
|
|
|
|
|
|
import (
|
2023-02-03 14:24:05 +00:00
|
|
|
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
2020-09-11 13:40:03 +00:00
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
"k8s.io/apimachinery/pkg/util/intstr"
|
|
|
|
)
|
|
|
|
|
|
|
|
// +genclient
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
2021-03-03 14:32:04 +00:00
|
|
|
// +kubebuilder:storageversion
|
2020-09-11 13:40:03 +00:00
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// ServersTransport is the CRD implementation of a ServersTransport.
|
|
|
|
// If no serversTransport is specified, the default@internal will be used.
|
|
|
|
// The default@internal serversTransport is created from the static configuration.
|
2024-06-27 14:28:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.1/routing/services/#serverstransport_1
|
2020-09-11 13:40:03 +00:00
|
|
|
type ServersTransport struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
metav1.TypeMeta `json:",inline"`
|
|
|
|
// Standard object's metadata.
|
|
|
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
2020-09-11 13:40:03 +00:00
|
|
|
metav1.ObjectMeta `json:"metadata"`
|
|
|
|
|
|
|
|
Spec ServersTransportSpec `json:"spec"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen=true
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// ServersTransportSpec defines the desired state of a ServersTransport.
|
2020-09-11 13:40:03 +00:00
|
|
|
type ServersTransportSpec struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// ServerName defines the server name used to contact the server.
|
2021-03-03 14:32:04 +00:00
|
|
|
ServerName string `json:"serverName,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// InsecureSkipVerify disables SSL certificate verification.
|
2021-03-03 14:32:04 +00:00
|
|
|
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// RootCAsSecrets defines a list of CA secret used to validate self-signed certificate.
|
2021-03-03 14:32:04 +00:00
|
|
|
RootCAsSecrets []string `json:"rootCAsSecrets,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// CertificatesSecrets defines a list of secret storing client certificates for mTLS.
|
2021-03-03 14:32:04 +00:00
|
|
|
CertificatesSecrets []string `json:"certificatesSecrets,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// MaxIdleConnsPerHost controls the maximum idle (keep-alive) to keep per-host.
|
2021-03-03 14:32:04 +00:00
|
|
|
MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// ForwardingTimeouts defines the timeouts for requests forwarded to the backend servers.
|
2021-03-03 14:32:04 +00:00
|
|
|
ForwardingTimeouts *ForwardingTimeouts `json:"forwardingTimeouts,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// DisableHTTP2 disables HTTP/2 for connections with backend servers.
|
2021-03-29 12:32:03 +00:00
|
|
|
DisableHTTP2 bool `json:"disableHTTP2,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// PeerCertURI defines the peer cert URI used to match against SAN URI during the peer certificate verification.
|
2021-07-15 12:02:11 +00:00
|
|
|
PeerCertURI string `json:"peerCertURI,omitempty"`
|
2022-10-14 15:16:08 +00:00
|
|
|
// Spiffe defines the SPIFFE configuration.
|
|
|
|
Spiffe *dynamic.Spiffe `json:"spiffe,omitempty"`
|
2020-09-11 13:40:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen=true
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// ForwardingTimeouts holds the timeout configurations for forwarding requests to the backend servers.
|
2020-09-11 13:40:03 +00:00
|
|
|
type ForwardingTimeouts struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// DialTimeout is the amount of time to wait until a connection to a backend server can be established.
|
2021-03-03 14:32:04 +00:00
|
|
|
DialTimeout *intstr.IntOrString `json:"dialTimeout,omitempty"`
|
2021-11-09 11:16:08 +00:00
|
|
|
// ResponseHeaderTimeout is the amount of time to wait for a server's response headers after fully writing the request (including its body, if any).
|
2021-03-03 14:32:04 +00:00
|
|
|
ResponseHeaderTimeout *intstr.IntOrString `json:"responseHeaderTimeout,omitempty"`
|
2021-11-09 11:16:08 +00:00
|
|
|
// IdleConnTimeout is the maximum period for which an idle HTTP keep-alive connection will remain open before closing itself.
|
2021-03-03 14:32:04 +00:00
|
|
|
IdleConnTimeout *intstr.IntOrString `json:"idleConnTimeout,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// 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.
|
2021-11-09 11:16:08 +00:00
|
|
|
ReadIdleTimeout *intstr.IntOrString `json:"readIdleTimeout,omitempty"`
|
|
|
|
// PingTimeout is the timeout after which the HTTP/2 connection will be closed if a response to ping is not received.
|
|
|
|
PingTimeout *intstr.IntOrString `json:"pingTimeout,omitempty"`
|
2020-09-11 13:40:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// ServersTransportList is a collection of ServersTransport resources.
|
2020-09-11 13:40:03 +00:00
|
|
|
type ServersTransportList struct {
|
|
|
|
metav1.TypeMeta `json:",inline"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// Standard object's metadata.
|
|
|
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
2020-09-11 13:40:03 +00:00
|
|
|
metav1.ListMeta `json:"metadata"`
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// Items is the list of ServersTransport.
|
2020-09-11 13:40:03 +00:00
|
|
|
Items []ServersTransport `json:"items"`
|
|
|
|
}
|