Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the agents v1alpha1 API group. +kubebuilder:object:generate=true +groupName=ate.dev
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type AssetFile
- type CSIDriverConfig
- type CSIDriverConfigList
- type CSIDriverConfigSpec
- type CSIDriverTLSConfig
- type SandboxClass
- type SandboxConfig
- type SandboxConfigList
- type SandboxConfigReference
- type SandboxConfigSpec
- type SandboxVersionConfig
- type SandboxVersionState
- type WorkerPool
- type WorkerPoolLabelValue
- type WorkerPoolList
- type WorkerPoolPodTemplate
- type WorkerPoolSandboxClass
- type WorkerPoolSandboxClassStatus
- type WorkerPoolSpec
- type WorkerPoolStatus
Constants ¶
const ( // WorkerPoolSandboxClassConditionResolved is True when the sandbox // class's spec resolves to a usable SandboxConfig. While it is False for // any class, the controller applies the worker Deployment only if one // already exists or every class has a config in use. WorkerPoolSandboxClassConditionResolved = "Resolved" // WorkerPoolReasonResolved: the sandbox class resolved. WorkerPoolReasonResolved = "Resolved" // WorkerPoolReasonSandboxConfigNotFound: configRef names a SandboxConfig // that does not exist. WorkerPoolReasonSandboxConfigNotFound = "SandboxConfigNotFound" // WorkerPoolReasonSandboxConfigDeleting: the SandboxConfig configRef // names, or the only class default, is being deleted. This is reported // whether or not the pool already uses it. WorkerPoolReasonSandboxConfigDeleting = "SandboxConfigDeleting" // WorkerPoolReasonSandboxClassMismatch: configRef names a SandboxConfig // of another sandbox class. WorkerPoolReasonSandboxClassMismatch = "SandboxClassMismatch" // WorkerPoolReasonDefaultConfigNotFound: configRef is omitted and no // SandboxConfig of the class is annotated as the class default. WorkerPoolReasonDefaultConfigNotFound = "DefaultConfigNotFound" )
const SandboxConfigClassDefaultAnnotation = "sandboxconfig.ate.dev/is-class-default"
SandboxConfigClassDefaultAnnotation marks a SandboxConfig as a default for its sandboxClass when set to "true". More than one SandboxConfig of the same class may carry it; the newest one wins.
const SandboxConfigWorkerPoolProtectionFinalizer = "sandboxconfig.ate.dev/workerpool-protection"
SandboxConfigWorkerPoolProtectionFinalizer is put on a SandboxConfig by atecontroller before any WorkerPool's status records it. It stays until the config is deleted. Deleting a config that carries it goes in three steps:
- The delete only sets deletionTimestamp, because the finalizer list is not empty. The config stays, Terminating.
- atecontroller checks whether any WorkerPool's status.sandboxClasses names the config, in configRef or pendingConfigRef. If one does, it leaves the finalizer and checks again whenever a WorkerPool changes. Once none does, it removes the finalizer.
- With the finalizer list empty, the API server deletes the config.
Without atecontroller, step 2 never happens and the config stays Terminating until someone clears the finalizer by hand. A config no pool has ever used carries no finalizer and deletes at once.
A pool that switches to a config names it in pendingConfigRef first. Then atecontroller reads the config from the API server, and moves configRef to it only if that read finds it is not being deleted. So a config is never released while a pool's configRef names it.
Variables ¶
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). atelet
// fetches every URL through the node's object-store plugin, with the
// plugin's credentials. The plugin refuses URLs under a snapshot location.
// The in-tree plugin serves only its storage backend's scheme: gs:// on
// GCS, s3:// on S3. A gs:// URL the plugin has no object for or cannot
// serve is then read anonymously, which serves public buckets such as
// gs://gvisor.
//
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=2048
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetFile.
func (*AssetFile) DeepCopyInto ¶
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"`
// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// spec defines the desired state of CSIDriverConfig
// +required
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"`
// usePodIdentity indicates whether to reuse Substrate's Pod Identity (SPIFFE) certificates.
// +optional
UsePodIdentity bool `json:"usePodIdentity,omitempty"`
// serverName specifies the expected server name (SAN) for TLS certificate verification.
// Required when TLS is enabled.
// +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" +kubebuilder:validation:XValidation:rule="!self.enabled || (has(self.serverName) && size(self.serverName) > 0)",message="tls.serverName is required when tls.enabled is true"
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/ateworker-gvisor). Default. SandboxClassGvisor SandboxClass = sandboxclass.GVisor // SandboxClassMicroVM is the micro-VM runtime (cmd/ateworker-microvm); needs // /dev/kvm and vhost devices. SandboxClassMicroVM SandboxClass = 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 versions of the sandbox binaries for a sandbox runtime family. It is referenced by a WorkerPool's spec.sandboxClasses[].configRef (or resolved via the sandboxconfig.ate.dev/is-class-default annotation) 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="Default",type=string,JSONPath=`.spec.defaultVersion` +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 SandboxConfigReference ¶
type SandboxConfigReference struct {
// name is the SandboxConfig's metadata.name.
//
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Name string `json:"name,omitempty"`
}
SandboxConfigReference names a cluster-scoped SandboxConfig.
func (*SandboxConfigReference) DeepCopy ¶
func (in *SandboxConfigReference) DeepCopy() *SandboxConfigReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SandboxConfigReference.
func (*SandboxConfigReference) DeepCopyInto ¶
func (in *SandboxConfigReference) DeepCopyInto(out *SandboxConfigReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SandboxConfigSpec ¶
type SandboxConfigSpec struct {
// sandboxClass is the sandbox runtime family this config applies to. A
// WorkerPool only uses SandboxConfigs whose sandboxClass matches the entry
// in its spec.sandboxClasses.
//
// +optional
// +kubebuilder:validation:Enum=gvisor;microvm
// +kubebuilder:default=gvisor
SandboxClass SandboxClass `json:"sandboxClass,omitempty"`
// defaultVersion names the entry in versions that new sandboxes boot with.
// It must name an existing, non-Disabled version.
//
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
DefaultVersion string `json:"defaultVersion,omitempty"`
// versions are the sandbox versions this config offers, keyed by name.
//
// +required
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=16
Versions []SandboxVersionConfig `json:"versions,omitempty"`
}
SandboxConfigSpec is the desired state of a SandboxConfig.
+kubebuilder:validation:XValidation:rule="self.versions.exists(v, v.name == self.defaultVersion)",message="defaultVersion must name an entry in versions" +kubebuilder:validation:XValidation:rule="!self.versions.exists(v, v.name == self.defaultVersion && has(v.state) && v.state == 'Disabled')",message="the version named by defaultVersion must not be Disabled"
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.
func (*SandboxConfigSpec) DefaultVersionConfig ¶
func (s *SandboxConfigSpec) DefaultVersionConfig() (*SandboxVersionConfig, bool)
DefaultVersionConfig returns the entry of Versions named by DefaultVersion, and whether one exists. A Disabled entry is never returned: the CRD rejects a Disabled default, so a spec that reads back that way is treated as having no default version.
type SandboxVersionConfig ¶
type SandboxVersionConfig struct {
// name identifies this version within its SandboxConfig. It is a DNS label
// (lower-case alphanumerics and '-').
//
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
Name string `json:"name,omitempty"`
// state is whether this version may be used: Enabled (default) or
// Disabled.
//
// +optional
// +kubebuilder:default=Enabled
State *SandboxVersionState `json:"state,omitempty"`
// 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 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"`
}
SandboxVersionConfig is one version of a SandboxConfig: the asset set a sandbox boots with.
func (*SandboxVersionConfig) DeepCopy ¶
func (in *SandboxVersionConfig) DeepCopy() *SandboxVersionConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SandboxVersionConfig.
func (*SandboxVersionConfig) DeepCopyInto ¶
func (in *SandboxVersionConfig) DeepCopyInto(out *SandboxVersionConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SandboxVersionState ¶
type SandboxVersionState string
SandboxVersionState is whether a SandboxConfig version may be used.
+kubebuilder:validation:Enum=Enabled;Disabled
const ( // SandboxVersionStateEnabled marks a version as usable. Default. SandboxVersionStateEnabled SandboxVersionState = "Enabled" // SandboxVersionStateDisabled marks a version as unusable. The version // named by defaultVersion cannot be disabled. SandboxVersionStateDisabled SandboxVersionState = "Disabled" )
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="SandboxConfig",type=string,JSONPath=`.status.sandboxClasses[*].configRef.name` +kubebuilder:printcolumn:name="Resolved",type=string,JSONPath=`.status.sandboxClasses[*].conditions[?(@.type=="Resolved")].status` +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.
func (*WorkerPool) ResolvedSandboxConfig ¶
func (p *WorkerPool) ResolvedSandboxConfig() string
ResolvedSandboxConfig returns the name of the SandboxConfig the controller confirmed for the class the pool's workers run, or "" if it has not resolved one yet. It never returns pendingConfigRef: that config is not confirmed yet.
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"`
// serviceAccountName for the worker pods. The ServiceAccount must exist
// in the WorkerPool's namespace. When omitted, the pods run as the
// "ateworker" ServiceAccount, which the controller creates.
//
// +optional
// +kubebuilder:validation:MinLength=1
ServiceAccountName *string `json:"serviceAccountName,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 ¶
func (in *WorkerPoolPodTemplate) DeepCopy() *WorkerPoolPodTemplate
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 WorkerPoolSandboxClass ¶
type WorkerPoolSandboxClass struct {
// name selects the sandbox runtime family, which drives the worker pod
// shape (KVM/vhost device mounts and node placement). The concrete binary
// is still selected by WorkerImage. The sandbox binaries themselves come
// from the SandboxConfig referenced by ConfigRef (or the class default).
//
// +required
// +kubebuilder:validation:Enum=gvisor;microvm
Name SandboxClass `json:"name,omitempty"`
// configRef names a cluster-scoped SandboxConfig for this sandbox class.
// The referenced config's SandboxClass must match Name. When omitted, the
// pool uses the newest SandboxConfig of this class annotated
// sandboxconfig.ate.dev/is-class-default: "true". The controller reports
// the resolved config in status.sandboxClasses.
//
// +optional
ConfigRef *SandboxConfigReference `json:"configRef,omitempty"`
}
WorkerPoolSandboxClass is one sandbox runtime family a WorkerPool runs.
func (*WorkerPoolSandboxClass) DeepCopy ¶
func (in *WorkerPoolSandboxClass) DeepCopy() *WorkerPoolSandboxClass
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerPoolSandboxClass.
func (*WorkerPoolSandboxClass) DeepCopyInto ¶
func (in *WorkerPoolSandboxClass) DeepCopyInto(out *WorkerPoolSandboxClass)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkerPoolSandboxClassStatus ¶
type WorkerPoolSandboxClassStatus struct {
// conditions describe the current state of this sandbox class.
//
// +optional
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
// name is the sandbox runtime family.
//
// +required
// +kubebuilder:validation:Enum=gvisor;microvm
Name SandboxClass `json:"name,omitempty"`
// configRef names the cluster-scoped SandboxConfig in use. That is the
// config spec.sandboxClasses[].configRef names, or the class default, or
// the last resolved config while the spec does not resolve. Omitted when
// the class has never resolved.
//
// +optional
ConfigRef *SandboxConfigReference `json:"configRef,omitempty"`
// pendingConfigRef names the SandboxConfig the class is switching to
// while the controller confirms it against the API server. It protects
// the config from deletion like configRef does. The same reconcile
// clears it, and configRef either moves to it or stays where it was.
//
// +optional
PendingConfigRef *SandboxConfigReference `json:"pendingConfigRef,omitempty"`
}
WorkerPoolSandboxClassStatus reports the SandboxConfig and resolution state of one sandbox class of a WorkerPool.
func (*WorkerPoolSandboxClassStatus) DeepCopy ¶
func (in *WorkerPoolSandboxClassStatus) DeepCopy() *WorkerPoolSandboxClassStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerPoolSandboxClassStatus.
func (*WorkerPoolSandboxClassStatus) DeepCopyInto ¶
func (in *WorkerPoolSandboxClassStatus) DeepCopyInto(out *WorkerPoolSandboxClassStatus)
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 worker 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"`
// sandboxClasses lists the sandbox runtime families this pool runs. Exactly
// one entry is allowed today. The names cannot change after creation.
//
// +required
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=1
// +kubebuilder:validation:XValidation:rule="self.map(c, c.name) == oldSelf.map(c, c.name)",message="sandboxClasses names are immutable"
// +listType=map
// +listMapKey=name
SandboxClasses []WorkerPoolSandboxClass `json:"sandboxClasses,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.
func (*WorkerPoolSpec) DefaultSandboxClass ¶
func (s *WorkerPoolSpec) DefaultSandboxClass() SandboxClass
DefaultSandboxClass returns the sandbox class of the pool's first SandboxClasses entry, or "" if there is none. Currently SandboxClasses is always a list of length 1.
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"`
// sandboxClasses reports the SandboxConfig each sandbox class of the pool
// uses and whether the class's spec resolves.
//
// +optional
// +kubebuilder:validation:MaxItems=1
// +listType=map
// +listMapKey=name
SandboxClasses []WorkerPoolSandboxClassStatus `json:"sandboxClasses,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.