Help us shape the future of Go! Take the 2026 Go Developer Survey

v1

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the lb v1 API group +kubebuilder:object:generate=true +groupName=lb.lbconfig.carlosedp.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "lb.lbconfig.carlosedp.com", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &runtime.SchemeBuilder{}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type DrainConfig added in v0.7.0

type DrainConfig struct {
	// Enabled determines if graceful draining is enabled.
	// When enabled, pool members are disabled before deletion to allow existing connections to complete.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// TimeoutSeconds is the duration in seconds to wait for connections to drain before deleting the pool member.
	// This allows time for active connections to complete gracefully. To remove members immediately, keep draining disabled.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=3600
	// +kubebuilder:default=30
	TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
}

DrainConfig configures graceful connection draining for pool members.

func (*DrainConfig) DeepCopy added in v0.7.0

func (in *DrainConfig) DeepCopy() *DrainConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DrainConfig.

func (*DrainConfig) DeepCopyInto added in v0.7.0

func (in *DrainConfig) DeepCopyInto(out *DrainConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DrainingMember added in v0.7.0

type DrainingMember struct {
	// PoolName is the name of the pool this member belongs to
	PoolName string `json:"poolName"`
	// Node is the node information for this member
	Node Node `json:"node"`
	// Port is the port for this pool member
	Port int `json:"port"`
	// StartTime is when the drain process started
	StartTime metav1.Time `json:"startTime"`
}

DrainingMember represents a pool member that is currently in the draining state. This tracks members that have been disabled and are waiting for connections to complete.

func (*DrainingMember) DeepCopy added in v0.7.0

func (in *DrainingMember) DeepCopy() *DrainingMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DrainingMember.

func (*DrainingMember) DeepCopyInto added in v0.7.0

func (in *DrainingMember) DeepCopyInto(out *DrainingMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalLoadBalancer

type ExternalLoadBalancer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ExternalLoadBalancerSpec   `json:"spec,omitempty"`
	Status ExternalLoadBalancerStatus `json:"status,omitempty"`
}

ExternalLoadBalancer is the Schema for the externalloadbalancers API +kubebuilder:object:root=true +kubebuilder:subresource:status +operator-sdk:csv:customresourcedefinitions:displayName="ExternalLoadBalancer Instance",resources={{ExternalLoadBalancer,lb.lbconfig.carlosedp.com/v1,externalloadbalancer},} +kubebuilder:resource:path="externalloadbalancers" +kubebuilder:resource:singular="externalloadbalancer" +kubebuilder:resource:shortName="elb" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:printcolumn:name="VIP",type="string",JSONPath=".spec.vip",description="Load Balancer VIP" +kubebuilder:printcolumn:name="Ports",type="string",JSONPath=".spec.ports",description="Load Balancer Ports" +kubebuilder:printcolumn:name="Provider",type="string",JSONPath=".spec.provider.vendor",description="Load Balancer Provider Backend" +kubebuilder:printcolumn:name="Nodes",type="string",JSONPath=".status.numnodes",description="Amount of nodes in the load balancer" +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type",description="Type of nodes in this Load Balancer" +kubebuilder:printcolumn:name="Matching Node Labels",type="string",JSONPath=".status.labels",description="Node Labels matching this Load Balancer"

func (*ExternalLoadBalancer) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLoadBalancer.

func (*ExternalLoadBalancer) DeepCopyInto

func (in *ExternalLoadBalancer) DeepCopyInto(out *ExternalLoadBalancer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExternalLoadBalancer) DeepCopyObject

func (in *ExternalLoadBalancer) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ExternalLoadBalancerList

type ExternalLoadBalancerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ExternalLoadBalancer `json:"items"`
}

ExternalLoadBalancerList contains a list of ExternalLoadBalancer

