v1

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MultipassType = "Multipass"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "virtual-machine.sealos.io", Version: "v1"}

	// 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 (
	NODE   = "node"
	GOLANG = "golang"

	CPUKey  = "cpu"
	MEMKey  = "memory"
	DISKKey = "disk"
)

Functions

func In

func In(key string, slice []string) bool

func IsConditionTrue

func IsConditionTrue(conditions []Condition, condition Condition) bool

func IsConditionsTrue

func IsConditionsTrue(conditions []Condition) bool

func SetConditionError

func SetConditionError(condition *Condition, reason string, err error)

func ToAggregate

func ToAggregate(list []error) utilerrors.Aggregate

ToAggregate converts the ErrorList into an errors.Aggregate.

Types

type Action

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

	Spec   ActionSpec   `json:"spec,omitempty"`
	Status ActionStatus `json:"status,omitempty"`
}

Action is the Schema for the action API

func (*Action) DeepCopy

func (in *Action) DeepCopy() *Action

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

func (*Action) DeepCopyInto

func (in *Action) DeepCopyInto(out *Action)

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

func (*Action) DeepCopyObject

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

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

type ActionList

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

ActionList contains a list of Action

func (*ActionList) DeepCopy

func (in *ActionList) DeepCopy() *ActionList

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

func (*ActionList) DeepCopyInto

func (in *ActionList) DeepCopyInto(out *ActionList)

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

func (*ActionList) DeepCopyObject

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

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

type ActionPhase

type ActionPhase string
const (
	ActionPhaseFailed    ActionPhase = "Failed"
	ActionPhaseComplete  ActionPhase = "Complete"
	ActionPhaseInProcess ActionPhase = "InProcess"
)

type ActionSpec

type ActionSpec struct {
	//master master-0
	//node node-0
	//registry registry-0
	//dev dev-0
	//host
	On   []string `json:"on,omitempty"`
	Type string   `json:"type,omitempty"`
	Cmd  []string `json:"cmd,omitempty"`
}

ActionSpec defines the desired state of Action

func (*ActionSpec) DeepCopy

func (in *ActionSpec) DeepCopy() *ActionSpec

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

func (*ActionSpec) DeepCopyInto

func (in *ActionSpec) DeepCopyInto(out *ActionSpec)

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

type ActionStatus

type ActionStatus struct {
	Phase      ActionPhase `json:"phase,omitempty"`
	Conditions []Condition `json:"conditions,omitempty" `
}

ActionStatus defines the observed state of Action

func (*ActionStatus) DeepCopy

func (in *ActionStatus) DeepCopy() *ActionStatus

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

func (*ActionStatus) DeepCopyInto

func (in *ActionStatus) DeepCopyInto(out *ActionStatus)

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

type Condition

type Condition struct {
	Type              string             `json:"type"`
	Status            v1.ConditionStatus `json:"status"`
	LastHeartbeatTime metav1.Time        `json:"lastHeartbeatTime,omitempty"`
	// +optional
	Reason string `json:"reason,omitempty"`
	// +optional
	Message string `json:"message,omitempty"`
}

func DeleteCondition

func DeleteCondition(conditions []Condition, conditionType string) []Condition

func UpdateCondition

func UpdateCondition(conditions []Condition, condition Condition) []Condition

UpdateCondition updates condition in cluster conditions using giving condition adds condition if not existed

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

type Host

type Host struct {
	Role   string            `json:"roles,omitempty"`
	Count  int               `json:"count,omitempty"`
	Mounts map[string]string `json:"mounts,omitempty"`
	// key values resources.
	// cpu: 2
	// memory: 4
	// other resources like GPU
	Resources map[string]int `json:"resources,omitempty"`
	// ecs.t5-lc1m2.large
	Image string `json:"image,omitempty"`
}

func (*Host) DeepCopy

func (in *Host) DeepCopy() *Host

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

func (*Host) DeepCopyInto

func (in *Host) DeepCopyInto(out *Host)

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

func (*Host) GetRoles

func (c *Host) GetRoles() string

type Phase

type Phase string
const (
	PhaseFailed    Phase = "Failed"
	PhaseSuccess   Phase = "Success"
	PhaseInProcess Phase = "InProcess"
)

type SSH

