v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the spin v1alpha1 API group +kubebuilder:object:generate=true +groupName=core.spinoperator.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "core.spinoperator.dev", 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 ExecutorDeploymentConfig

type ExecutorDeploymentConfig struct {
	// RuntimeClassName is the runtime class name that should be used by pods created
	// as part of a deployment.
	RuntimeClassName string `json:"runtimeClassName"`
}

func (*ExecutorDeploymentConfig) DeepCopy

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

func (*ExecutorDeploymentConfig) DeepCopyInto

func (in *ExecutorDeploymentConfig) DeepCopyInto(out *ExecutorDeploymentConfig)

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

type HTTPHealthProbe

type HTTPHealthProbe struct {
	// Path is the path that should be used when calling the application for a
	// health check, e.g /healthz.
	Path string `json:"path"`

	// HTTPHeaders are headers that should be included in the health check request.
	//
	// +optional
	HTTPHeaders []HTTPHealthProbeHeader `json:"httpHeaders"`
}

HTTPHealthProbe defines a HealthProbe that should use HTTP to call the application.

func (*HTTPHealthProbe) DeepCopy

func (in *HTTPHealthProbe) DeepCopy() *HTTPHealthProbe

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

func (*HTTPHealthProbe) DeepCopyInto

func (in *HTTPHealthProbe) DeepCopyInto(out *HTTPHealthProbe)

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

type HTTPHealthProbeHeader

type HTTPHealthProbeHeader struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

HTTPHealthProbeHeader is an abstraction around a http header key/value pair.

func (*HTTPHealthProbeHeader) DeepCopy

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

func (*HTTPHealthProbeHeader) DeepCopyInto

func (in *HTTPHealthProbeHeader) DeepCopyInto(out *HTTPHealthProbeHeader)

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

type HealthChecks

type HealthChecks struct {
	// Readiness defines the readiness probe for the application.
	Readiness *HealthProbe `json:"readiness,omitempty"`

	// Liveness defines the liveness probe for the application.
	Liveness *HealthProbe `json:"liveness,omitempty"`
}

HealthChecks defines configuration for readiness and liveness probes for the application.

func (*HealthChecks) DeepCopy

func (in *HealthChecks) DeepCopy() *HealthChecks

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

func (*HealthChecks) DeepCopyInto

func (in *HealthChecks) DeepCopyInto(out *HealthChecks)

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

type HealthProbe

type HealthProbe struct {
	// HTTPGet describes a health check that should be performed using a GET request.
	HTTPGet *HTTPHealthProbe `json:"httpGet,omitempty"`

	// Number of seconds after the app has started before liveness probes are initiated.
	// Default 10s.
	//
	// +kubebuilder:default:=10
	InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`

	// Number of seconds after which the probe times out.
	// Defaults to 1 second. Minimum value is 1.
	//
	// +kubebuilder:default:=1
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`

	// How often (in seconds) to perform the probe.
	// Default to 10 seconds. Minimum value is 1.
	//
	// +optional
	// +kubebuilder:default:=10
	PeriodSeconds int32 `json:"periodSeconds,omitempty"`

	// Minimum consecutive successes for the probe to be considered successful after having failed.
	// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
	//
	// +optional
	// +kubebuilder:default:=1
	SuccessThreshold int32 `json:"successThreshold,omitempty"`

	// Minimum consecutive failures for the probe to be considered failed after having succeeded.
	// Defaults to 3. Minimum value is 1.
	//
	// +optional
	// +kubebuilder:default:=3
	FailureThreshold int32 `json:"failureThreshold,omitempty"`
}

HealthProbe defines an individual health check for an application.

func (*HealthProbe) DeepCopy

func (in *HealthProbe) DeepCopy() *HealthProbe

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

func (*HealthProbe) DeepCopyInto

func (in *HealthProbe) DeepCopyInto(out *HealthProbe)

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

type KeyValueStoreConfig

