v1

package
v0.0.0-...-61a2cff Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package v1 contains API Schema definitions for the infra v1 API group +kubebuilder:object:generate=true +groupName=infra.sealos.io

Index

Constants

View Source
const (
	InfraResourcePricePrefix = "sealos-infra-controller"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "infra.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 DefaultInfraResourceGVK = []meteringcommonv1.GroupVersionKind{{
	Group:   "infra.sealos.io",
	Version: "v1",
	Kind:    "infra",
},
}

Functions

This section is empty.

Types

type DeviceDisks

type DeviceDisks []Disk

func (DeviceDisks) DeepCopy

func (in DeviceDisks) DeepCopy() DeviceDisks

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

func (DeviceDisks) DeepCopyInto

func (in DeviceDisks) DeepCopyInto(out *DeviceDisks)

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

func (DeviceDisks) Len

func (disks DeviceDisks) Len() int

func (DeviceDisks) Less

func (disks DeviceDisks) Less(i, j int) bool

func (DeviceDisks) Swap

func (disks DeviceDisks) Swap(i, j int)

type Disk

type Disk struct {
	Capacity int `json:"capacity,omitempty"`
	// ENUM: standard/io1/io2/gp2/gp3/sc1/st1
	// +kubebuilder:validation:Enum=standard;io1;io2;gp2;gp3;sc1;st1;cloud_efficiency;cloud_ssd;cloud_essd;cloud_auto;cloud
	VolumeType string `json:"volumeType,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum=root;data
	// +kubebuilder:default:=data
	// Disk Type , default is data disk. allowed value is `root|data`
	Type   string   `json:"type,omitempty"`
	Device string   `json:"device,omitempty"`
	ID     []string `json:"id,omitempty"`
}

func (*Disk) DeepCopy

func (in *Disk) DeepCopy() *Disk

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

func (*Disk) DeepCopyInto

func (in *Disk) DeepCopyInto(out *Disk)

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

type Hosts

type Hosts struct {
	// +kubebuilder:validation:Required
	Roles []string `json:"roles,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum:=0
	Count int `json:"count,omitempty"`
	// key values resources.
	// cpu: 2
	// memory: 4
	// other resources like GPU
	Resources map[string]resource.Quantity `json:"resources,omitempty"`
	// ecs.t5-lc1m2.large
	Flavor string `json:"flavor,omitempty"`
	// ENUM: amd64/arm64 (NOTE: the default value is amd64)
	// +kubebuilder:default:=amd64
	// +kubebuilder:validation:Enum=amd64;arm64
	Arch string `json:"arch,omitempty"`
	// ENUM: ubuntu:20.04, centos:7.2 and so on.
	Image string `json:"image,omitempty"`

	// max support 10 disks .
	// +kubebuilder:validation:MaxItems:=10
	// +kubebuilder:validation:Optional
	Disks    []Disk     `json:"disks,omitempty"`
	Metadata []Metadata `json:"metadata,omitempty"`
	// Find the mapping between expected hosts and actual hosts
	Index int `json:"index,omitempty"`
}

func (*Hosts) DeepCopy

func (in *Hosts) DeepCopy() *Hosts

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

func (*Hosts) DeepCopyInto

func (in *Hosts) DeepCopyInto(out *Hosts)

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

type IPAddress

type IPAddress struct {
	IPType  string `json:"ipType,omitempty"`
	IPValue string `json:"ipValue,omitempty"`
}

func (*IPAddress) DeepCopy

func (in *IPAddress) DeepCopy() *IPAddress

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

func (*IPAddress) DeepCopyInto

func (in *IPAddress) DeepCopyInto(out *IPAddress)

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

type IndexHosts

type IndexHosts []Hosts

func (IndexHosts) DeepCopy

func (in IndexHosts) DeepCopy() IndexHosts

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

func (IndexHosts) DeepCopyInto

func (in IndexHosts) DeepCopyInto(out *IndexHosts)

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

func (IndexHosts) Len

func (hosts IndexHosts) Len() int

func (IndexHosts) Less

func (hosts IndexHosts) Less(i, j int) bool

func (IndexHosts) Swap

func (hosts IndexHosts) Swap(i, j int)

type Infra

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

	Spec   InfraSpec   `json:"spec,omitempty"`
	Status InfraStatus `json:"status,omitempty"`
}

Infra is the Schema for the infras API

func (*Infra) DeepCopy

func (in *Infra) DeepCopy() *Infra

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

func (*Infra) DeepCopyInto

func (in *Infra) DeepCopyInto(out *Infra)

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

func (*Infra) DeepCopyObject

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

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

func (*Infra) GetInstancesAndVolumesTag

func (i *Infra) GetInstancesAndVolumesTag() string

