v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the agents v1alpha1 API group. +kubebuilder:object:generate=true +groupName=ate.dev

Index

Constants

This section is empty.

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} //nolint:staticcheck // SA1019: scheme.Builder is the conventional kubebuilder pattern for api packages.

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

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AssetFile

type AssetFile struct {
	// URL is where to download the asset from (e.g. a gs:// URL). It may be
	// fetched anonymously or with credentials depending on atelet's
	// configuration.
	//
	// +required
	// +kubebuilder:validation:MinLength=1
	URL string `json:"url"`

	// SHA256 is the lower-case hex SHA256 of the asset. It both names the cached
	// file (preventing collisions) and verifies the download's integrity.
	//
	// +required
	// +kubebuilder:validation:Pattern=`^[a-f0-9]{64}$`
	SHA256 string `json:"sha256"`
}

AssetFile is one content-addressed file that atelet fetches for a sandbox runtime (e.g. the gVisor runsc binary, or a micro-VM kernel/firmware/config).

func (*AssetFile) DeepCopy

func (in *AssetFile) DeepCopy() *AssetFile

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

func (*AssetFile) DeepCopyInto

func (in *AssetFile) DeepCopyInto(out *AssetFile)

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

type CSIDriverConfig

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

	Spec CSIDriverConfigSpec `json:"spec"`
}

CSIDriverConfig is the Schema for the csidriverconfigs API

+genclient +genclient:nonNamespaced +kubebuilder:object:generate=true +kubebuilder:object:root=true +kubebuilder:resource:scope=Cluster,shortName=csidriverconfig +kubebuilder:printcolumn:name="Driver",type=string,JSONPath=`.spec.driverName` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*CSIDriverConfig) DeepCopy

func (in *CSIDriverConfig) DeepCopy() *CSIDriverConfig

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

func (*CSIDriverConfig) DeepCopyInto

func (in *CSIDriverConfig) DeepCopyInto(out *CSIDriverConfig)

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

func (*CSIDriverConfig) DeepCopyObject

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

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

type CSIDriverConfigList

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

CSIDriverConfigList contains a list of CSIDriverConfigs +kubebuilder:object:generate=true +kubebuilder:object:root=true

func (*CSIDriverConfigList) DeepCopy

func (in *CSIDriverConfigList) DeepCopy() *CSIDriverConfigList

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

func (*CSIDriverConfigList) DeepCopyInto

func (in *CSIDriverConfigList) DeepCopyInto(out *CSIDriverConfigList)

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

func (*CSIDriverConfigList) DeepCopyObject

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

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

type CSIDriverConfigSpec

type CSIDriverConfigSpec struct {
	// DriverName is the standard CSI driver name (e.g. "hostpath.csi.k8s.io").
	// Matches the StorageClass referenced in ActorTemplate volume definitions.
	//
	// +required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=`^(substrate\.io/)?([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$`
	DriverName string `json:"driverName"`

	// ControllerEndpoint is the gRPC endpoint for the CSI Controller service.
	// Must be a valid network URI (e.g. dns:///csi-service:9000 or tcp://127.0.0.1:9000).
	// TODO: Harden endpoint validation to prevent invalid or unsafe URI inputs.
	//
	// +required
	// +kubebuilder:validation:Pattern=`^(tcp|dns)://.+$`
	ControllerEndpoint string `json:"controllerEndpoint"`

	// NodeSocketOverride is an optional override for the CSI Node service socket
	// on the worker nodes. If empty, ATE defaults to unix:///var/lib/kubelet/plugins/[DriverName]/csi.sock.
	//
	// +optional
	// +kubebuilder:validation:Pattern=`^unix://.+$`
	NodeSocketOverride string `json:"nodeSocketOverride,omitempty"`

	// TLS configures TLS/mTLS for the connection to the ControllerEndpoint.
	// +optional
	TLS *CSIDriverTLSConfig `json:"tls,omitempty"`
}

CSIDriverConfigSpec defines the desired state of CSIDriverConfig

func (*CSIDriverConfigSpec) DeepCopy

