v1alpha1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the agents v1alpha1 API group. +kubebuilder:object:generate=true +groupName=agents.kruise.io

Index

Constants

View Source
const (
	PersistentContentIp         string = "ip"
	PersistentContentMemory     string = "memory"
	PersistentContentFilesystem string = "filesystem"
)
View Source
const (
	SandboxReadyReasonPodReady = "PodReady"

	// SandboxConditionPaused's Reason
	SandboxPausedReasonSetPause  = "SetPause"
	SandboxPausedReasonDeletePod = "DeletePod"

	// SandboxConditionResume's Reason
	SandboxResumeReasonCreatePod = "CreatePod"
	SandboxResumeReasonResumePod = "ResumePod"
)
View Source
const (
	InternalPrefix = "agents.kruise.io/"

	LabelSandboxPool  = InternalPrefix + "sandbox-pool"
	LabelTemplateHash = InternalPrefix + "template-hash"

	AnnotationLock      = InternalPrefix + "lock"
	AnnotationOwner     = InternalPrefix + "owner"
	AnnotationClaimTime = InternalPrefix + "claim-timestamp"
)
View Source
const (
	SandboxStateCreating  = "creating"
	SandboxStateAvailable = "available"
	SandboxStateRunning   = "running"
	SandboxStatePaused    = "paused"
	SandboxStateDead      = "dead"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "agents.kruise.io", Version: "v1alpha1"}

	SchemeGroupVersion = GroupVersion

	// 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
)
View Source
var SandboxSetControllerKind = GroupVersion.WithKind("SandboxSet")

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

Types

type PodInfo

type PodInfo struct {
	// Annotations contains pod important annotations
	Annotations map[string]string `json:"annotations,omitempty"`
	// Labels contains pod important labels
	Labels map[string]string `json:"labels,omitempty"`
	// NodeName indicates in which node this pod is scheduled.
	NodeName string `json:"nodeName,omitempty"`
	// PodIP address allocated to the pod.
	PodIP string `json:"podIP,omitempty"`
}

TODO Some external controllers have specific conditions, whether to keep them

func (*PodInfo) DeepCopy

func (in *PodInfo) DeepCopy() *PodInfo

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

func (*PodInfo) DeepCopyInto

func (in *PodInfo) DeepCopyInto(out *PodInfo)

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

type Sandbox

type Sandbox struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of Sandbox
	// +required
	Spec SandboxSpec `json:"spec"`

	// status defines the observed state of Sandbox
	// +optional
	Status SandboxStatus `json:"status,omitempty,omitzero"`
}

Sandbox is the Schema for the sandboxes API

func (*Sandbox) DeepCopy

func (in *Sandbox) DeepCopy() *Sandbox

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

func (*Sandbox) DeepCopyInto

func (in *Sandbox) DeepCopyInto(out *Sandbox)

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

func (*Sandbox) DeepCopyObject

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

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

type SandboxConditionType

type SandboxConditionType string

SandboxConditionType is a valid value for SandboxCondition.Type

const (
	// SandboxConditionReady means the sandbox is able to service requests and should be added to the
	// load balancing pools of all matching services.
	SandboxConditionReady SandboxConditionType = "Ready"

	// SandboxConditionPaused means all containers of the sandbox have been paused.
	SandboxConditionPaused SandboxConditionType = "SandboxPaused"

	// SandboxConditionResumed means to resume the sandbox.
	SandboxConditionResumed SandboxConditionType = "SandboxResumed"
)

These are built-in conditions of pod. An application may use a custom condition not listed here.

type SandboxList

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

SandboxList contains a list of Sandbox

func (*SandboxList) DeepCopy

func (in *SandboxList) DeepCopy() *SandboxList

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

func (*SandboxList) DeepCopyInto

func (in *SandboxList) DeepCopyInto(out *SandboxList)

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

func (*SandboxList) DeepCopyObject

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

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

type SandboxPhase

type SandboxPhase string

SandboxPhase is a label for the condition of a pod at the current time. +enum

const (
	// SandboxPending means the pod has been accepted by the system, but one or more of the containers
	// has not been started. This includes time before being bound to a node, as well as time spent
	// pulling images onto the host.
	SandboxPending SandboxPhase = "Pending"
	// SandboxRunning means the pod has been bound to a node and all of the containers have been started.
	// At least one container is still running or is in the process of being restarted.
	SandboxRunning SandboxPhase = "Running"
	// SandboxPaused means the sandbox has entered the paused state.
	SandboxPaused SandboxPhase = "Paused"
	// SandboxResuming means the sandbox has entered the resume state
	SandboxResuming SandboxPhase = "Resuming"
	// SandboxSucceeded means that all containers in the pod have voluntarily terminated
	// with a container exit code of 0, and the system is not going to restart any of these containers.
	SandboxSucceeded SandboxPhase = "Succeeded"
	// SandboxFailed means that all containers in the pod have terminated, and at least one container has
	// terminated in a failure (exited with a non-zero exit code or was stopped by the system).
	SandboxFailed SandboxPhase = "Failed"
	// SandboxTerminating means sandbox wil perform cleanup after deletion.
	SandboxTerminating SandboxPhase = "Terminating"
)

These are the valid statuses of pods.

type SandboxSet

type SandboxSet struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of SandboxSet
	// +required
	Spec SandboxSetSpec `json:"spec"`

	// status defines the observed state of SandboxSet
	// +optional
	Status SandboxSetStatus `json:"status,omitempty,omitzero"`
}

SandboxSet is the Schema for the sandboxsets API, which is an advanced workload for managing sandboxes.

func (*SandboxSet) DeepCopy

func (in *SandboxSet) DeepCopy() *SandboxSet

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

func (*SandboxSet) DeepCopyInto

func (in *SandboxSet) DeepCopyInto(out *SandboxSet)

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

func (*SandboxSet) DeepCopyObject

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

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

type SandboxSetList

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

SandboxSetList contains a list of SandboxSet

func (*SandboxSetList) DeepCopy

func (in *SandboxSetList) DeepCopy() *SandboxSetList

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

func (*SandboxSetList) DeepCopyInto

func (in *SandboxSetList) DeepCopyInto(out *SandboxSetList)

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

func (*SandboxSetList) DeepCopyObject

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

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

type SandboxSetSpec

type SandboxSetSpec struct {
	// Replicas is the number of unused sandboxes, including available and creating ones.
	Replicas int32 `json:"replicas"`

	// PersistentContents indicates resume pod with persistent content, Enum: ip, memory, filesystem
	PersistentContents []string `json:"persistentContents,omitempty"`

	// TemplateRef references a SandboxTemplate, which will be used to create the sandbox.
	// +optional
	TemplateRef *SandboxTemplateRef `json:"templateRef,omitempty"`

	// Template describes the pods that will be created.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	// +optional
	Template *v1.PodTemplateSpec `json:"template,omitempty"`
}

SandboxSetSpec defines the desired state of SandboxSet

func (*SandboxSetSpec) DeepCopy

func (in *SandboxSetSpec) DeepCopy() *SandboxSetSpec

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

func (*SandboxSetSpec) DeepCopyInto

func (in *SandboxSetSpec) DeepCopyInto(out *SandboxSetSpec)

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

type SandboxSetStatus

type SandboxSetStatus struct {
	// observedGeneration is the most recent generation observed for this SandboxSet. It corresponds to the
	// SandboxSet's generation, which is updated on mutation by the API Server.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Replicas is the total number of creating, available, running and paused sandboxes.
	Replicas int32 `json:"replicas"`

	// AvailableReplicas is the number of available sandboxes, which are ready to be claimed.
	AvailableReplicas int32 `json:"availableReplicas"`

	// UpdateRevision is the template-hash calculated from `spec.template`.
	UpdateRevision string `json:"updateRevision,omitempty"`

	// conditions represent the current state of the SandboxSet resource.
	// Each condition has a unique type and reflects the status of a specific aspect of the resource.
	// The status of each condition is one of True, False, or Unknown.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Selector is a label query over pods that should match the replica count.
	// This is same as the label selector but in the string format to avoid
	// duplication for CRDs that do not support structural schemas.
	// +optional
	Selector string `json:"selector,omitempty"`
}

SandboxSetStatus defines the observed state of SandboxSet.

func (*SandboxSetStatus) DeepCopy

func (in *SandboxSetStatus) DeepCopy() *SandboxSetStatus

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

func (*SandboxSetStatus) DeepCopyInto

func (in *SandboxSetStatus) DeepCopyInto(out *SandboxSetStatus)

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

type SandboxSpec

type SandboxSpec struct {

	// Paused indicates whether pause the sandbox pod.
	// +optional
	Paused bool `json:"paused,omitempty"`

	// PersistentContents indicates resume pod with persistent content, Enum: ip, memory, filesystem
	PersistentContents []string `json:"persistentContents,omitempty"`

	// ShutdownTime - Absolute time when the sandbox is deleted.
	// If a time in the past is provided, the sandbox will be deleted immediately.
	// +kubebuilder:validation:Format="date-time"
	ShutdownTime *metav1.Time `json:"shutdownTime,omitempty"`

	// TemplateRef references a SandboxTemplate, which will be used to create the sandbox.
	// +optional
	TemplateRef *SandboxTemplateRef `json:"templateRef,omitempty"`

	// Template describes the pods that will be created.
	// Template is mutual exclusive with TemplateRef
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	// +optional
	Template *v1.PodTemplateSpec `json:"template,omitempty"`
}

SandboxSpec defines the desired state of Sandbox

func (*SandboxSpec) DeepCopy

func (in *SandboxSpec) DeepCopy() *SandboxSpec

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

func (*SandboxSpec) DeepCopyInto

func (in *SandboxSpec) DeepCopyInto(out *SandboxSpec)

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

type SandboxStatus

type SandboxStatus struct {

	// observedGeneration is the most recent generation observed for this Sandbox. It corresponds to the
	// Sandbox's generation, which is updated on mutation by the API Server.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Sandbox Phase
	Phase SandboxPhase `json:"phase,omitempty"`

	// message
	Message string `json:"message,omitempty"`

	// conditions represent the current state of the Sandbox resource.
	// Each condition has a unique type and reflects the status of a specific aspect of the resource.
	// The status of each condition is one of True, False, or Unknown.
	// +listType=map
	// +listMapKey=type
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// Pod Info
	PodInfo PodInfo `json:"podInfo,omitempty"`

	// NodeName indicates in which node this sandbox is scheduled.
	// +optional
	NodeName string `json:"nodeName,omitempty"`

	// SandboxIp is the ip address allocated to the sandbox.
	// +optional
	SandboxIp string `json:"sandboxIp,omitempty"`
}

SandboxStatus defines the observed state of Sandbox.

func (*SandboxStatus) DeepCopy

func (in *SandboxStatus) DeepCopy() *SandboxStatus

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

func (*SandboxStatus) DeepCopyInto

func (in *SandboxStatus) DeepCopyInto(out *SandboxStatus)

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

type SandboxTemplateRef

type SandboxTemplateRef struct {
	// name of the SandboxTemplate
	// +kubebuilder:validation:Required
	Name string `json:"name" protobuf:"bytes,1,name=name"`

	// name of the SandboxTemplate kind
	// Default to PodTemplate
	// +optional
	Kind *string `json:"kind,omitempty"`

	// name of the SandboxTemplate apiVersion
	// Default to v1
	// +optional
	APIVersion *string `json:"apiVersion,omitempty"`
}

SandboxTemmplateRef references a SandboxTemplate

func (*SandboxTemplateRef) DeepCopy

func (in *SandboxTemplateRef) DeepCopy() *SandboxTemplateRef

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

func (*SandboxTemplateRef) DeepCopyInto

func (in *SandboxTemplateRef) DeepCopyInto(out *SandboxTemplateRef)

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