v1alpha1

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

+kubebuilder:object:root=true +kubebuilder:subresource:status

Package v1alpha1 contains API Schema definitions for the castware v1alpha1 API group. +kubebuilder:object:generate=true +groupName=castware.cast.ai

Index

Constants

View Source
const (
	ClusterMigrationModeRead        = "read"
	ClusterMigrationModeWrite       = "write"
	ClusterMigrationModeAutoupgrade = "autoUpgrade"
)
View Source
const (
	ComponentMigrationHelm      = "helm"
	ComponentMigrationYaml      = "yaml"
	ComponentMigrationTerraform = "terraform"

	LabelHelmChart = "castware.cast.ai/helm-chart"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "castware.cast.ai", 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 APISpec

type APISpec struct {
	// apiUrl is the “base” HTTP URL of the Mothership API.
	// +kubebuilder:validation:Format=uri
	// +kubebuilder:validation:Required
	APIURL string `json:"apiUrl,omitempty"`

	// apiGrpcUrl is the gRPC endpoint for the Mothership API (optional).
	// +optional
	APIGrpcURL string `json:"apiGrpcUrl,omitempty"`

	// grpcUrl is a generic gRPC endpoint for any Mothership service (optional).
	// +optional
	GrpcURL string `json:"grpcUrl,omitempty"`

	// kvisorGrpcUrl is the gRPC endpoint for the Kvisor service (optional).
	// +optional
	KvisorGrpcURL string `json:"kvisorGrpcUrl,omitempty"`
}

APISpec groups HTTP/gRPC endpoints for Mothership and related services. - apiUrl is required (Format=uri). - All others are optional and may be derived by your controller if omitted.

func (*APISpec) DeepCopy

func (in *APISpec) DeepCopy() *APISpec

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

func (*APISpec) DeepCopyInto

func (in *APISpec) DeepCopyInto(out *APISpec)

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

type Cluster

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

	Spec   ClusterSpec   `json:"spec,omitempty"`
	Status ClusterStatus `json:"status,omitempty"`
}

Cluster is the Schema for the clusters API

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

func (*Cluster) DeepCopyObject

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

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

type ClusterList

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

ClusterList contains a list of Cluster

func (*ClusterList) DeepCopy

func (in *ClusterList) DeepCopy() *ClusterList

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

func (*ClusterList) DeepCopyInto

func (in *ClusterList) DeepCopyInto(out *ClusterList)

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

func (*ClusterList) DeepCopyObject

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

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

type ClusterMetadataSpec

type ClusterMetadataSpec struct {
	// ClusterID is the unique UUID of this cluster in the Cast AI database.
	// +kubebuilder:validation:Pattern=`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89ABab][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$`
	// +optional
	ClusterID string `json:"clusterID,omitempty"`

	// ClusterName is a human-readable name for this cluster (optional).
	// +optional
	ClusterName string `json:"clusterName,omitempty"`

	// Location is the region or zone of the cluster (optional).
	// +optional
	Location string `json:"location,omitempty"`

	// ProjectID is the cloud-provider project/subscription/account ID (optional).
	// +optional
	ProjectID string `json:"projectID,omitempty"`
}

ClusterMetadataSpec holds basic cluster metadata. All fields are optional because they will be filled in by the operator only after the agent “checks in.”

func (*ClusterMetadataSpec) DeepCopy

func (in *ClusterMetadataSpec) DeepCopy() *ClusterMetadataSpec

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

func (*ClusterMetadataSpec) DeepCopyInto

func (in *ClusterMetadataSpec) DeepCopyInto(out *ClusterMetadataSpec)

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

type ClusterSpec

type ClusterSpec struct {
	// Provider is the cloud provider where Castware is installed.
	//+optional
	Provider string `json:"provider"`

	// APIKeySecret is the name of the Kubernetes Secret containing the Mothership API key.
	// The operator does not work without it.
	//+kubebuilder:validation:Required
	//+kubebuilder:default:="castware-api-key"
	APIKeySecret string `json:"apiKeySecret"`

	// API holds all the Mothership API endpoints.
	// Only apiUrl is required; the others are derived if omitted.
	// +kubebuilder:validation:Required
	API APISpec `json:"api"`

	// Cluster contains metadata that is populated after the agent registers.
	// All fields here are optional; if missing, the operator will fill them in at runtime.
	// +optional
	Cluster *ClusterMetadataSpec `json:"cluster,omitempty"`

	// HelmRepoURL is the url of the Helm repository containing components charts.
	// +optional
	// +kubebuilder:default:="https://castai.github.io/helm-charts"
	HelmRepoURL string `json:"helmRepoURL"`

	// MigrationMode tells the operator if existing components should be migrated
	// to operator-managed components (write), migrated and upgraded (autoUpgrade)
	// or just detected (read).
	//+kubebuilder:validation:Enum=write;read;autoUpgrade
	//+kubebuilder:default:="write"
	MigrationMode string `json:"migrationMode,omitempty"`

	// Terraform flag indicates if the operator was onboarded through terraform
	// or not. Should be set to true when we onboard it through TF.
	//+optional
	//+kubebuilder:default:=false
	Terraform bool `json:"terraform"`
}