func (in *CSIDriverConfigSpec) DeepCopy() *CSIDriverConfigSpec

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

func (*CSIDriverConfigSpec) DeepCopyInto

func (in *CSIDriverConfigSpec) DeepCopyInto(out *CSIDriverConfigSpec)

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

type CSIDriverTLSConfig

type CSIDriverTLSConfig struct {
	// Enabled controls whether TLS is used.
	// +required
	Enabled bool `json:"enabled"`

	// TODO: Add alternative support for manual certs by adding SecretReference fields.
	// UsePodIdentity indicates whether to reuse Substrate's Pod Identity (SPIFFE) certificates.
	// +optional
	UsePodIdentity bool `json:"usePodIdentity,omitempty"`

	// ServerName override for TLS verification.
	// +optional
	ServerName string `json:"serverName,omitempty"`
}

CSIDriverTLSConfig holds TLS and mTLS configuration for CSI driver connections. +kubebuilder:validation:XValidation:rule="!self.enabled || (has(self.usePodIdentity) && self.usePodIdentity)",message="tls.usePodIdentity must be true when tls.enabled is true; manual certificates are not yet supported"

func (*CSIDriverTLSConfig) DeepCopy

func (in *CSIDriverTLSConfig) DeepCopy() *CSIDriverTLSConfig

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

func (*CSIDriverTLSConfig) DeepCopyInto

func (in *CSIDriverTLSConfig) DeepCopyInto(out *CSIDriverTLSConfig)

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

type SandboxClass

type SandboxClass string

SandboxClass selects the sandbox runtime family. It is shared by WorkerPool (which family a pool runs) and SandboxConfig (which family a config is for).

const (
	// SandboxClassGvisor is the gVisor/runsc runtime (cmd/ateom-gvisor). Default.
	SandboxClassGvisor SandboxClass = "gvisor"
	// SandboxClassMicroVM is the micro-VM runtime (cmd/ateom-microvm); needs
	// /dev/kvm and vhost devices.
	SandboxClassMicroVM SandboxClass = "microvm"
)

type SandboxConfig

type SandboxConfig struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec defines the desired state of SandboxConfig
	// +required
	Spec SandboxConfigSpec `json:"spec"`
}

SandboxConfig is cluster-scoped configuration describing the sandbox binaries for a sandbox runtime family. It is referenced by an ActorTemplate's sandbox_config.config_name (required) and decouples sandbox binary selection from the workload definition.