type SSH struct {
	PublicFile string `json:"publicFile,omitempty"`
	PkFile     string `json:"pkFile,omitempty"`
	PkPasswd   string `json:"pkPasswd,omitempty"`
}

func (*SSH) DeepCopy

func (in *SSH) DeepCopy() *SSH

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

func (*SSH) DeepCopyInto

func (in *SSH) DeepCopyInto(out *SSH)

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

type VirtualMachine

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

	Spec   VirtualMachineSpec   `json:"spec,omitempty"`
	Status VirtualMachineStatus `json:"status,omitempty"`
}

VirtualMachine is the Schema for the infra API

func (*VirtualMachine) DeepCopy

func (in *VirtualMachine) DeepCopy() *VirtualMachine

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

func (*VirtualMachine) DeepCopyInto

func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine)

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

func (*VirtualMachine) DeepCopyObject

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

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

func (*VirtualMachine) GetHostByRole

func (c *VirtualMachine) GetHostByRole(role string) *Host

func (*VirtualMachine) GetHostStatusByRoleIndex

func (c *VirtualMachine) GetHostStatusByRoleIndex(role string, index int) *VirtualMachineHostStatus

func (*VirtualMachine) GetIPSByRole

func (c *VirtualMachine) GetIPSByRole(role string) []string

func (*VirtualMachine) GetMaster0IP

func (c *VirtualMachine) GetMaster0IP() string

func (*VirtualMachine) GetMaster0IPAPIServer

func (c *VirtualMachine) GetMaster0IPAPIServer() string

func (*VirtualMachine) GetNodeIPList

func (c *VirtualMachine) GetNodeIPList() []string

func (*VirtualMachine) GetRolesByIP

func (c *VirtualMachine) GetRolesByIP(ip string) string

func (*VirtualMachine) GetSSH

func (c *VirtualMachine) GetSSH() SSH

type VirtualMachineHostStatus

type VirtualMachineHostStatus struct {
	State string `json:"state"`
	Role  string `json:"roles"`
	ID    string `json:"ID,omitempty"`

	//当前主机的所有IP,可能包括公开或者私有的IP
	IPs       []string          `json:"IPs,omitempty"`
	ImageID   string            `json:"imageID,omitempty"`
	ImageName string            `json:"imageName,omitempty"`
	Capacity  map[string]int    `json:"capacity"`
	Used      map[string]string `json:"used"`
	Mounts    map[string]string `json:"mounts,omitempty"`
	Index     int               `json:"index,omitempty"`
}

func (*VirtualMachineHostStatus) DeepCopy

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

func (*VirtualMachineHostStatus) DeepCopyInto

func (in *VirtualMachineHostStatus) DeepCopyInto(out *VirtualMachineHostStatus)

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

type VirtualMachineList

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

VirtualMachineList contains a list of VirtualMachine

func (*VirtualMachineList) DeepCopy

func (in *VirtualMachineList) DeepCopy() *VirtualMachineList

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

func (*VirtualMachineList) DeepCopyInto

func (in *VirtualMachineList) DeepCopyInto(out *VirtualMachineList)

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

func (*VirtualMachineList) DeepCopyObject

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

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

type VirtualMachineSpec

type VirtualMachineSpec struct {
	Hosts   []Host `json:"hosts,omitempty"`
	SSH     SSH    `json:"ssh"`
	Type    string `json:"provider,omitempty"`
	Proxy   string
	NoProxy string
}

VirtualMachineSpec defines the desired state of VirtualMachine

func (*VirtualMachineSpec) DeepCopy

func (in *VirtualMachineSpec) DeepCopy() *VirtualMachineSpec

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

func (*VirtualMachineSpec) DeepCopyInto

func (in *VirtualMachineSpec) DeepCopyInto(out *VirtualMachineSpec)

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

type VirtualMachineStatus

type VirtualMachineStatus struct {
	Phase      Phase                      `json:"phase,omitempty"`
	Hosts      []VirtualMachineHostStatus `json:"hosts"`
	Conditions []Condition                `json:"conditions,omitempty" `
}

VirtualMachineStatus defines the observed state of VirtualMachine

func (*VirtualMachineStatus) DeepCopy

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

func (*VirtualMachineStatus) DeepCopyInto

func (in *VirtualMachineStatus) DeepCopyInto(out *VirtualMachineStatus)

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