2019-06-11 13:12:04 +00:00
|
|
|
package v1alpha1
|
|
|
|
|
|
|
|
import (
|
2023-02-03 14:24:05 +00:00
|
|
|
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
|
|
|
"github.com/traefik/traefik/v3/pkg/types"
|
2019-06-11 13:12:04 +00:00
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
2021-01-15 14:54:04 +00:00
|
|
|
"k8s.io/apimachinery/pkg/util/intstr"
|
2019-06-11 13:12:04 +00:00
|
|
|
)
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// IngressRouteTCPSpec defines the desired state of IngressRouteTCP.
|
2019-06-11 13:12:04 +00:00
|
|
|
type IngressRouteTCPSpec struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// Routes defines the list of routes.
|
|
|
|
Routes []RouteTCP `json:"routes"`
|
|
|
|
// EntryPoints defines the list of entry point names to bind to.
|
|
|
|
// Entry points have to be configured in the static configuration.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/entrypoints/
|
2022-06-24 10:40:08 +00:00
|
|
|
// Default: all.
|
|
|
|
EntryPoints []string `json:"entryPoints,omitempty"`
|
|
|
|
// TLS defines the TLS configuration on a layer 4 / TCP Route.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/routers/#tls_1
|
2022-06-24 10:40:08 +00:00
|
|
|
TLS *TLSTCP `json:"tls,omitempty"`
|
2019-06-11 13:12:04 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// RouteTCP holds the TCP route configuration.
|
2019-06-11 13:12:04 +00:00
|
|
|
type RouteTCP struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// Match defines the router's rule.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/routers/#rule_1
|
2022-06-24 10:40:08 +00:00
|
|
|
Match string `json:"match"`
|
|
|
|
// Priority defines the router's priority.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/routers/#priority_1
|
2022-06-24 10:40:08 +00:00
|
|
|
Priority int `json:"priority,omitempty"`
|
2024-01-23 10:34:05 +00:00
|
|
|
// Syntax defines the router's rule syntax.
|
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/routers/#rulesyntax_1
|
|
|
|
Syntax string `json:"syntax,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// Services defines the list of TCP services.
|
2019-06-11 13:12:04 +00:00
|
|
|
Services []ServiceTCP `json:"services,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// Middlewares defines the list of references to MiddlewareTCP resources.
|
2021-06-11 13:30:05 +00:00
|
|
|
Middlewares []ObjectReference `json:"middlewares,omitempty"`
|
2019-06-11 13:12:04 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// TLSTCP holds the TLS configuration for an IngressRouteTCP.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/routers/#tls_1
|
2019-06-11 13:12:04 +00:00
|
|
|
type TLSTCP struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// SecretName is the name of the referenced Kubernetes Secret to specify the certificate details.
|
|
|
|
SecretName string `json:"secretName,omitempty"`
|
|
|
|
// Passthrough defines whether a TLS router will terminate the TLS connection.
|
|
|
|
Passthrough bool `json:"passthrough,omitempty"`
|
|
|
|
// Options defines the reference to a TLSOption, that specifies the parameters of the TLS connection.
|
|
|
|
// If not defined, the `default` TLSOption is used.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/https/tls/#tls-options
|
2021-06-11 13:30:05 +00:00
|
|
|
Options *ObjectReference `json:"options,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// Store defines the reference to the TLSStore, that will be used to store certificates.
|
|
|
|
// Please note that only `default` TLSStore can be used.
|
|
|
|
Store *ObjectReference `json:"store,omitempty"`
|
|
|
|
// CertResolver defines the name of the certificate resolver to use.
|
|
|
|
// Cert resolvers have to be configured in the static configuration.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/https/acme/#certificate-resolvers
|
2022-06-24 10:40:08 +00:00
|
|
|
CertResolver string `json:"certResolver,omitempty"`
|
|
|
|
// Domains defines the list of domains that will be used to issue certificates.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/routers/#domains
|
2022-06-24 10:40:08 +00:00
|
|
|
Domains []types.Domain `json:"domains,omitempty"`
|
2020-02-24 16:14:06 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// ServiceTCP defines an upstream TCP service to proxy traffic to.
|
2019-06-11 13:12:04 +00:00
|
|
|
type ServiceTCP struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// Name defines the name of the referenced Kubernetes Service.
|
|
|
|
Name string `json:"name"`
|
|
|
|
// Namespace defines the namespace of the referenced Kubernetes Service.
|
|
|
|
Namespace string `json:"namespace,omitempty"`
|
|
|
|
// Port defines the port of a Kubernetes Service.
|
|
|
|
// This can be a reference to a named port.
|
|
|
|
Port intstr.IntOrString `json:"port"`
|
|
|
|
// Weight defines the weight used when balancing requests between multiple Kubernetes Service.
|
|
|
|
Weight *int `json:"weight,omitempty"`
|
2024-01-29 16:32:05 +00:00
|
|
|
// TerminationDelay defines the deadline that the proxy sets, after one of its connected peers indicates
|
|
|
|
// it has closed the writing capability of its connection, to close the reading capability as well,
|
|
|
|
// hence fully terminating the connection.
|
|
|
|
// It is a duration in milliseconds, defaulting to 100.
|
|
|
|
// A negative value means an infinite deadline (i.e. the reading capability is never closed).
|
|
|
|
// Deprecated: TerminationDelay is not supported APIVersion traefik.io/v1, please use ServersTransport to configure the TerminationDelay instead.
|
|
|
|
TerminationDelay *int `json:"terminationDelay,omitempty"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// ProxyProtocol defines the PROXY protocol configuration.
|
2022-12-05 15:58:04 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v3.0/routing/services/#proxy-protocol
|
2022-06-24 10:40:08 +00:00
|
|
|
ProxyProtocol *dynamic.ProxyProtocol `json:"proxyProtocol,omitempty"`
|
2022-12-09 08:58:05 +00:00
|
|
|
// ServersTransport defines the name of ServersTransportTCP resource to use.
|
|
|
|
// It allows to configure the transport between Traefik and your servers.
|
|
|
|
// Can only be used on a Kubernetes Service.
|
|
|
|
ServersTransport string `json:"serversTransport,omitempty"`
|
|
|
|
// TLS determines whether to use TLS when dialing with the backend.
|
|
|
|
TLS bool `json:"tls,omitempty"`
|
2023-03-20 15:46:05 +00:00
|
|
|
// NativeLB controls, when creating the load-balancer,
|
|
|
|
// whether the LB's children are directly the pods IPs or if the only child is the Kubernetes Service clusterIP.
|
|
|
|
// The Kubernetes Service itself does load-balance to the pods.
|
|
|
|
// By default, NativeLB is false.
|
2024-04-29 10:20:04 +00:00
|
|
|
NativeLB *bool `json:"nativeLB,omitempty"`
|
2019-06-11 13:12:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// +genclient
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
2021-03-03 14:32:04 +00:00
|
|
|
// +kubebuilder:storageversion
|
2019-06-11 13:12:04 +00:00
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// IngressRouteTCP is the CRD implementation of a Traefik TCP Router.
|
2019-06-11 13:12:04 +00:00
|
|
|
type IngressRouteTCP 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
|
2019-06-11 13:12:04 +00:00
|
|
|
metav1.ObjectMeta `json:"metadata"`
|
|
|
|
|
|
|
|
Spec IngressRouteTCPSpec `json:"spec"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// IngressRouteTCPList is a collection of IngressRouteTCP.
|
2019-06-11 13:12:04 +00:00
|
|
|
type IngressRouteTCPList 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
|
2019-06-11 13:12:04 +00:00
|
|
|
metav1.ListMeta `json:"metadata"`
|
2022-06-24 10:40:08 +00:00
|
|
|
|
|
|
|
// Items is the list of IngressRouteTCP.
|
|
|
|
Items []IngressRouteTCP `json:"items"`
|
2019-06-11 13:12:04 +00:00
|
|
|
}
|