v1alpha1

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the sleepy v1alpha1 API group. +kubebuilder:object:generate=true +groupName=sleepy.atha.gr

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "sleepy.atha.gr", Version: "v1alpha1"}

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

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

Functions

This section is empty.

Types

type BackendServiceSpec

type BackendServiceSpec struct {
	// Enabled controls whether to create the backend Service
	// +kubebuilder:default:=true
	// +optional
	Enabled *bool `json:"enabled,omitempty"`

	// Type of service (ClusterIP, NodePort, LoadBalancer, ExternalName)
	// +kubebuilder:default:="ClusterIP"
	// +kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer;ExternalName
	// +optional
	Type corev1.ServiceType `json:"type,omitempty"`

	// Ports to expose on the Service
	// If not specified, will auto-create based on the first container port
	// +optional
	Ports []ServicePort `json:"ports,omitempty"`

	// ClusterIP to use (optional, usually left empty for auto-assignment)
	// +optional
	ClusterIP string `json:"clusterIP,omitempty"`

	// ExternalIPs that will route to this Service
	// +optional
	ExternalIPs []string `json:"externalIPs,omitempty"`

	// LoadBalancerIP for LoadBalancer type Services
	// +optional
	LoadBalancerIP string `json:"loadBalancerIP,omitempty"`

	// SessionAffinity (ClientIP or None)
	// +kubebuilder:validation:Enum=ClientIP;None
	// +optional
	SessionAffinity corev1.ServiceAffinity `json:"sessionAffinity,omitempty"`

	// Annotations to add to the backend Service
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

BackendServiceSpec defines how to create the backend Service

func (*BackendServiceSpec) DeepCopy

func (in *BackendServiceSpec) DeepCopy() *BackendServiceSpec

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

func (*BackendServiceSpec) DeepCopyInto

func (in *BackendServiceSpec) DeepCopyInto(out *BackendServiceSpec)

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

type Component

type Component struct {
	// Name is a unique identifier for this component
	Name string `json:"name"`

	// Type of resource: Deployment, StatefulSet, CNPGCluster
	// +kubebuilder:validation:Enum=Deployment;StatefulSet;CNPGCluster
	Type ComponentType `json:"type"`

	// Ref identifies the resource
	Ref ResourceRef `json:"ref"`

	// Replicas to scale to when waking (for Deployment/StatefulSet)
	// +kubebuilder:default:=1
	Replicas *int32 `json:"replicas,omitempty"`

	// DependsOn lists component names that must be ready before this one
	DependsOn []string `json:"dependsOn,omitempty"`
}

func (*Component) DeepCopy

func (in *Component) DeepCopy() *Component

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

func (*Component) DeepCopyInto

func (in *Component) DeepCopyInto(out *Component)

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

type ComponentStatus

type ComponentStatus struct {
	Name    string `json:"name"`
	Ready   bool   `json:"ready"`
	Message string `json:"message,omitempty"`
}

func (*ComponentStatus) DeepCopy

func (in *ComponentStatus) DeepCopy() *ComponentStatus

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

func (*ComponentStatus) DeepCopyInto

func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus)

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

type ComponentType

type ComponentType string
const (
	ComponentTypeDeployment  ComponentType = "Deployment"
	ComponentTypeStatefulSet ComponentType = "StatefulSet"
	ComponentTypeCNPGCluster ComponentType = "CNPGCluster"
)

type ResourceRef

type ResourceRef struct {
	// Name of the resource
	Name string `json:"name"`

	// Namespace, defaults to the SleepyService's namespace
	Namespace string `json:"namespace,omitempty"`
}

func (*ResourceRef) DeepCopy

func (in *ResourceRef) DeepCopy() *ResourceRef

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

func (*ResourceRef) DeepCopyInto

func (in *ResourceRef) DeepCopyInto(out *ResourceRef)

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

type ServicePort

type ServicePort struct {
	// Name of the port (required if multiple ports)
	// +optional
	Name string `json:"name,omitempty"`

	// Protocol (TCP, UDP, SCTP)
	// +kubebuilder:default:="TCP"
	// +kubebuilder:validation:Enum=TCP;UDP;SCTP
	// +optional
	Protocol corev1.Protocol `json:"protocol,omitempty"`

	// Port to expose on the Service
	Port int32 `json:"port"`

	// TargetPort on the pod (can be port number or name)
	// If not specified, defaults to Port
	// +optional
	TargetPort intstr.IntOrString `json:"targetPort,omitempty"`

	// NodePort for NodePort/LoadBalancer type (30000-32767)
	// +optional
	NodePort int32 `json:"nodePort,omitempty"`
}

ServicePort defines a port to expose on the backend Service

func (*ServicePort) DeepCopy

func (in *ServicePort) DeepCopy() *ServicePort

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

func (*ServicePort) DeepCopyInto

func (in *ServicePort) DeepCopyInto(out *ServicePort)

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

type ServiceState

type ServiceState string
const (
	StateSleeping    ServiceState = "Sleeping"
	StateWaking      ServiceState = "Waking"
	StateAwake       ServiceState = "Awake"
	StateHibernating ServiceState = "Hibernating"
	StateError       ServiceState = "Error"
)

type SleepyService

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

	Spec   SleepyServiceSpec   `json:"spec,omitempty"`
	Status SleepyServiceStatus `json:"status,omitempty"`
}

SleepyService is the Schema for the sleepyservices API.

func (*SleepyService) DeepCopy

func (in *SleepyService) DeepCopy() *SleepyService

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

func (*SleepyService) DeepCopyInto

func (in *SleepyService) DeepCopyInto(out *SleepyService)

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

func (*SleepyService) DeepCopyObject

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

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

type SleepyServiceList

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

SleepyServiceList contains a list of SleepyService.

func (*SleepyServiceList) DeepCopy

func (in *SleepyServiceList) DeepCopy() *SleepyServiceList

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

func (*SleepyServiceList) DeepCopyInto

func (in *SleepyServiceList) DeepCopyInto(out *SleepyServiceList)

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

func (*SleepyServiceList) DeepCopyObject

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

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

type SleepyServiceSpec

type SleepyServiceSpec struct {
	// Debug enabled /_wake/debug/wake and /_wake/debug/sleep endpoints
	// +optional
	// +kubebuilder:default:=false
	Debug *bool `json:"debug,omitempty"`

	// BackendService configuration for the managed backend Service
	// +optional
	BackendService *BackendServiceSpec `json:"backendService,omitempty"`

	// WakeTimeout is how long to wait for the stack to wake
	// +kubebuilder:default:="5m"
	WakeTimeout metav1.Duration `json:"wakeTimeout,omitempty"`

	// IdleTimeout triggers auto-hibernate after no activity (0 = disabled)
	// +kubebuilder:default:="0"
	IdleTimeout metav1.Duration `json:"idleTimeout,omitempty"`

	// Components to manage, in dependency order
	// +kubebuilder:validation:MinItems=1
	Components []Component `json:"components"`
}

SleepyServiceSpec defines the desired state of SleepyService.

func (*SleepyServiceSpec) DeepCopy

func (in *SleepyServiceSpec) DeepCopy() *SleepyServiceSpec

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

func (*SleepyServiceSpec) DeepCopyInto

func (in *SleepyServiceSpec) DeepCopyInto(out *SleepyServiceSpec)

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

type SleepyServiceStatus

type SleepyServiceStatus struct {
	// DesiredState is what the proxy wants the service to be (set by proxy)
	// +optional
	// +kubebuilder:validation:Enum=Sleeping;Waking;Awake;Hibernating;Error
	DesiredState ServiceState `json:"desiredState,omitempty"`

	// State is the current state of the service (set by controller)
	// +kubebuilder:validation:Enum=Sleeping;Waking;Awake;Hibernating;Error
	State ServiceState `json:"state,omitempty"`

	// LastTransition is when the state last changed
	LastTransition *metav1.Time `json:"lastTransition,omitempty"`

	// LastActivity is when the service last received traffic (set by proxy)
	LastActivity *metav1.Time `json:"lastActivity,omitempty"`

	// Components status
	Components []ComponentStatus `json:"components,omitempty"`

	// ProxyDeployment is the name of the created proxy
	ProxyDeployment string `json:"proxyDeployment,omitempty"`

	// BackendService is the name of the created backend Service
	BackendService string `json:"backendService,omitempty"`

	// Conditions for standard k8s status reporting
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

SleepyServiceStatus defines the observed state of SleepyService.

func (*SleepyServiceStatus) DeepCopy

func (in *SleepyServiceStatus) DeepCopy() *SleepyServiceStatus

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

func (*SleepyServiceStatus) DeepCopyInto

func (in *SleepyServiceStatus) DeepCopyInto(out *SleepyServiceStatus)

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