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
|
|
|
)
|
|
|
|
|
|
|
|
// IngressRouteTCPSpec is a specification for a IngressRouteTCPSpec resource.
|
|
|
|
type IngressRouteTCPSpec struct {
|
|
|
|
Routes []RouteTCP `json:"routes"`
|
2021-03-03 14:32:04 +00:00
|
|
|
EntryPoints []string `json:"entryPoints,omitempty"`
|
2019-06-11 13:12:04 +00:00
|
|
|
TLS *TLSTCP `json:"tls,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RouteTCP contains the set of routes.
|
|
|
|
type RouteTCP struct {
|
|
|
|
Match string `json:"match"`
|
|
|
|
Services []ServiceTCP `json:"services,omitempty"`
|
|
|
|
}
|
|
|
|
|
2019-11-14 18:28:04 +00:00
|
|
|
// TLSTCP contains the TLS certificates configuration of the routes.
|
|
|
|
// To enable Let's Encrypt, use an empty TLS struct,
|
|
|
|
// e.g. in YAML:
|
2019-06-11 13:12:04 +00:00
|
|
|
//
|
2019-11-14 18:28:04 +00:00
|
|
|
// tls: {} # inline format
|
2019-06-11 13:12:04 +00:00
|
|
|
//
|
2019-11-14 18:28:04 +00:00
|
|
|
// tls:
|
|
|
|
// secretName: # block format
|
2019-06-11 13:12:04 +00:00
|
|
|
type TLSTCP struct {
|
|
|
|
// SecretName is the name of the referenced Kubernetes Secret to specify the
|
|
|
|
// certificate details.
|
2021-03-03 14:32:04 +00:00
|
|
|
SecretName string `json:"secretName,omitempty"`
|
|
|
|
Passthrough bool `json:"passthrough,omitempty"`
|
2019-06-21 15:18:05 +00:00
|
|
|
// Options is a reference to a TLSOption, that specifies the parameters of the TLS connection.
|
2021-03-03 14:32:04 +00:00
|
|
|
Options *TLSOptionTCPRef `json:"options,omitempty"`
|
2020-02-24 16:14:06 +00:00
|
|
|
// Store is a reference to a TLSStore, that specifies the parameters of the TLS store.
|
2021-03-03 14:32:04 +00:00
|
|
|
Store *TLSStoreTCPRef `json:"store,omitempty"`
|
|
|
|
CertResolver string `json:"certResolver,omitempty"`
|
2020-02-24 16:14:06 +00:00
|
|
|
Domains []types.Domain `json:"domains,omitempty"`
|
2019-06-21 15:18:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TLSOptionTCPRef is a ref to the TLSOption resources.
|
|
|
|
type TLSOptionTCPRef struct {
|
|
|
|
Name string `json:"name"`
|
2021-03-03 14:32:04 +00:00
|
|
|
Namespace string `json:"namespace,omitempty"`
|
2019-06-11 13:12:04 +00:00
|
|
|
}
|
|
|
|
|
2020-02-24 16:14:06 +00:00
|
|
|
// TLSStoreTCPRef is a ref to the TLSStore resources.
|
|
|
|
type TLSStoreTCPRef struct {
|
|
|
|
Name string `json:"name"`
|
2021-03-03 14:32:04 +00:00
|
|
|
Namespace string `json:"namespace,omitempty"`
|
2020-02-24 16:14:06 +00:00
|
|
|
}
|
|
|
|
|
2019-06-11 13:12:04 +00:00
|
|
|
// ServiceTCP defines an upstream to proxy traffic.
|
|
|
|
type ServiceTCP struct {
|
2020-11-17 12:04:04 +00:00
|
|
|
Name string `json:"name"`
|
2021-03-03 14:32:04 +00:00
|
|
|
Namespace string `json:"namespace,omitempty"`
|
2021-01-15 14:54:04 +00:00
|
|
|
Port intstr.IntOrString `json:"port"`
|
2020-11-17 12:04:04 +00:00
|
|
|
Weight *int `json:"weight,omitempty"`
|
|
|
|
TerminationDelay *int `json:"terminationDelay,omitempty"`
|
|
|
|
ProxyProtocol *dynamic.ProxyProtocol `json:"proxyProtocol,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
|
|
|
|
|
|
|
// IngressRouteTCP is an Ingress CRD specification.
|
|
|
|
type IngressRouteTCP struct {
|
|
|
|
metav1.TypeMeta `json:",inline"`
|
|
|
|
metav1.ObjectMeta `json:"metadata"`
|
|
|
|
|
|
|
|
Spec IngressRouteTCPSpec `json:"spec"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
|
|
|
|
|
|
// IngressRouteTCPList is a list of IngressRoutes.
|
|
|
|
type IngressRouteTCPList struct {
|
|
|
|
metav1.TypeMeta `json:",inline"`
|
|
|
|
metav1.ListMeta `json:"metadata"`
|
|
|
|
Items []IngressRouteTCP `json:"items"`
|
|
|
|
}
|