type KeyValueStoreConfig struct {
	Name    string                `json:"name"`
	Type    string                `json:"type"`
	Options []RuntimeConfigOption `json:"options,omitempty"`
}

func (*KeyValueStoreConfig) DeepCopy

func (in *KeyValueStoreConfig) DeepCopy() *KeyValueStoreConfig

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

func (*KeyValueStoreConfig) DeepCopyInto

func (in *KeyValueStoreConfig) DeepCopyInto(out *KeyValueStoreConfig)

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

type LLMComputeConfig

type LLMComputeConfig struct {
	Type    string                `json:"type"`
	Options []RuntimeConfigOption `json:"options,omitempty"`
}

func (*LLMComputeConfig) DeepCopy

func (in *LLMComputeConfig) DeepCopy() *LLMComputeConfig

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

func (*LLMComputeConfig) DeepCopyInto

func (in *LLMComputeConfig) DeepCopyInto(out *LLMComputeConfig)

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

type Resources

type Resources struct {
	// Limits describes the maximum amount of compute resources allowed.
	Limits corev1.ResourceList `json:"limits,omitempty"`

	// Requests describes the minimum amount of compute resources required.
	// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
	// otherwise to an implementation-defined value. Requests cannot exceed Limits.
	Requests corev1.ResourceList `json:"requests,omitempty"`
}

Resources defines the resource requirements for this app.

func (*Resources) DeepCopy

func (in *Resources) DeepCopy() *Resources

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

func (*Resources) DeepCopyInto

func (in *Resources) DeepCopyInto(out *Resources)

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

type RuntimeConfig

type RuntimeConfig struct {
	// LoadFromSecret is the name of the secret to load runtime config from. The
	// secret should have a single key named "runtime-config.toml" that contains
	// the base64 encoded runtime config. If this is provided all other runtime
	// config is ignored.
	//
	// +optional
	LoadFromSecret string `json:"loadFromSecret,omitempty"`

	// SqliteDatabases provides spin bindings to different SQLite database providers.
	// e.g on-disk or turso.
	SqliteDatabases []SqliteDatabaseConfig `json:"sqliteDatabases,omitempty"`

	KeyValueStores []KeyValueStoreConfig `json:"keyValueStores,omitempty"`

	LLMCompute *LLMComputeConfig `json:"llmCompute,omitempty"`
}

RuntimeConfig defines configuration to be applied at runtime for this app.

func (*RuntimeConfig) DeepCopy

func (in *RuntimeConfig) DeepCopy() *RuntimeConfig

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

func (*RuntimeConfig) DeepCopyInto

func (in *RuntimeConfig) DeepCopyInto(out *RuntimeConfig)

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

type RuntimeConfigOption

type RuntimeConfigOption struct {
	// Name of the config option.
	Name string `json:"name"`

	// Value is the static value to bind to the variable.
	//
	// +optional
	Value string `json:"value,omitempty"`

	// ValueFrom is a reference to dynamically bind the variable to.
	//
	// +optional
	ValueFrom *RuntimeConfigVarSource `json:"valueFrom,omitempty"`
}

func (*RuntimeConfigOption) DeepCopy

func (in *RuntimeConfigOption) DeepCopy() *RuntimeConfigOption

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

func (*RuntimeConfigOption) DeepCopyInto

func (in *RuntimeConfigOption) DeepCopyInto(out *RuntimeConfigOption)

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

type RuntimeConfigVarSource

