k8s_traefik_api/
ingressrouteudps.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium ingressrouteudps.traefik.io -A -b --derive=Default --derive=PartialEq --smart-derive-elision
3// kopium version: 0.21.2
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube::CustomResource;
8    pub use typed_builder::TypedBuilder;
9    pub use schemars::JsonSchema;
10    pub use serde::{Serialize, Deserialize};
11    pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
12}
13use self::prelude::*;
14
15/// IngressRouteUDPSpec defines the desired state of a IngressRouteUDP.
16#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
17#[kube(group = "traefik.io", version = "v1alpha1", kind = "IngressRouteUDP", plural = "ingressrouteudps")]
18#[kube(namespaced)]
19#[kube(derive="Default")]
20#[kube(derive="PartialEq")]
21pub struct IngressRouteUDPSpec {
22    /// EntryPoints defines the list of entry point names to bind to.
23    /// Entry points have to be configured in the static configuration.
24    /// More info: https://doc.traefik.io/traefik/v3.3/routing/entrypoints/
25    /// Default: all.
26    #[serde(default, skip_serializing_if = "Option::is_none", rename = "entryPoints")]
27    #[builder(default, setter(strip_option))]
28    pub entry_points: Option<Vec<String>>,
29    /// Routes defines the list of routes.
30    #[builder(default)]
31    pub routes: Vec<IngressRouteUDPRoutes>,
32}
33
34/// RouteUDP holds the UDP route configuration.
35#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
36pub struct IngressRouteUDPRoutes {
37    /// Services defines the list of UDP services.
38    #[serde(default, skip_serializing_if = "Option::is_none")]
39    #[builder(default, setter(strip_option))]
40    pub services: Option<Vec<IngressRouteUDPRoutesServices>>,
41}
42
43/// ServiceUDP defines an upstream UDP service to proxy traffic to.
44#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
45pub struct IngressRouteUDPRoutesServices {
46    /// Name defines the name of the referenced Kubernetes Service.
47    pub name: String,
48    /// Namespace defines the namespace of the referenced Kubernetes Service.
49    #[serde(default, skip_serializing_if = "Option::is_none")]
50    #[builder(default, setter(strip_option))]
51    pub namespace: Option<String>,
52    /// NativeLB controls, when creating the load-balancer,
53    /// whether the LB's children are directly the pods IPs or if the only child is the Kubernetes Service clusterIP.
54    /// The Kubernetes Service itself does load-balance to the pods.
55    /// By default, NativeLB is false.
56    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nativeLB")]
57    #[builder(default, setter(strip_option))]
58    pub native_lb: Option<bool>,
59    /// NodePortLB controls, when creating the load-balancer,
60    /// whether the LB's children are directly the nodes internal IPs using the nodePort when the service type is NodePort.
61    /// It allows services to be reachable when Traefik runs externally from the Kubernetes cluster but within the same network of the nodes.
62    /// By default, NodePortLB is false.
63    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodePortLB")]
64    #[builder(default, setter(strip_option))]
65    pub node_port_lb: Option<bool>,
66    /// Port defines the port of a Kubernetes Service.
67    /// This can be a reference to a named port.
68    pub port: IntOrString,
69    /// Weight defines the weight used when balancing requests between multiple Kubernetes Service.
70    #[serde(default, skip_serializing_if = "Option::is_none")]
71    #[builder(default, setter(strip_option))]
72    pub weight: Option<i64>,
73}
74