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 ¶
const ( ClusterMigrationModeRead = "read" ClusterMigrationModeWrite = "write" ClusterMigrationModeAutoupgrade = "autoUpgrade" )
const ( ComponentMigrationHelm = "helm" ComponentMigrationYaml = "yaml" )
Variables ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APISpec.
func (*APISpec) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (*Cluster) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Cluster) DeepCopyObject ¶
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"`
}
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"`
}
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Component.
func (*Component) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Component) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
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;""
//+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"`
}
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"`
}
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.