ClusterSpec defines the desired state of Cluster

func (*ClusterSpec) DeepCopy

func (in *ClusterSpec) DeepCopy() *ClusterSpec

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

func (*ClusterSpec) DeepCopyInto

func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)

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

type ClusterStatus

type ClusterStatus struct {
	// Conditions store the status conditions of the Cluster instances
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Conditions        []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
	LastSecretVersion string             `json:"lastSecretVersion,omitempty"`
	// UpgradeJobName is the name of an upgrade operator job
	UpgradeJobName string `json:"upgradeJobName,omitempty"`
	// LastRegistrationVersion is the operator version when the cluster was last registered with castware_install_method=operator.
	// Format is semantic version without 'v' prefix (e.g., "0.0.24").
	// Empty value indicates the cluster has not been registered by the operator yet.
	// +optional
	LastRegistrationVersion string `json:"lastRegistrationVersion,omitempty"`
	// LastReportedHelmRevision is the helm release revision number of the operator that was last reported to Mothership.
	// Used to detect operator helm upgrades (including parameter-only changes without version changes) and report updated parameters.
	// +optional
	LastReportedHelmRevision int `json:"lastReportedHelmRevision,omitempty"`
}

ClusterStatus defines the observed state of Cluster

func (*ClusterStatus) DeepCopy

func (in *ClusterStatus) DeepCopy() *ClusterStatus

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

func (*ClusterStatus) DeepCopyInto

func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)

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

type Component

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

	Spec   ComponentSpec   `json:"spec,omitempty"`
	Status ComponentStatus `json:"status,omitempty"`
}

Component is the Schema for the components API

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.

func (*Component) DeepCopyObject

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

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

func (Component) GenerationChanged added in v0.8.0

func (c Component) GenerationChanged() bool

func (Component) HelmChartName added in v0.0.24

func (c Component) HelmChartName() string

func (Component) IsInitiliazedByTerraform added in v0.0.24

func (c Component) IsInitiliazedByTerraform() bool

func (Component) VersionChanged added in v0.8.0

func (c Component) VersionChanged() bool

type ComponentList

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

ComponentList contains a list of Component

func (*ComponentList) DeepCopy

func (in *ComponentList) DeepCopy() *ComponentList

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

func (*ComponentList) DeepCopyInto

func (in *ComponentList) DeepCopyInto(out *ComponentList)

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

func (*ComponentList) DeepCopyObject

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

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

type ComponentSpec

type ComponentSpec struct {

	// Component is the name of the component represented in this CRD.
	//+kubebuilder:validation:Required
	//+kubebuilder:default:="castai-agent"
	Component string `json:"component"`

	// Cluster is the name of the cluster CRD containing global parameters for this component.
	//+kubebuilder:validation:Required
	//+kubebuilder:default:="castai"
	Cluster string `json:"cluster"`

	// Enabled is set to false if this component should be scaled to zero replicas.
	//+kubebuilder:validation:Required
	Enabled bool `json:"enabled"`

	// Version is the the version of the helm chart that should be installed, if not specified
	// the latest version will be installed and the value will be filled by the operator.
	//+optional
	Version string `json:"version"`

	// Values is a free-form map of Helm values (exactly like a values.yaml block).
	// The operator will pass these to `helm install/upgrade --values`.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Values *apiextensionsv1.JSON `json:"values,omitempty"`

	// Migration tells the operator if there is an existing component to migrate
	// or just a new component to install.
	//+kubebuilder:validation:Enum=yaml;helm;terraform;""
	//+kubebuilder:default:=""
	Migration string `json:"migration,omitempty"`

	// Readonly tells the operator if the component can be modified.
	//+kubebuilder:default:=false
	Readonly bool `json:"readonly,omitempty"`

	// ReleaseName is the helm release name. If empty, defaults to Component name.
	ReleaseName string `json:"releaseName,omitempty"`
}

ComponentSpec defines the desired state of Component

func (*ComponentSpec) DeepCopy

func (in *ComponentSpec) DeepCopy() *ComponentSpec

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

func (*ComponentSpec) DeepCopyInto

func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec)

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

type ComponentStatus

type ComponentStatus struct {
	// Conditions store the status conditions of the Component instances
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Conditions     []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
	CurrentVersion string             `json:"currentVersion,omitempty" protobuf:"string,2,rep,name=currentVersion"`
	// Set it to true if the component should be rolled back to the previous version,
	// the reconcile loop will set it to false when the rollback starts.
	Rollback bool `json:"rollback,omitempty" protobuf:"bool,3,rep,name=rollback"`
	// ObservedGeneration is the most recent generation observed by the controller.
	// It corresponds to the Component's generation, which is updated on mutation by the API Server.
	// Used to detect spec changes (e.g. values) that should trigger a helm upgrade even when the version hasn't changed.
	ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,4,opt,name=observedGeneration"`
	// LastReportedHelmRevision is the helm release revision number that was last reported to Mothership.
	// Used to detect helm upgrades (including parameter-only changes without version changes) and report updated parameters.
	// +optional
	LastReportedHelmRevision int `json:"lastReportedHelmRevision,omitempty"`
}

ComponentStatus defines the observed state of Component

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.

Jump to

Keyboard shortcuts

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