Documentation
¶
Index ¶
- Constants
- Variables
- func In(key string, slice []string) bool
- func IsConditionTrue(conditions []Condition, condition Condition) bool
- func IsConditionsTrue(conditions []Condition) bool
- func SetConditionError(condition *Condition, reason string, err error)
- func ToAggregate(list []error) utilerrors.Aggregate
- type Action
- type ActionList
- type ActionPhase
- type ActionSpec
- type ActionStatus
- type Condition
- type Host
- type Phase
- type SSH
- type VirtualMachine
- func (in *VirtualMachine) DeepCopy() *VirtualMachine
- func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine)
- func (in *VirtualMachine) DeepCopyObject() runtime.Object
- func (c *VirtualMachine) GetALLIPList() []string
- func (c *VirtualMachine) GetHostByRole(role string) *Host
- func (c *VirtualMachine) GetHostStatusByRoleIndex(role string, index int) *VirtualMachineHostStatus
- func (c *VirtualMachine) GetIPSByRole(role string) []string
- func (c *VirtualMachine) GetMaster0IP() string
- func (c *VirtualMachine) GetMaster0IPAPIServer() string
- func (c *VirtualMachine) GetNodeIPList() []string
- func (c *VirtualMachine) GetRolesByIP(ip string) string
- func (c *VirtualMachine) GetSSH() SSH
- type VirtualMachineHostStatus
- type VirtualMachineList
- type VirtualMachineSpec
- type VirtualMachineStatus
Constants ¶
const MultipassType = "Multipass"
Variables ¶
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 )
var ( NODE = "node" GOLANG = "golang" CPUKey = "cpu" MEMKey = "memory" DISKKey = "disk" )
Functions ¶
func IsConditionTrue ¶
func IsConditionsTrue ¶
func SetConditionError ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action.
func (*Action) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Action) DeepCopyObject ¶
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 {
//node node-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 UpdateCondition ¶
UpdateCondition updates condition in cluster conditions using giving condition adds condition if not existed
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Host.
func (*Host) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SSH ¶
type SSH struct {
PublicFile string `json:"publicFile,omitempty"`
PkFile string `json:"pkFile,omitempty"`
PkPasswd string `json:"pkPasswd,omitempty"`
}
func (*SSH) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSH.
func (*SSH) DeepCopyInto ¶
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) GetALLIPList ¶ added in v0.0.4
func (c *VirtualMachine) GetALLIPList() []string
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 ¶
func (in *VirtualMachineHostStatus) DeepCopy() *VirtualMachineHostStatus
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 ¶
func (in *VirtualMachineStatus) DeepCopy() *VirtualMachineStatus
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.