+genclient +genclient:nonNamespaced +kubebuilder:object:generate=true +kubebuilder:object:root=true +kubebuilder:resource:scope=Cluster,shortName=sandboxconfig +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.sandboxClass` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*SandboxConfig) DeepCopy

func (in *SandboxConfig) DeepCopy() *SandboxConfig

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

func (*SandboxConfig) DeepCopyInto

func (in *SandboxConfig) DeepCopyInto(out *SandboxConfig)

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

func (*SandboxConfig) DeepCopyObject

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

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

type SandboxConfigList

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

SandboxConfigList contains a list of SandboxConfigs. +kubebuilder:object:generate=true +kubebuilder:object:root=true

func (*SandboxConfigList) DeepCopy

func (in *SandboxConfigList) DeepCopy() *SandboxConfigList

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

func (*SandboxConfigList) DeepCopyInto

func (in *SandboxConfigList) DeepCopyInto(out *SandboxConfigList)

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

func (*SandboxConfigList) DeepCopyObject

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

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

type SandboxConfigSpec

type SandboxConfigSpec struct {
	// SandboxClass is the sandbox runtime family this config applies to. An
	// ActorTemplate only uses SandboxConfigs whose SandboxClass matches its
	// sandbox_config.sandbox_class.
	//
	// +required
	// +kubebuilder:validation:Enum=gvisor;microvm
	// +kubebuilder:default=gvisor
	SandboxClass SandboxClass `json:"sandboxClass"`

	// PauseImage is the container image used as the root sandbox container.
	// It holds the sandbox's namespaces and runs no workload code, so it is an
	// implementation detail of the sandbox rather than something actor authors
	// choose. It is captured in the snapshot manifest alongside the sandbox
	// binaries, so a restore always re-creates the sandbox from the same image
	// the snapshot was taken with.
	//
	// Typically, set it to [1] for on-gcp, and [2] for off-gcp
	//
	//   - [1] gcr.io/gke-release/pause@sha256:bcbd57ba5653580ec647b16d8163cdd1112df3609129b01f912a8032e48265da
	//   - [2] registry.k8s.io/pause:3.10.2@sha256:f548e0e8e3dc1896ca956272154dde3314e8cc4fde0a57577ee9fa1c63f5baf4
	//
	// +required
	// +kubebuilder:validation:XValidation:rule="self.contains('@')",message="All images must be pinned (changing the image invalidates snapshots)"
	PauseImage string `json:"pauseImage"`

	// Assets is the set of files atelet fetches for this runtime, keyed first by
	// architecture (GOARCH, e.g. "amd64", "arm64") and then by asset name. The
	// asset names are interpreted by the sandbox backend: gVisor expects a
	// "gvisor" asset (the release's gvisor.tar.zstd, which atelet extracts so
	// the gvisor-bin/ helpers sit next to runsc; a legacy bare-binary "runsc"
	// asset is still accepted); a micro-VM backend expects several (e.g.
	// "cloud-hypervisor", "kata-kernel", "kata-image"). The schema is
	// intentionally generic; per-class requirements are enforced by a
	// ValidatingAdmissionPolicy.
	//
	// +optional
	Assets map[string]map[string]AssetFile `json:"assets,omitempty"`
}

SandboxConfigSpec is the desired state of a SandboxConfig.

func (*SandboxConfigSpec) DeepCopy

func (in *SandboxConfigSpec) DeepCopy() *SandboxConfigSpec

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

func (*SandboxConfigSpec) DeepCopyInto

func (in *SandboxConfigSpec) DeepCopyInto(out *SandboxConfigSpec)

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

type WorkerPool

type WorkerPool struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec defines the desired state of WorkerPool
	// +required
	Spec WorkerPoolSpec `json:"spec"`

	// status is the observed state of WorkerPool
	// +optional
	Status WorkerPoolStatus `json:"status,omitempty"`
}

WorkerPool is the Schema for the workerpools API +genclient +kubebuilder:object:generate=true +kubebuilder:object:root=true +kubebuilder:resource:scope=Namespaced,shortName=workerpool +kubebuilder:subresource:status +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=`.spec.replicas` +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas` +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=`.status.readyReplicas` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*WorkerPool) DeepCopy

func (in *WorkerPool) DeepCopy() *WorkerPool

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

func (*WorkerPool) DeepCopyInto

func (in *WorkerPool) DeepCopyInto(out *WorkerPool)

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

func (*WorkerPool) DeepCopyObject

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

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

type WorkerPoolLabelValue

type WorkerPoolLabelValue string

WorkerPoolLabelValue is a Kubernetes label value for generated worker workloads.