func (*ExternalLoadBalancerList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLoadBalancerList.

func (*ExternalLoadBalancerList) DeepCopyInto

func (in *ExternalLoadBalancerList) DeepCopyInto(out *ExternalLoadBalancerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExternalLoadBalancerList) DeepCopyObject

func (in *ExternalLoadBalancerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ExternalLoadBalancerSpec

type ExternalLoadBalancerSpec struct {
	// Vip is the Virtual IP configured in  this LoadBalancer instance
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=15
	Vip string `json:"vip"`

	// Type is the node role type (master or infra) for the LoadBalancer instance
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum=master;infra
	Type string `json:"type,omitempty"`

	// NodeLabels are the node labels used for router sharding as an alternative to "type". Optional.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	NodeLabels map[string]string `json:"nodelabels,omitempty"`

	// Ports is the ports exposed by this LoadBalancer instance
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=128
	Ports []int `json:"ports"`

	// Monitor is the path and port to monitor the LoadBalancer members
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	Monitor Monitor `json:"monitor"`

	// CreateVIP controls whether the operator creates a virtual server for each port. Defaults to true.
	// Set to false to manage only the pools and their members and create the virtual servers outside the operator.
	// Virtual servers the operator created earlier are deleted when this is set to false.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=true
	CreateVIP *bool `json:"createvip,omitempty"`

	// CreateMonitor controls whether the operator creates the monitor used by the pools. Defaults to true.
	// Set to false to use an existing monitor in the Load Balancer, named in monitor.name.
	// A monitor the operator created earlier is deleted when this is set to false. (F5 BigIP and Citrix ADC only)
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=true
	CreateMonitor *bool `json:"createmonitor,omitempty"`

	// Provider is the LoadBalancer backend provider
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	Provider Provider `json:"provider"`

	// Drain configures graceful connection draining for pool members.
	// When enabled, pool members are disabled before deletion to allow existing connections to complete.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	Drain *DrainConfig `json:"drain,omitempty"`
}

ExternalLoadBalancerSpec is the spec of a LoadBalancer instance.

func (*ExternalLoadBalancerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLoadBalancerSpec.

func (*ExternalLoadBalancerSpec) DeepCopyInto

func (in *ExternalLoadBalancerSpec) DeepCopyInto(out *ExternalLoadBalancerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExternalLoadBalancerSpec) ShouldCreateMonitor added in v0.7.0

func (s *ExternalLoadBalancerSpec) ShouldCreateMonitor() bool

ShouldCreateMonitor reports whether the operator creates the monitor for this instance

func (*ExternalLoadBalancerSpec) ShouldCreateVIP added in v0.7.0

func (s *ExternalLoadBalancerSpec) ShouldCreateVIP() bool

ShouldCreateVIP reports whether the operator creates the virtual servers for this instance

type ExternalLoadBalancerStatus

type ExternalLoadBalancerStatus struct {
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	VIPs []VIP `json:"vips"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Ports []int `json:"ports"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	// Monitor is the monitor the operator created, unset when the pools use an existing monitor
	Monitor *Monitor `json:"monitor,omitempty"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Nodes []Node `json:"nodes,omitempty"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Pools []Pool `json:"pools,omitempty"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Provider Provider `json:"provider,omitempty"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Labels map[string]string `json:"labels,omitempty"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	NumNodes int `json:"numnodes,omitempty"`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +operator-sdk:csv:customresourcedefinitions:type=status
	// DrainingMembers tracks pool members that are currently in the draining state.
	// These members have been disabled and are waiting for their drain timeout to expire.
	DrainingMembers []DrainingMember `json:"drainingMembers,omitempty"`
}

ExternalLoadBalancerStatus defines the observed state of ExternalLoadBalancer

func (*ExternalLoadBalancerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalLoadBalancerStatus.

func (*ExternalLoadBalancerStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Monitor

type Monitor struct {
	// Name is the monitor name, it is set by the controller. When createmonitor is false, it is the name of an
	// existing monitor in the Load Balancer that the pools use, eg. `my-monitor` or `/Common/my-monitor`.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	Name string `json:"name,omitempty"`

	// Path is the path URL to check for the pool members in the format `/healthz`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Path string `json:"path"`

	// Port is the port this monitor should check the pool members
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	Port int `json:"port"`

	// MonitorType is the monitor parent type. <monitorType> must be one of "http", "https",
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// "icmp".
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=http;https;icmp
	MonitorType string `json:"monitortype"`
}

Monitor defines a monitor object in the LoadBalancer.

func (*Monitor) DeepCopy

func (in *Monitor) DeepCopy() *Monitor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Monitor.

func (*Monitor) DeepCopyInto

func (in *Monitor) DeepCopyInto(out *Monitor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Node

type Node struct {
	// Name is the host name set dynamically by the controller
	Name string `json:"name,omitempty"`
	// Host is the host IP set dynamically by the controller
	Host string `json:"host"`
	// Label is the node labels this node has
	Labels map[string]string `json:"label,omitempty"`
}

Node defines a host object in the LoadBalancer.

func (*Node) DeepCopy

func (in *Node) DeepCopy() *Node

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.

func (*Node) DeepCopyInto

func (in *Node) DeepCopyInto(out *Node)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Pool

type Pool struct {
	// Name is the Pool name, it is set by the controller
	Name string `json:"name,omitempty"`
	// Members is the host members of this pool
	Members []PoolMember `json:"members,omitempty"`
	// Monitor is the monitor name used on this pool
	Monitor string `json:"monitor"`
}

Pool defines a pool object in the LoadBalancer.

func (*Pool) DeepCopy

func (in *Pool) DeepCopy() *Pool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pool.

func (*Pool) DeepCopyInto

func (in *Pool) DeepCopyInto(out *Pool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PoolMember

type PoolMember struct {
	// Node is the node part of a pool
	Node Node `json:"node"`
	// Port is the port for this pool member
	Port int `json:"port"`
}

PoolMember defines a host object in the LoadBalancer.

func (*PoolMember) DeepCopy

func (in *PoolMember) DeepCopy() *PoolMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolMember.

func (*PoolMember) DeepCopyInto

func (in *PoolMember) DeepCopyInto(out *PoolMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Provider

type Provider struct {
	// Vendor is the backend provider vendor
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=Dummy;F5_BigIP;Citrix_ADC;HAProxy
	Vendor string `json:"vendor"`

	// Host is the Load Balancer API IP or Hostname in URL format. Eg. `http://10.25.10.10`.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=255
	Host string `json:"host"`

	// Port is the Load Balancer API Port.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	Port int `json:"port"`

	// Creds is the credentials secret holding the "username" and "password" keys.
	// Generate with: `kubectl create secret generic <secret-name> --from-literal=username=<username> --from-literal=password=<password>`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Required
	Creds string `json:"creds"`

	// Partition is the F5 partition to create the Load Balancer instances. Defaults to "Common". (F5 BigIP only)
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	Partition string `json:"partition,omitempty"`

	// ValidateCerts is a flag to validate or not the Load Balancer API certificate. Defaults to false.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Enum=true;false
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	ValidateCerts bool `json:"validatecerts,omitempty"`

	// Debug is a flag to enable debug on the backend log output. Defaults to false.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum=true;false
	// +kubebuilder:default=false
	Debug bool `json:"debug,omitempty"`

	// Type is the Load-Balancing method. Defaults to "round-robin".
	// Options are: ROUNDROBIN, LEASTCONNECTION, LEASTRESPONSETIME
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum=ROUNDROBIN;LEASTCONNECTION;LEASTRESPONSETIME
	// +kubebuilder:default=ROUNDROBIN
	LBMethod string `json:"lbmethod,omitempty"`
}

Provider is a backend provider for F5 Big IP Load Balancers

func (*Provider) DeepCopy

func (in *Provider) DeepCopy() *Provider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Provider.

func (*Provider) DeepCopyInto

func (in *Provider) DeepCopyInto(out *Provider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VIP

type VIP struct {
	// Name is the VIP instance name
	Name string `json:"name"`
	// Pool is the associated pool with this VIP
	Pool string `json:"pool"`
	// IP is the IP address this VIP instance listens to
	IP string `json:"ip"`
	// Port is the port this VIP listens to
	Port int `json:"port"`
}

VIP defines VIP instance in the LoadBalancer with a pool and port

func (*VIP) DeepCopy

func (in *VIP) DeepCopy() *VIP

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VIP.

func (*VIP) DeepCopyInto

func (in *VIP) DeepCopyInto(out *VIP)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL