Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package v1alpha1 contains API Schema definitions for the stories v1alpha1 API group. +kubebuilder:object:generate=true +groupName=bubustack.io
Index ¶
- Variables
 - type Engram
 - type EngramList
 - type EngramSpec
 - type EngramStatus
 - type ExecutionOverrides
 - type ExecutionPolicy
 - type Impulse
 - type ImpulseList
 - type ImpulseSpec
 - type ImpulseStatus
 - type JobPolicy
 - type JobWorkloadConfig
 - type ProbeOverrides
 - type ResourceLimits
 - type ResourcePolicy
 - type ResourceRequests
 - type RetryPolicy
 - type RollingUpdateConfig
 - type S3Authentication
 - type S3StorageProvider
 - type SecurityPolicy
 - type ServiceExposure
 - type StatefulSetWorkloadConfig
 - type Step
 - type StoragePolicy
 - type Story
 - type StoryList
 - type StoryPolicy
 - type StoryRetries
 - type StorySpec
 - type StoryStatus
 - type StoryTimeouts
 - type UpdateStrategy
 - type WorkloadResources
 - type WorkloadSecurity
 - type WorkloadSpec
 
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects. GroupVersion = schema.GroupVersion{Group: "bubustack.io", 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 Engram ¶
type Engram struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec   EngramSpec   `json:"spec,omitempty"`
	Status EngramStatus `json:"status,omitempty"`
}
    +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,shortName=engram,categories={bubu,ai} +kubebuilder:printcolumn:name="Template",type=string,JSONPath=".spec.templateRef.name" +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=".spec.mode" +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=".metadata.creationTimestamp"
func (*Engram) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Engram.
func (*Engram) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Engram) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type EngramList ¶
type EngramList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Engram `json:"items"`
}
    +kubebuilder:object:root=true
func (*EngramList) DeepCopy ¶
func (in *EngramList) DeepCopy() *EngramList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EngramList.
func (*EngramList) DeepCopyInto ¶
func (in *EngramList) DeepCopyInto(out *EngramList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*EngramList) DeepCopyObject ¶
func (in *EngramList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type EngramSpec ¶
type EngramSpec struct {
	// Which template to use for this engram instance
	// This connects the specific configuration below to a reusable component
	// +kubebuilder:validation:Required
	TemplateRef refs.EngramTemplateReference `json:"templateRef"`
	// Mode specifies how the Engram should be run.
	// Supported values are "job", "deployment", "statefulset".
	// If not specified, it defaults to the template's supported mode or "job".
	// +kubebuilder:validation:Enum=job;deployment;statefulset
	Mode enums.WorkloadMode `json:"mode,omitempty"`
	// How to configure this specific engram instance
	// This data gets validated against the EngramTemplate's configSchema
	// +kubebuilder:pruning:PreserveUnknownFields
	With *runtime.RawExtension `json:"with,omitempty"`
	// Secrets maps template secret definitions to actual Kubernetes secrets.
	Secrets map[string]string `json:"secrets,omitempty"`
	// ExecutionPolicy defines the execution configuration for this Engram.
	// These settings override any defaults from the EngramTemplate.
	// +optional
	ExecutionPolicy *ExecutionPolicy `json:"executionPolicy,omitempty"`
	// Overrides allows for fine-tuning of execution behavior.
	Overrides *ExecutionOverrides `json:"overrides,omitempty"`
}
    EngramSpec defines the configuration and behavior of a specific engram instance
func (*EngramSpec) DeepCopy ¶
func (in *EngramSpec) DeepCopy() *EngramSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EngramSpec.
func (*EngramSpec) DeepCopyInto ¶
func (in *EngramSpec) DeepCopyInto(out *EngramSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EngramStatus ¶
type EngramStatus struct {
	// ObservedGeneration is the most recent generation observed for this Engram.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// This will indicate if the Engram's syntax is valid and its template is resolved.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Current workload status - what's actually running.
	// These fields are ONLY populated for Engrams running as a Deployment or StatefulSet.
	// For job-based engrams, these will be empty.
	Replicas      int32       `json:"replicas,omitempty"`      // How many pods are currently running
	ReadyReplicas int32       `json:"readyReplicas,omitempty"` // How many pods are actually ready to serve traffic
	Phase         enums.Phase `json:"phase,omitempty"`         // Overall state: Pending, Running, Succeeded, Failed
	// Additional useful information for debugging and monitoring
	LastExecutionTime *metav1.Time `json:"lastExecutionTime,omitempty"` // When did this last run (for jobs)
	TotalExecutions   int32        `json:"totalExecutions,omitempty"`   // How many times has this run
	FailedExecutions  int32        `json:"failedExecutions,omitempty"`  // How many executions failed
}
    EngramStatus defines the observed state of Engram
func (*EngramStatus) DeepCopy ¶
func (in *EngramStatus) DeepCopy() *EngramStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EngramStatus.
func (*EngramStatus) DeepCopyInto ¶
func (in *EngramStatus) DeepCopyInto(out *EngramStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExecutionOverrides ¶
type ExecutionOverrides struct {
	// Timeout for execution
	Timeout *string `json:"timeout,omitempty"`
	// Retry policy override
	Retry *RetryPolicy `json:"retry,omitempty"`
	// Security context override
	Security *WorkloadSecurity `json:"security,omitempty"`
	// Image pull policy override
	ImagePullPolicy *string `json:"imagePullPolicy,omitempty"`
	// ServiceAccount to use for the workload.
	// +optional
	ServiceAccountName *string `json:"serviceAccountName,omitempty"`
	// AutomountServiceAccountToken controls whether a service account token should be automatically mounted.
	// Defaults to false.
	// +optional
	AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
	// Probe overrides allow disabling template-defined probes at instance level
	// Note: You can only disable probes, not redefine them
	// +optional
	Probes *ProbeOverrides `json:"probes,omitempty"`
}
    ExecutionOverrides allows overriding template/policy defaults at instance level
func (*ExecutionOverrides) DeepCopy ¶
func (in *ExecutionOverrides) DeepCopy() *ExecutionOverrides
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionOverrides.
func (*ExecutionOverrides) DeepCopyInto ¶
func (in *ExecutionOverrides) DeepCopyInto(out *ExecutionOverrides)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExecutionPolicy ¶
type ExecutionPolicy struct {
	// Resource configuration (actual values, not defaults)
	Resources *ResourcePolicy `json:"resources,omitempty"`
	// Security configuration
	Security *SecurityPolicy `json:"security,omitempty"`
	// Job configuration
	Job *JobPolicy `json:"job,omitempty"`
	// Retry configuration
	Retry *RetryPolicy `json:"retry,omitempty"`
	// Timeout configuration
	Timeout *string `json:"timeout,omitempty"`
	// ServiceAccount to use for workloads created from this policy.
	// +optional
	ServiceAccountName *string `json:"serviceAccountName,omitempty"`
}
    ExecutionPolicy defines execution configuration with hierarchical resolution: Controller defaults -> Template -> Engram/Impulse -> Namespace -> Story -> Step -> StepRun
func (*ExecutionPolicy) DeepCopy ¶
func (in *ExecutionPolicy) DeepCopy() *ExecutionPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionPolicy.
func (*ExecutionPolicy) DeepCopyInto ¶
func (in *ExecutionPolicy) DeepCopyInto(out *ExecutionPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Impulse ¶
type Impulse struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec   ImpulseSpec   `json:"spec,omitempty"`
	Status ImpulseStatus `json:"status,omitempty"`
}
    Impulse represents a trigger that launches Stories when events occur
Think of Impulses as the "event handlers" of your story system: - GitHub webhook → trigger CI/CD Story - File upload → trigger data processing Story - Schedule/timer → trigger backup Story - Queue message → trigger order processing Story - Slack mention → trigger support Story
Impulses are always-on services that listen for events and launch stories ¶
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,shortName=imp,categories={bubu,ai} +kubebuilder:printcolumn:name="Template",type=string,JSONPath=.spec.templateRef +kubebuilder:printcolumn:name="Story",type=string,JSONPath=.spec.storyRef.name +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=.status.phase +kubebuilder:printcolumn:name="Triggers",type=integer,JSONPath=.status.triggersReceived +kubebuilder:printcolumn:name="Age",type=date,JSONPath=.metadata.creationTimestamp +kubebuilder:rbac:groups=runs.bubustack.io,resources=stepruns,verbs=get;list;watch;patch
func (*Impulse) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Impulse.
func (*Impulse) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Impulse) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ImpulseList ¶
type ImpulseList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Impulse `json:"items"`
}
    +kubebuilder:object:root=true
func (*ImpulseList) DeepCopy ¶
func (in *ImpulseList) DeepCopy() *ImpulseList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImpulseList.
func (*ImpulseList) DeepCopyInto ¶
func (in *ImpulseList) DeepCopyInto(out *ImpulseList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ImpulseList) DeepCopyObject ¶
func (in *ImpulseList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ImpulseSpec ¶
type ImpulseSpec struct {
	// Which template to use for handling events
	// Examples: "github-webhook", "slack-handler", "file-watcher", "cron-scheduler"
	// +kubebuilder:validation:Required
	TemplateRef refs.ImpulseTemplateReference `json:"templateRef"`
	// Which Story to launch when an event is received
	// This is the story that will run in response to the trigger
	// +kubebuilder:validation:Required
	StoryRef refs.StoryReference `json:"storyRef"`
	// How to configure this specific trigger instance
	// Examples:
	// - Webhook: {"port": 8080, "path": "/webhook"}
	// - File watcher: {"bucket": "my-bucket", "prefix": "uploads/"}
	// - Scheduler: {"schedule": "0 2 * * *", "timezone": "UTC"}
	// +kubebuilder:pruning:PreserveUnknownFields
	With *runtime.RawExtension `json:"with,omitempty"`
	// Secrets configuration for this impulse instance
	// Maps template secret definitions to actual Kubernetes secrets
	// Example: {"authToken": "webhook-secret", "apiKey": "external-service-key"}
	Secrets map[string]string `json:"secrets,omitempty"`
	// How to transform the trigger event into Story inputs
	// You have complete freedom here - map any event data to any Story input
	// Examples:
	// - GitHub: {"repo": "{{ event.repository.name }}", "branch": "{{ event.ref }}"}
	// - File: {"filename": "{{ event.object.key }}", "size": "{{ event.object.size }}"}
	// +kubebuilder:pruning:PreserveUnknownFields
	Mapping *runtime.RawExtension `json:"mapping,omitempty"`
	// How to run this impulse (deployment or statefulset only - must be always-on)
	// Impulses can't be jobs because they need to continuously listen for events
	Workload *WorkloadSpec `json:"workload,omitempty"`
	// Service controls instance-level exposure of the impulse via a Service.
	// Ports and health come from the template; this sets type/labels/annotations.
	// If omitted, defaults to ClusterIP with template-defined ports.
	Service *ServiceExposure `json:"service,omitempty"`
	// Fine-tune execution behavior for special cases
	Execution *ExecutionOverrides `json:"execution,omitempty"`
}
    ImpulseSpec defines how to set up an event trigger that launches Stories
The flow is: External Event → Impulse (processes event) → Story (runs story) For example: GitHub push → webhook impulse → CI/CD story
func (*ImpulseSpec) DeepCopy ¶
func (in *ImpulseSpec) DeepCopy() *ImpulseSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImpulseSpec.
func (*ImpulseSpec) DeepCopyInto ¶
func (in *ImpulseSpec) DeepCopyInto(out *ImpulseSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ImpulseStatus ¶
type ImpulseStatus struct {
	// observedGeneration is the most recent generation observed for this Impulse. It corresponds to the
	// Impulse's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Standard Kubernetes conditions (Ready, Available, etc.)
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Current workload status - how many trigger instances are running (managed by KEDA/HPA)
	Replicas      int32       `json:"replicas,omitempty"`      // How many trigger pods are currently running
	ReadyReplicas int32       `json:"readyReplicas,omitempty"` // How many trigger pods are ready to receive events
	Phase         enums.Phase `json:"phase,omitempty"`         // Overall state: Pending, Running, Failed
	// Event processing statistics - useful for monitoring and debugging
	TriggersReceived int64        `json:"triggersReceived,omitempty"` // Total events received since creation
	StoriesLaunched  int64        `json:"storiesLaunched,omitempty"`  // Total Stories successfully triggered
	FailedTriggers   int64        `json:"failedTriggers,omitempty"`   // Events that failed to trigger Stories
	LastTrigger      *metav1.Time `json:"lastTrigger,omitempty"`      // When did we last receive an event
	LastSuccess      *metav1.Time `json:"lastSuccess,omitempty"`      // When did we last successfully trigger a Story
}
    ImpulseStatus shows the current state and activity of this trigger
func (*ImpulseStatus) DeepCopy ¶
func (in *ImpulseStatus) DeepCopy() *ImpulseStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImpulseStatus.
func (*ImpulseStatus) DeepCopyInto ¶
func (in *ImpulseStatus) DeepCopyInto(out *ImpulseStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobPolicy ¶
type JobPolicy struct {
	// Backoff limit for jobs
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`
	// TTL for job cleanup
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
	// Restart policy
	RestartPolicy *string `json:"restartPolicy,omitempty"`
}
    func (*JobPolicy) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobPolicy.
func (*JobPolicy) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobWorkloadConfig ¶
type JobWorkloadConfig struct {
	// Number of pods to run in parallel
	Parallelism *int32 `json:"parallelism,omitempty"`
	// Number of successful completions needed
	Completions *int32 `json:"completions,omitempty"`
	// Number of retries before marking as failed
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`
	// Time after which job is considered failed
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
	// TTL for cleanup after completion
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
}
    JobWorkloadConfig contains job-specific settings
func (*JobWorkloadConfig) DeepCopy ¶
func (in *JobWorkloadConfig) DeepCopy() *JobWorkloadConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobWorkloadConfig.
func (*JobWorkloadConfig) DeepCopyInto ¶
func (in *JobWorkloadConfig) DeepCopyInto(out *JobWorkloadConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProbeOverrides ¶
type ProbeOverrides struct {
	// DisableLiveness disables the liveness probe
	// +optional
	DisableLiveness bool `json:"disableLiveness,omitempty"`
	// DisableReadiness disables the readiness probe
	// +optional
	DisableReadiness bool `json:"disableReadiness,omitempty"`
	// DisableStartup disables the startup probe
	// +optional
	DisableStartup bool `json:"disableStartup,omitempty"`
}
    ProbeOverrides allows disabling specific probes at instance level All fields default to false (probes enabled). Set to true to disable.
func (*ProbeOverrides) DeepCopy ¶
func (in *ProbeOverrides) DeepCopy() *ProbeOverrides
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeOverrides.
func (*ProbeOverrides) DeepCopyInto ¶
func (in *ProbeOverrides) DeepCopyInto(out *ProbeOverrides)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceLimits ¶
type ResourceLimits struct {
	CPU              *string `json:"cpu,omitempty"`              // e.g., "1000m", "2"
	Memory           *string `json:"memory,omitempty"`           // e.g., "1Gi", "4Gi"
	EphemeralStorage *string `json:"ephemeralStorage,omitempty"` // e.g., "5Gi"
}
    ResourceLimits defines maximum allowed resources
func (*ResourceLimits) DeepCopy ¶
func (in *ResourceLimits) DeepCopy() *ResourceLimits
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceLimits.
func (*ResourceLimits) DeepCopyInto ¶
func (in *ResourceLimits) DeepCopyInto(out *ResourceLimits)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePolicy ¶
type ResourcePolicy struct {
	// CPU request
	CPURequest *string `json:"cpuRequest,omitempty"`
	// Memory request
	MemoryRequest *string `json:"memoryRequest,omitempty"`
	// CPU limit
	CPULimit *string `json:"cpuLimit,omitempty"`
	// Memory limit
	MemoryLimit *string `json:"memoryLimit,omitempty"`
}
    func (*ResourcePolicy) DeepCopy ¶
func (in *ResourcePolicy) DeepCopy() *ResourcePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicy.
func (*ResourcePolicy) DeepCopyInto ¶
func (in *ResourcePolicy) DeepCopyInto(out *ResourcePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceRequests ¶
type ResourceRequests struct {
	CPU              *string `json:"cpu,omitempty"`              // e.g., "100m", "0.5"
	Memory           *string `json:"memory,omitempty"`           // e.g., "128Mi", "1Gi"
	EphemeralStorage *string `json:"ephemeralStorage,omitempty"` // e.g., "1Gi"
}
    ResourceRequests defines minimum required resources
func (*ResourceRequests) DeepCopy ¶
func (in *ResourceRequests) DeepCopy() *ResourceRequests
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequests.
func (*ResourceRequests) DeepCopyInto ¶
func (in *ResourceRequests) DeepCopyInto(out *ResourceRequests)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RetryPolicy ¶
type RetryPolicy struct {
	// Maximum number of retry attempts
	// +kubebuilder:default=3
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=10
	MaxRetries *int32 `json:"maxRetries,omitempty"`
	// Base delay between retries
	// Examples: "1s", "5s", "30s"
	// +kubebuilder:default="1s"
	Delay *string `json:"delay,omitempty"`
	// Backoff strategy for retry delays
	// - exponential: 1s, 2s, 4s, 8s... (doubles each time)
	// - linear: 1s, 2s, 3s, 4s... (increases by delay each time)
	// - constant: 1s, 1s, 1s, 1s... (same delay each time)
	Backoff *enums.BackoffStrategy `json:"backoff,omitempty"`
}
    RetryPolicy defines retry behavior for steps and execution
func (*RetryPolicy) DeepCopy ¶
func (in *RetryPolicy) DeepCopy() *RetryPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryPolicy.
func (*RetryPolicy) DeepCopyInto ¶
func (in *RetryPolicy) DeepCopyInto(out *RetryPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RollingUpdateConfig ¶
type RollingUpdateConfig struct {
	// Can be absolute number (ex: 5) or percentage (ex: 25%)
	MaxUnavailable *string `json:"maxUnavailable,omitempty"`
	// Maximum number of pods that can be created above desired replicas during update
	// Only for Deployment (not StatefulSet)
	MaxSurge *string `json:"maxSurge,omitempty"`
}
    RollingUpdateConfig contains rolling update parameters
func (*RollingUpdateConfig) DeepCopy ¶
func (in *RollingUpdateConfig) DeepCopy() *RollingUpdateConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdateConfig.
func (*RollingUpdateConfig) DeepCopyInto ¶
func (in *RollingUpdateConfig) DeepCopyInto(out *RollingUpdateConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type S3Authentication ¶
type S3Authentication struct {
	// ServiceAccountAnnotations allows specifying annotations to be added to the
	// auto-generated ServiceAccount. This is the recommended approach for
	// IAM-based authentication on cloud providers (e.g., IRSA on EKS).
	// The key-value pairs will be added to the ServiceAccount's metadata.annotations.
	// +optional
	ServiceAccountAnnotations map[string]string `json:"serviceAccountAnnotations,omitempty"`
	// SecretRef references a Kubernetes Secret that contains the credentials.
	// The secret must contain keys 'accessKeyID' and 'secretAccessKey'.
	// +optional
	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}
    S3Authentication defines the authentication method for S3. Only one of the fields should be set.
func (*S3Authentication) DeepCopy ¶
func (in *S3Authentication) DeepCopy() *S3Authentication
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Authentication.
func (*S3Authentication) DeepCopyInto ¶
func (in *S3Authentication) DeepCopyInto(out *S3Authentication)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type S3StorageProvider ¶
type S3StorageProvider struct {
	// Bucket is the name of the S3 bucket.
	// +kubebuilder:validation:Required
	Bucket string `json:"bucket"`
	// Region is the AWS region of the bucket.
	// +optional
	Region string `json:"region,omitempty"`
	// Endpoint is the S3 endpoint URL. Useful for S3-compatible stores like MinIO.
	// +optional
	Endpoint string `json:"endpoint,omitempty"`
	// Authentication configures how the workload authenticates with S3.
	// +kubebuilder:validation:Required
	Authentication S3Authentication `json:"authentication"`
}
    S3StorageProvider configures access to an S3 or S3-compatible object store.
func (*S3StorageProvider) DeepCopy ¶
func (in *S3StorageProvider) DeepCopy() *S3StorageProvider
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3StorageProvider.
func (*S3StorageProvider) DeepCopyInto ¶
func (in *S3StorageProvider) DeepCopyInto(out *S3StorageProvider)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecurityPolicy ¶
type SecurityPolicy struct {
	// Whether to run as non-root user
	RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
	// Whether to allow privilege escalation
	AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
	// Read-only root filesystem
	ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"`
	// User ID to run as
	RunAsUser *int64 `json:"runAsUser,omitempty"`
}
    func (*SecurityPolicy) DeepCopy ¶
func (in *SecurityPolicy) DeepCopy() *SecurityPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityPolicy.
func (*SecurityPolicy) DeepCopyInto ¶
func (in *SecurityPolicy) DeepCopyInto(out *SecurityPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceExposure ¶
type ServiceExposure struct {
	// Type of Service to create (ClusterIP default, NodePort, LoadBalancer)
	Type string `json:"type,omitempty"`
	// Additional labels to attach to the Service
	Labels map[string]string `json:"labels,omitempty"`
	// Additional annotations to attach to the Service
	Annotations map[string]string `json:"annotations,omitempty"`
}
    ServiceExposure defines instance-level Service settings for exposing a workload Intended to be used by Impulse/Engram specs to choose exposure mode and metadata. Ports and health checks come from the template; this controls only exposure knobs.
func (*ServiceExposure) DeepCopy ¶
func (in *ServiceExposure) DeepCopy() *ServiceExposure
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExposure.
func (*ServiceExposure) DeepCopyInto ¶
func (in *ServiceExposure) DeepCopyInto(out *ServiceExposure)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StatefulSetWorkloadConfig ¶
type StatefulSetWorkloadConfig struct {
	// Service name for StatefulSet
	ServiceName string `json:"serviceName"`
	// Pod management policy
	PodManagementPolicy *string `json:"podManagementPolicy,omitempty"`
}
    StatefulSetWorkloadConfig contains statefulset-specific settings Note: For storage, we use controller-managed PVs instead of VolumeClaimTemplates This ensures RWX compatibility and single PV per StoryRun
func (*StatefulSetWorkloadConfig) DeepCopy ¶
func (in *StatefulSetWorkloadConfig) DeepCopy() *StatefulSetWorkloadConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetWorkloadConfig.
func (*StatefulSetWorkloadConfig) DeepCopyInto ¶
func (in *StatefulSetWorkloadConfig) DeepCopyInto(out *StatefulSetWorkloadConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Step ¶
type Step struct {
	// Name is a human-readable identifier for the step.
	// It's used to reference this step's outputs in other steps.
	// e.g., '{{ steps.my-step-name.outputs.some_field }}'
	// +kubebuilder:validation: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"`
	// ID is an optional, unique identifier for a step instance.
	// While 'name' identifies the step in logs and outputs, 'id' can be used
	// programmatically to reference a specific node in the workflow graph.
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
	// +optional
	ID string `json:"id,omitempty"`
	// Needs explicitly defines a list of step names that must be completed before this step can run.
	// This is used to create an execution order for steps that don't have an implicit data dependency.
	// +optional
	Needs []string `json:"needs,omitempty"`
	// Type determines the kind of operation this step performs.
	// Use built-in types for common patterns. If omitted and 'ref' is present, the step is an 'engram' step.
	//
	// Built-in primitive types:
	// - condition: if/then/else logic
	// - loop: iterate over arrays or repeat N times
	// - parallel: run multiple steps simultaneously
	// - sleep: wait for a specified duration
	// - stop: halt story execution (success or failure)
	// - switch: multi-way branching like switch/case
	// - filter: filter arrays or objects based on conditions
	// - transform: modify data structure or format
	// - executeStory: run another story as a sub-story
	// - setData: set variables or update context
	// - mergeData: combine data from multiple sources
	// - wait: wait for external conditions
	// - throttle: rate limiting
	// - batch: group operations
	// - gate: wait for a manual approval
	// +optional
	Type enums.StepType `json:"type,omitempty"`
	// If provides a condition for executing this step.
	// The step is only executed if the CEL expression evaluates to true.
	// +optional
	If *string `json:"if,omitempty"`
	// Ref points to an Engram to execute.
	// This is a shortcut for a step of type 'engram'.
	// If 'ref' is used, 'type' should be omitted.
	// +optional
	Ref *refs.EngramReference `json:"ref,omitempty"`
	// With provides the configuration for the step. The expected structure of this block
	// is determined by the step 'type'. For example:
	// - for 'engram': the inputs to the engram.
	// - for 'executeStory': contains 'storyRef', 'waitForCompletion', and 'with'.
	// - for 'loop': contains 'items' and 'template'.
	// The structure is validated at runtime by the controller.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	With *runtime.RawExtension `json:"with,omitempty"`
	// Secrets maps template secret definitions to actual Kubernetes secrets for this step.
	// This is only applicable to 'engram' steps and overrides any secret mappings on the Engram itself.
	// Example: {"apiKey": "openai-credentials", "database": "postgres-creds"}
	// +optional
	Secrets map[string]string `json:"secrets,omitempty"`
	// Override execution settings for this specific step
	// Use sparingly - most configuration should be at the story or engram level
	Execution *ExecutionOverrides `json:"execution,omitempty"`
}
    Step defines a single unit of work within a Story. Steps are the building blocks of stories, defining everything from custom logic to control flow like loops, conditions, and parallel execution.
func (*Step) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step.
func (*Step) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StoragePolicy ¶
type StoragePolicy struct {
	// S3 specifies the configuration for an S3-compatible object store.
	// +optional
	S3 *S3StorageProvider `json:"s3,omitempty"`
}
    StoragePolicy defines the configuration for object storage access.
func (*StoragePolicy) DeepCopy ¶
func (in *StoragePolicy) DeepCopy() *StoragePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoragePolicy.
func (*StoragePolicy) DeepCopyInto ¶
func (in *StoragePolicy) DeepCopyInto(out *StoragePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Story ¶
type Story struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec   StorySpec   `json:"spec,omitempty"`
	Status StoryStatus `json:"status,omitempty"`
}
    Story represents a workflow definition - a sequence of steps that accomplish a business goal
Stories are the main workflows in your system. Think of them like: - GitHub Actions workflows - Jenkins pipelines - Zapier automations - Any business process you want to automate
Stories orchestrate Engrams (the workers) to create powerful workflows: - CI/CD pipeline: checkout → test → build → deploy - Data processing: extract → transform → load → notify - E-commerce: validate order → charge payment → ship → update inventory - Content moderation: analyze → classify → approve/reject → notify
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,shortName=story,categories={bubu,ai,workflows} +kubebuilder:printcolumn:name="Steps",type=integer,JSONPath=".status.stepsTotal" +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=".metadata.creationTimestamp"
func (*Story) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Story.
func (*Story) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Story) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type StoryList ¶
type StoryList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Story `json:"items"`
}
    +kubebuilder:object:root=true
func (*StoryList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryList.
func (*StoryList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*StoryList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type StoryPolicy ¶
type StoryPolicy struct {
	// Timeouts
	Timeouts *StoryTimeouts `json:"timeouts,omitempty"`
	// With provides the inputs for the sub-story, mirroring the 'with' field in an Engram step.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	With *runtime.RawExtension `json:"with,omitempty"`
	// Retry behavior
	Retries *StoryRetries `json:"retries,omitempty"`
	// Concurrency limits
	Concurrency *int32 `json:"concurrency,omitempty"`
	// Storage configuration
	Storage *StoragePolicy `json:"storage,omitempty"`
	// Default execution settings (can be overridden at step level)
	Execution *ExecutionPolicy `json:"execution,omitempty"`
}
    Simplified StoryPolicy focused on essential workflow controls
func (*StoryPolicy) DeepCopy ¶
func (in *StoryPolicy) DeepCopy() *StoryPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryPolicy.
func (*StoryPolicy) DeepCopyInto ¶
func (in *StoryPolicy) DeepCopyInto(out *StoryPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StoryRetries ¶
type StoryRetries struct {
	// Default retry policy for steps
	StepRetryPolicy *RetryPolicy `json:"stepRetryPolicy,omitempty"`
	// Whether to continue story on step failure
	ContinueOnStepFailure *bool `json:"continueOnStepFailure,omitempty"`
}
    func (*StoryRetries) DeepCopy ¶
func (in *StoryRetries) DeepCopy() *StoryRetries
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryRetries.
func (*StoryRetries) DeepCopyInto ¶
func (in *StoryRetries) DeepCopyInto(out *StoryRetries)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StorySpec ¶
type StorySpec struct {
	// Pattern specifies the execution model for the Story.
	// "batch" stories are run to completion via a StoryRun.
	// "streaming" stories create long-running workloads that process data continuously.
	// +kubebuilder:validation:Enum=batch;streaming
	// +kubebuilder:default=batch
	Pattern enums.StoryPattern `json:"pattern,omitempty"`
	// StreamingStrategy defines the deployment strategy for long-running engrams in a streaming story.
	// "PerStory" creates a single, shared set of long-running engrams for the Story.
	// "PerStoryRun" creates a dedicated set of long-running engrams for each StoryRun.
	// This field is only applicable when `pattern` is "streaming".
	// +kubebuilder:validation:Enum=PerStory;PerStoryRun
	// +kubebuilder:default=PerStory
	// +optional
	StreamingStrategy enums.StreamingStrategy `json:"streamingStrategy,omitempty"`
	// InputsSchema defines the schema for the data required to start a StoryRun.
	// +optional
	InputsSchema *runtime.RawExtension `json:"inputsSchema,omitempty"`
	// OutputsSchema defines the schema for the data this Story is expected to produce.
	// +optional
	OutputsSchema *runtime.RawExtension `json:"outputsSchema,omitempty"`
	// Output defines a template for the Story's final output.
	// This CEL expression is evaluated upon successful completion of the story,
	// and the result is stored in the StoryRun's status.output field.
	// It has access to 'inputs' and 'steps' contexts.
	// e.g., {"final_message": "processed " + steps.load_data.outputs.count + " records"}
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Output *runtime.RawExtension `json:"output,omitempty"`
	// The actual workflow steps - this is where the magic happens!
	// Steps run in sequence unless you use parallel/condition logic
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=100
	Steps []Step `json:"steps"`
	// How should this Story behave? (timeouts, retries, storage, etc.)
	Policy *StoryPolicy `json:"policy,omitempty"`
}
    StorySpec defines what the workflow does and how it should run
func (*StorySpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorySpec.
func (*StorySpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StoryStatus ¶
type StoryStatus struct {
	// ObservedGeneration is the most recent generation observed for this Story.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Standard Kubernetes conditions for detailed status tracking (e.g., "Ready", "Validated")
	// This will indicate if the Story's syntax is valid and all referenced Engrams exist.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// StepsTotal reflects the total number of steps defined in the story's specification.
	// This provides a quick way to understand the complexity of the story.
	// +optional
	StepsTotal int32 `json:"stepsTotal,omitempty"`
}
    StoryStatus defines the observed state of a Story.
func (*StoryStatus) DeepCopy ¶
func (in *StoryStatus) DeepCopy() *StoryStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryStatus.
func (*StoryStatus) DeepCopyInto ¶
func (in *StoryStatus) DeepCopyInto(out *StoryStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StoryTimeouts ¶
type StoryTimeouts struct {
	// Total time for the entire story
	Story *string `json:"story,omitempty"`
	// Default timeout for individual steps
	Step *string `json:"step,omitempty"`
}
    func (*StoryTimeouts) DeepCopy ¶
func (in *StoryTimeouts) DeepCopy() *StoryTimeouts
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryTimeouts.
func (*StoryTimeouts) DeepCopyInto ¶
func (in *StoryTimeouts) DeepCopyInto(out *StoryTimeouts)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UpdateStrategy ¶
type UpdateStrategy struct {
	// Type of update strategy
	// - RollingUpdate: Gradually replace old pods with new ones
	// - Recreate: Delete all old pods before creating new ones
	Type *enums.UpdateStrategyType `json:"type,omitempty"`
	// Rolling update configuration (only applies when type=RollingUpdate)
	RollingUpdate *RollingUpdateConfig `json:"rollingUpdate,omitempty"`
}
    UpdateStrategy defines how workload updates should be performed
func (*UpdateStrategy) DeepCopy ¶
func (in *UpdateStrategy) DeepCopy() *UpdateStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStrategy.
func (*UpdateStrategy) DeepCopyInto ¶
func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkloadResources ¶
type WorkloadResources struct {
	// Resource requests and limits
	Requests *ResourceRequests `json:"requests,omitempty"`
	Limits   *ResourceLimits   `json:"limits,omitempty"`
	// Scheduling constraints
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	Tolerations  []string          `json:"tolerations,omitempty"`
}
    WorkloadResources defines resource requirements and constraints
func (*WorkloadResources) DeepCopy ¶
func (in *WorkloadResources) DeepCopy() *WorkloadResources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadResources.
func (*WorkloadResources) DeepCopyInto ¶
func (in *WorkloadResources) DeepCopyInto(out *WorkloadResources)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkloadSecurity ¶
type WorkloadSecurity struct {
	// Whether to run as non-root user
	RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
	// Whether to allow privilege escalation
	AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
	// Read-only root filesystem
	ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"`
	// User ID to run as
	RunAsUser *int64 `json:"runAsUser,omitempty"`
	// Required secrets for this workload
	RequiredSecrets []string `json:"requiredSecrets,omitempty"`
}
    WorkloadSecurity defines security configuration
func (*WorkloadSecurity) DeepCopy ¶
func (in *WorkloadSecurity) DeepCopy() *WorkloadSecurity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSecurity.
func (*WorkloadSecurity) DeepCopyInto ¶
func (in *WorkloadSecurity) DeepCopyInto(out *WorkloadSecurity)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkloadSpec ¶
type WorkloadSpec struct {
	// How to run this workload - the fundamental execution pattern
	// - job: Run once and complete (like a batch script or CI job)
	// - deployment: Always-on stateless service (like a web API or webhook listener)
	// - statefulset: Always-on stateful service (like a database or file processor with persistent storage)
	// +kubebuilder:default="job"
	Mode enums.WorkloadMode `json:"mode,omitempty"`
	// Job-specific settings (only applies when mode=job)
	Job *JobWorkloadConfig `json:"job,omitempty"`
	// StatefulSet-specific settings (only applies when mode=statefulset)
	StatefulSet *StatefulSetWorkloadConfig `json:"statefulSet,omitempty"`
	// Resource requirements (CPU, memory, etc.)
	Resources *WorkloadResources `json:"resources,omitempty"`
	// How to handle updates/upgrades
	UpdateStrategy *UpdateStrategy `json:"updateStrategy,omitempty"`
}
    WorkloadSpec defines HOW to run something in Kubernetes This is where you specify whether it's a one-shot job, always-on service, or stateful application
Note: Replica counts are NOT specified here - they're managed by external autoscaling tools: - Use KEDA for event-driven autoscaling (queue depth, HTTP requests, etc.) - Use HPA for metric-based autoscaling (CPU, memory, custom metrics) - Use VPA for vertical scaling (adjusting resource requests/limits) - Current replica counts are reported in the status section
func (*WorkloadSpec) DeepCopy ¶
func (in *WorkloadSpec) DeepCopy() *WorkloadSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpec.
func (*WorkloadSpec) DeepCopyInto ¶
func (in *WorkloadSpec) DeepCopyInto(out *WorkloadSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.