func (*Infra) QueryPrice

func (i *Infra) QueryPrice() (int64, error)

QueryPrice query infra price/hour, unit: CNY cents/hour may be error is not nil,but the price should calculate

type InfraList

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

InfraList contains a list of Infra

func (*InfraList) DeepCopy

func (in *InfraList) DeepCopy() *InfraList

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

func (*InfraList) DeepCopyInto

func (in *InfraList) DeepCopyInto(out *InfraList)

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

func (*InfraList) DeepCopyObject

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

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

type InfraResource

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

	Spec   InfraResourceSpec   `json:"spec,omitempty"`
	Status InfraResourceStatus `json:"status,omitempty"`
}

InfraResource is the Schema for the Infraresources API

func (*InfraResource) DeepCopy

func (in *InfraResource) DeepCopy() *InfraResource

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

func (*InfraResource) DeepCopyInto

func (in *InfraResource) DeepCopyInto(out *InfraResource)

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

func (*InfraResource) DeepCopyObject

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

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

type InfraResourceList

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

InfraResourceList contains a list of InfraResource

func (*InfraResourceList) DeepCopy

func (in *InfraResourceList) DeepCopy() *InfraResourceList

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

func (*InfraResourceList) DeepCopyInto

func (in *InfraResourceList) DeepCopyInto(out *InfraResourceList)

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

func (*InfraResourceList) DeepCopyObject

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

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

type InfraResourceSpec

type InfraResourceSpec struct {
	ResourceName string                                             `json:"resourceName,omitempty"`
	Resources    map[v1.ResourceName]meteringcommonv1.ResourcePrice `json:"resources,omitempty"`

	// update used resources every Interval minutes
	//+kubebuilder:validation:Minimum=1
	Interval int `json:"interval,omitempty"`
}

InfraResourceSpec defines the desired state of InfraResource

func (*InfraResourceSpec) DeepCopy

func (in *InfraResourceSpec) DeepCopy() *InfraResourceSpec

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

func (*InfraResourceSpec) DeepCopyInto

func (in *InfraResourceSpec) DeepCopyInto(out *InfraResourceSpec)

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

type InfraResourceStatus

type InfraResourceStatus struct {
	LatestUpdateTime int64 `json:"latestUpdateTime,omitempty"`
	SeqID            int64 `json:"seqID,omitempty"`
}

InfraResourceStatus defines the observed state of InfraResource

func (*InfraResourceStatus) DeepCopy

func (in *InfraResourceStatus) DeepCopy() *InfraResourceStatus

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

func (*InfraResourceStatus) DeepCopyInto

func (in *InfraResourceStatus) DeepCopyInto(out *InfraResourceStatus)

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

type InfraSpec

type InfraSpec struct {

	// ENUM: aws/aliyun
	// +kubebuilder:validation:Enum=aws;aliyun
	// +kubebuilder:default:=aws
	Platform string `json:"platform,omitempty"`
	// RegionIDs is cloud provider regionID list
	RegionIDs []string    `json:"regionIDs,omitempty"`
	ZoneIDs   []string    `json:"zoneIDs,omitempty"`
	SSH       v1bata1.SSH `json:"ssh,omitempty"`
	// +kubebuilder:validation:Required
	Hosts []Hosts `json:"hosts,omitempty"`
	// Availability Zone
	AvailabilityZone string `json:"availabilityZone,omitempty"`
}

InfraSpec defines the desired state of Infra

func (*InfraSpec) DeepCopy

func (in *InfraSpec) DeepCopy() *InfraSpec

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

func (*InfraSpec) DeepCopyInto

func (in *InfraSpec) DeepCopyInto(out *InfraSpec)

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

type InfraStatus

type InfraStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	Status string `json:"status,omitempty"`
}

InfraStatus defines the observed state of Infra

func (*InfraStatus) DeepCopy

func (in *InfraStatus) DeepCopy() *InfraStatus

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

func (*InfraStatus) DeepCopyInto

func (in *InfraStatus) DeepCopyInto(out *InfraStatus)

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

type Metadata

type Metadata struct {
	// 0 private , 1 public
	IP     []IPAddress       `json:"ipaddress,omitempty"`
	ID     string            `json:"id,omitempty"`
	DiskID []string          `json:"diskId,omitempty"`
	Status string            `json:"status,omitempty"`
	Labels map[string]string `json:"labels,omitempty"`
}

func (*Metadata) DeepCopy

func (in *Metadata) DeepCopy() *Metadata

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

func (*Metadata) DeepCopyInto

func (in *Metadata) DeepCopyInto(out *Metadata)

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

type Status

type Status int
const (
	Pending Status = iota
	Running
	Succeeded
	Failed
	Unknown
	Terminating
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL