2019-06-11 13:12:04 +00:00
|
|
|
package v1alpha1
|
|
|
|
|
|
|
|
import (
|
2020-11-17 12:04:04 +00:00
|
|
|
"github.com/traefik/traefik/v2/pkg/config/dynamic"
|
2020-09-16 13:46:04 +00:00
|
|
|
"github.com/traefik/traefik/v2/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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/routing/routers/#rule_1
|
2022-06-24 10:40:08 +00:00
|
|
|
Match string `json:"match"`
|
|
|
|
// Priority defines the router's priority.
|
2022-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/routing/routers/#priority_1
|
2022-06-24 10:40:08 +00:00
|
|
|
Priority int `json:"priority,omitempty"`
|
|
|
|
// 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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/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-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/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"`
|
|
|
|
// 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).
|
|
|
|
TerminationDelay *int `json:"terminationDelay,omitempty"`
|
|
|
|
// ProxyProtocol defines the PROXY protocol configuration.
|
2022-09-14 14:52:03 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.9/routing/services/#proxy-protocol
|
2022-06-24 10:40:08 +00:00
|
|
|
ProxyProtocol *dynamic.ProxyProtocol `json:"proxyProtocol,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.
|
|
|
|
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
|
|
|
}
|