2020-02-26 11:28:05 +00:00
|
|
|
package v1alpha1
|
|
|
|
|
|
|
|
import (
|
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
2021-01-15 14:54:04 +00:00
|
|
|
"k8s.io/apimachinery/pkg/util/intstr"
|
2020-02-26 11:28:05 +00:00
|
|
|
)
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// IngressRouteUDPSpec defines the desired state of a IngressRouteUDP.
|
2020-02-26 11:28:05 +00:00
|
|
|
type IngressRouteUDPSpec struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// Routes defines the list of routes.
|
|
|
|
Routes []RouteUDP `json:"routes"`
|
|
|
|
// EntryPoints defines the list of entry point names to bind to.
|
|
|
|
// Entry points have to be configured in the static configuration.
|
2023-03-22 10:06:05 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.10/routing/entrypoints/
|
2022-06-24 10:40:08 +00:00
|
|
|
// Default: all.
|
|
|
|
EntryPoints []string `json:"entryPoints,omitempty"`
|
2020-02-26 11:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// RouteUDP holds the UDP route configuration.
|
2020-02-26 11:28:05 +00:00
|
|
|
type RouteUDP struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// Services defines the list of UDP services.
|
2020-02-26 11:28:05 +00:00
|
|
|
Services []ServiceUDP `json:"services,omitempty"`
|
|
|
|
}
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// ServiceUDP defines an upstream UDP service to proxy traffic to.
|
2020-02-26 11:28:05 +00:00
|
|
|
type ServiceUDP 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"`
|
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"`
|
2020-02-26 11:28:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// +genclient
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
2021-03-03 14:32:04 +00:00
|
|
|
// +kubebuilder:storageversion
|
2020-02-26 11:28:05 +00:00
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// IngressRouteUDP is a CRD implementation of a Traefik UDP Router.
|
2020-02-26 11:28:05 +00:00
|
|
|
type IngressRouteUDP 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-02-26 11:28:05 +00:00
|
|
|
metav1.ObjectMeta `json:"metadata"`
|
|
|
|
|
|
|
|
Spec IngressRouteUDPSpec `json:"spec"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// IngressRouteUDPList is a collection of IngressRouteUDP.
|
2020-02-26 11:28:05 +00:00
|
|
|
type IngressRouteUDPList 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-02-26 11:28:05 +00:00
|
|
|
metav1.ListMeta `json:"metadata"`
|
2022-06-24 10:40:08 +00:00
|
|
|
|
|
|
|
// Items is the list of IngressRouteUDP.
|
|
|
|
Items []IngressRouteUDP `json:"items"`
|
2020-02-26 11:28:05 +00:00
|
|
|
}
|