type RuntimeConfigVarSource struct {
	// Selects a key of a ConfigMap.
	// +optional
	ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`

	// Selects a key of a secret in the apps namespace
	// +optional
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

func (*RuntimeConfigVarSource) DeepCopy

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

func (*RuntimeConfigVarSource) DeepCopyInto

func (in *RuntimeConfigVarSource) DeepCopyInto(out *RuntimeConfigVarSource)

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

type SpinApp

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

	Spec   SpinAppSpec   `json:"spec,omitempty"`
	Status SpinAppStatus `json:"status,omitempty"`
}

SpinApp is the Schema for the spinapps API

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:JSONPath=".status.readyReplicas",name=Ready,type=integer +kubebuilder:printcolumn:JSONPath=".spec.replicas",name=Desired,type=integer +kubebuilder:printcolumn:JSONPath=".spec.executor",name=Executor,type=string

func (*SpinApp) DeepCopy

func (in *SpinApp) DeepCopy() *SpinApp

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

func (*SpinApp) DeepCopyInto

func (in *SpinApp) DeepCopyInto(out *SpinApp)

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

func (*SpinApp) DeepCopyObject

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

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

type SpinAppExecutor

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

	Spec   SpinAppExecutorSpec   `json:"spec,omitempty"`
	Status SpinAppExecutorStatus `json:"status,omitempty"`
}

SpinAppExecutor is the Schema for the spinappexecutors API

func (*SpinAppExecutor) DeepCopy

func (in *SpinAppExecutor) DeepCopy() *SpinAppExecutor

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

func (*SpinAppExecutor) DeepCopyInto

func (in *SpinAppExecutor) DeepCopyInto(out *SpinAppExecutor)

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

func (*SpinAppExecutor) DeepCopyObject

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

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

type SpinAppExecutorList

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

SpinAppExecutorList contains a list of SpinAppExecutor

func (*SpinAppExecutorList) DeepCopy

func (in *SpinAppExecutorList) DeepCopy() *SpinAppExecutorList

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

func (*SpinAppExecutorList) DeepCopyInto

func (in *SpinAppExecutorList) DeepCopyInto(out *SpinAppExecutorList)

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

func (*SpinAppExecutorList) DeepCopyObject

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

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

type SpinAppExecutorSpec

type SpinAppExecutorSpec struct {
	// CreateDeployment specifies whether the Executor wants the SpinKube operator
	// to create a deployment for the application or if it will be realized externally.
	CreateDeployment bool `json:"createDeployment"`

	// DeploymentConfig specifies how the deployment should be configured when
	// createDeployment is true.
	DeploymentConfig *ExecutorDeploymentConfig `json:"deploymentConfig,omitempty"`
}

SpinAppExecutorSpec defines the desired state of SpinAppExecutor

func (*SpinAppExecutorSpec) DeepCopy

func (in *SpinAppExecutorSpec) DeepCopy() *SpinAppExecutorSpec

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

func (*SpinAppExecutorSpec) DeepCopyInto

func (in *SpinAppExecutorSpec) DeepCopyInto(out *SpinAppExecutorSpec)

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

type SpinAppExecutorStatus

type SpinAppExecutorStatus struct {
}

SpinAppExecutorStatus defines the observed state of SpinAppExecutor

func (*SpinAppExecutorStatus) DeepCopy

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

func (*SpinAppExecutorStatus) DeepCopyInto

func (in *SpinAppExecutorStatus) DeepCopyInto(out *SpinAppExecutorStatus)

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

type SpinAppList

type SpinAppList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []SpinApp `json:"items"`
}

SpinAppList contains a list of SpinApp

+kubebuilder:object:root=true

func (*SpinAppList) DeepCopy

func (in *SpinAppList) DeepCopy() *SpinAppList

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

func (*SpinAppList) DeepCopyInto

func (in *SpinAppList) DeepCopyInto(out *SpinAppList)

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

func (*SpinAppList) DeepCopyObject

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

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

type SpinAppSpec

type SpinAppSpec struct {
	// Executor controls how this app is executed in the cluster.
	//
	// Defaults to whatever executor is available on the cluster. If multiple
	// executors are available then the first executor in alphabetical order
	// will be chosen. If no executors are available then no default will be set.
	Executor string `json:"executor"`

	// Image is the source for this app.
	//
	// +kubebuilder:validation:Required
	Image string `json:"image"`

	// ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling the image.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// Checks defines health checks that should be used by Kubernetes to monitor the application.
	Checks HealthChecks `json:"checks,omitempty"`

	// Number of replicas to run.
	Replicas int32 `json:"replicas,omitempty"`

	// EnableAutoscaling indicates whether the app is allowed to autoscale. If
	// true then the operator leaves the replica count of the underlying
	// deployment to be managed by an external autoscaler (HPA/KEDA). Replicas
	// cannot be defined if this is enabled. By default EnableAutoscaling is false.
	//
	// +kubebuilder:default:=false
	EnableAutoscaling bool `json:"enableAutoscaling,omitempty"`

	// RuntimeConfig defines configuration to be applied at runtime for this app.
	RuntimeConfig RuntimeConfig `json:"runtimeConfig,omitempty"`

	// Volumes defines the volumes to be mounted in the underlying pods.
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// VolumeMounts defines how volumes are mounted in the underlying containers.
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	// Variables provide Kubernetes Bindings to Spin App Variables.
	Variables []SpinVar `json:"variables,omitempty"`

	// ServiceAnnotations defines annotations to be applied to the underlying service.
	ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`

	// DeploymentAnnotations defines annotations to be applied to the underlying deployment.
	DeploymentAnnotations map[string]string `json:"deploymentAnnotations,omitempty"`

	// PodAnnotations defines annotations to be applied to the underlying pods.
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// Resources defines the resource requirements for this app.
	Resources Resources `json:"resources,omitempty"`
}