+kubebuilder:validation:MaxLength=63 +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$`

type WorkerPoolList

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

WorkerPoolList contains a list of WorkerPools. +kubebuilder:object:generate=true +kubebuilder:object:root=true

func (*WorkerPoolList) DeepCopy

func (in *WorkerPoolList) DeepCopy() *WorkerPoolList

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

func (*WorkerPoolList) DeepCopyInto

func (in *WorkerPoolList) DeepCopyInto(out *WorkerPoolList)

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

func (*WorkerPoolList) DeepCopyObject

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

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

type WorkerPoolPodTemplate

type WorkerPoolPodTemplate struct {
	// Labels are added to the generated Deployment and worker pods. Keys in
	// the ate.dev domain and its subdomains are reserved for controllers.
	//
	// +optional
	// +kubebuilder:validation:MaxProperties=64
	// +kubebuilder:validation:XValidation:rule="self.all(key, !key.startsWith('ate.dev/') && !key.contains('.ate.dev/'))",message="ate.dev and its subdomains are reserved"
	// +kubebuilder:validation:XValidation:rule="self.all(key, !format.qualifiedName().validate(key).hasValue())",message="label keys must be valid Kubernetes qualified names"
	Labels map[string]WorkerPoolLabelValue `json:"labels,omitempty"`

	// Annotations are added to the generated Deployment and worker pods. Keys
	// in the ate.dev domain and its subdomains are reserved for controllers.
	//
	// +optional
	// +kubebuilder:validation:MaxProperties=64
	// +kubebuilder:validation:XValidation:rule="self.all(key, !key.startsWith('ate.dev/') && !key.contains('.ate.dev/'))",message="ate.dev and its subdomains are reserved"
	// +kubebuilder:validation:XValidation:rule="self.all(key, !format.qualifiedName().validate(key).hasValue())",message="annotation keys must be valid Kubernetes qualified names"
	Annotations map[string]string `json:"annotations,omitempty"`

	// NodeSelector is a selector which must be true for the pod to fit on a node.
	//
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Tolerations for the worker pods.
	//
	// +optional
	// +kubebuilder:validation:MaxItems=16
	// +listType=atomic
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// PriorityClassName for the worker pods.
	//
	// +optional
	PriorityClassName string `json:"priorityClassName,omitempty"`

	// NodeAffinity scheduling rules for the worker pods. Mapped to
	// spec.affinity.nodeAffinity on the pod.
	//
	// +optional
	NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty"`

	// Resources are the compute resources allocated for each worker pod.
	//
	// +optional
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}

WorkerPoolPodTemplate defines optional metadata, scheduling, and resource settings for worker workloads. NodeAffinity is mapped to spec.affinity.nodeAffinity on the pod.

func (*WorkerPoolPodTemplate) DeepCopy

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

func (*WorkerPoolPodTemplate) DeepCopyInto

func (in *WorkerPoolPodTemplate) DeepCopyInto(out *WorkerPoolPodTemplate)

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

type WorkerPoolSpec

type WorkerPoolSpec struct {
	// Replicas is the number of worker pods to run.
	// +required
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// WorkerImage is the ateom container image to deploy as workers.
	// +kubebuilder:validation:MinLength=1
	// +required
	WorkerImage string `json:"workerImage"`

	// Template holds optional metadata, scheduling, and resource settings for worker workloads.
	//
	// +optional
	Template *WorkerPoolPodTemplate `json:"template,omitempty"`

	// SandboxClass selects the sandbox runtime family for this pool, which drives
	// the worker pod shape (KVM/vhost device mounts and node placement). The
	// concrete binary is still selected by WorkerImage. Defaults to gvisor.
	// The sandbox binaries themselves come from the SandboxConfig each
	// ActorTemplate names (required).
	//
	// See Also: TODOs in ActorTemplate SandboxClass
	//
	// +optional
	// +kubebuilder:validation:Enum=gvisor;microvm
	// +kubebuilder:default=gvisor
	SandboxClass SandboxClass `json:"sandboxClass,omitempty"`
}

func (*WorkerPoolSpec) DeepCopy

func (in *WorkerPoolSpec) DeepCopy() *WorkerPoolSpec

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

func (*WorkerPoolSpec) DeepCopyInto

func (in *WorkerPoolSpec) DeepCopyInto(out *WorkerPoolSpec)

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

type WorkerPoolStatus

type WorkerPoolStatus struct {
	// Replicas is the total number of worker pods.
	// +kubebuilder:validation:Minimum=0
	// +optional
	Replicas int32 `json:"replicas"`

	// ReadyReplicas is the number of ready worker pods.
	// +kubebuilder:validation:Minimum=0
	// +optional
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// Selector is the label selector for the worker pods.
	// +optional
	Selector string `json:"selector,omitempty"`
}

func (*WorkerPoolStatus) DeepCopy

func (in *WorkerPoolStatus) DeepCopy() *WorkerPoolStatus

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

func (*WorkerPoolStatus) DeepCopyInto

func (in *WorkerPoolStatus) DeepCopyInto(out *WorkerPoolStatus)

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