Server-Side-Implementation

This commit is contained in:
2025-12-29 16:42:49 +01:00
commit c9d0322177
20 changed files with 1539 additions and 0 deletions

View File

@ -0,0 +1,78 @@
package v1alpha1
//go:generate controller-gen object paths=$GOFILE
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type TLS struct {
SecretName string `json:"secretName"`
}
type ResponseForwarding struct {
FlushInterval string `json:"flushInterval"`
}
type Cookie struct {
HttpOnly bool `json:"httpOnly"`
Name string `json:"name"`
Secure bool `json:"secure"`
}
type Sticky struct {
Cookie Cookie `json:"cookie"`
}
type Service struct {
Kind string `json:"kind"`
Name string `json:"name"`
Namespace string `json:"namespace"`
PassHostHeader bool `json:"passHostHeader"`
Port int `json:"port"`
ResponseForwarding ResponseForwarding `json:"responseForwarding"`
Scheme string `json:"scheme"`
Sticky Sticky `json:"sticky"`
Strategy string `json:"strategy"`
Weight int `json:"weight"`
}
type Observability struct {
AccessLogs bool `json:"accessLogs"`
Metrics bool `json:"metrics"`
Tracing bool `json:"tracing"`
}
type Middleware struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
}
type Route struct {
Kind string `json:"kind"`
Match string `json:"match"`
Middlewares []Middleware `json:"middlewares"`
Observability Observability `json:"observability"`
Priority int `json:"priority"`
Services []Service `json:"services"`
}
type IngressRouteSpec struct {
EntryPoints []string `json:"entryPoints"`
Routes []Route `json:"routes"`
TLS TLS `json:"tls"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IngressRoute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IngressRouteSpec `json:"spec"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IngressRouteList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []IngressRoute `json:"items"`
}

View File

@ -0,0 +1,27 @@
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const GroupName = "traefik.io"
const GroupVersion = "v1alpha1"
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&IngressRoute{},
&IngressRouteList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@ -0,0 +1,67 @@
//go:build !ignore_autogenerated
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IngressRoute) DeepCopyInto(out *IngressRoute) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRoute.
func (in *IngressRoute) DeepCopy() *IngressRoute {
if in == nil {
return nil
}
out := new(IngressRoute)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *IngressRoute) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IngressRouteList) DeepCopyInto(out *IngressRouteList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]IngressRoute, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteList.
func (in *IngressRouteList) DeepCopy() *IngressRouteList {
if in == nil {
return nil
}
out := new(IngressRouteList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *IngressRouteList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}