SpinAppSpec defines the desired state of SpinApp

+kubebuilder:validation:Optional

func (*SpinAppSpec) DeepCopy

func (in *SpinAppSpec) DeepCopy() *SpinAppSpec

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

func (*SpinAppSpec) DeepCopyInto

func (in *SpinAppSpec) DeepCopyInto(out *SpinAppSpec)

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

type SpinAppStatus

type SpinAppStatus struct {
	// Represents the observations of a SpinApps's current state.
	// SpinApp.status.conditions.type are: "Available" and "Progressing"
	// SpinApp.status.conditions.status are one of True, False, Unknown.
	// SpinApp.status.conditions.reason the value should be a CamelCase string and producers of specific
	// condition types may define expected values and meanings for this field, and whether the values
	// are considered a guaranteed API.
	// SpinApp.status.conditions.Message is a human readable message indicating details about the transition.
	// For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`

	// ActiveScheduler is the name of the scheduler that is currently scheduling this SpinApp.
	ActiveScheduler string `json:"activeScheduler,omitempty"`

	// Represents the current number of active replicas on the application deployment.
	ReadyReplicas int32 `json:"readyReplicas"`
}

SpinAppStatus defines the observed state of SpinApp

func (*SpinAppStatus) DeepCopy

func (in *SpinAppStatus) DeepCopy() *SpinAppStatus

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

func (*SpinAppStatus) DeepCopyInto

func (in *SpinAppStatus) DeepCopyInto(out *SpinAppStatus)

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

type SpinVar

type SpinVar struct {
	// Name of the variable to bind.
	Name string `json:"name"`

	// Value is the static value to bind to the variable.
	//
	// +optional
	Value string `json:"value,omitempty"`

	// ValueFrom is a reference to dynamically bind the variable to.
	//
	// +optional
	ValueFrom *corev1.EnvVarSource `json:"valueFrom,omitempty"`
}

SpinVar defines a binding between a spin variable and a static or dynamic value.

func (*SpinVar) DeepCopy

func (in *SpinVar) DeepCopy() *SpinVar

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

func (*SpinVar) DeepCopyInto

func (in *SpinVar) DeepCopyInto(out *SpinVar)

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

type SqliteDatabaseConfig

type SqliteDatabaseConfig struct {
	Name    string                `json:"name"`
	Type    string                `json:"type"`
	Options []RuntimeConfigOption `json:"options,omitempty"`
}

func (*SqliteDatabaseConfig) DeepCopy

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

func (*SqliteDatabaseConfig) DeepCopyInto

func (in *SqliteDatabaseConfig) DeepCopyInto(out *SqliteDatabaseConfig)

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