v1beta1

package
v1.14.1-0...-7f8ff72 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppImage                 ImageType = "application"
	RootfsImage              ImageType = "rootfs"
	PatchImage               ImageType = "patch"
	ImageKubeVersionKey                = "version"
	ImageVIPKey                        = "vip"
	ImageKubeLvscareImageKey           = "image"

	ImageKubeVersionEnvSysKey   = "SEALOS_SYS_KUBE_VERSION"
	ImageSealosVersionEnvSysKey = "SEALOS_SYS_SEALOS_VERSION"
	ImageRunModeEnvSysKey       = "SEALOS_SYS_RUN_MODE"
	ImageImageEndpointSysKey    = "SEALOS_SYS_IMAGE_ENDPOINT"
)
View Source
const (
	ImageTypeVersionKeyV1Beta1 = "v1beta1"
	ImageTypeVersionKeyV1Beta2 = "v1beta2"
)
View Source
const (
	ClusterConditionTypeSuccess string = "ApplyClusterSuccess"
	ClusterConditionTypeError   string = "ApplyClusterError"

	CommandConditionTypeSuccess   string = "ApplyCommandSuccess"
	CommandConditionTypeError     string = "ApplyCommandError"
	CommandConditionTypeCancelled string = "ApplyCommandCancelled"
)
View Source
const (
	DefaultLvsCareImage = "sealos.hub:5000/sealos/lvscare:latest"
)
View Source
const (
	DefaultSSHPort = 22
)
View Source
const (
	DefaultUserRoot = "root"
)
View Source
const GroupName = "apps.sealos.io"

GroupName is the group name use in this package

Variables

View Source
var (
	MASTER   = "master"
	NODE     = "node"
	REGISTRY = "registry"
)
View Source
var ImageDistributionKeys = []string{imageDistributionKey, imageDistributionKeyV2}
View Source
var ImageTypeKeys = []string{imageTypeKey, imageTypeKeyV2}
View Source
var ImageVersionKeys = []string{imageVersionKey, imageVersionKeyV2}
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}

SchemeGroupVersion is group version used to register these objects

Functions

func MergeEnvWithBuiltinKeys

func MergeEnvWithBuiltinKeys(src map[string]string, m MountImage) map[string]string

Types

type Arch

type Arch string
const (
	AMD64 Arch = "amd64"
	ARM64 Arch = "arm64"
)

type Cluster

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

	Spec   ClusterSpec   `json:"spec,omitempty"`
	Status ClusterStatus `json:"status,omitempty"`
}

Cluster is the Schema for the InfraMetadata API

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

func (*Cluster) DeepCopyObject

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

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

func (*Cluster) FindImage

func (c *Cluster) FindImage(name string) (int, *MountImage)

func (*Cluster) GetAllIPS

func (c *Cluster) GetAllIPS() []string

func (*Cluster) GetAllLabels

func (c *Cluster) GetAllLabels() map[string]string

func (*Cluster) GetDistribution

func (c *Cluster) GetDistribution() string

func (*Cluster) GetIPSByRole

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

func (*Cluster) GetImageEndpoint

func (c *Cluster) GetImageEndpoint() string

func (*Cluster) GetLvscareImage

func (c *Cluster) GetLvscareImage() string

func (*Cluster) GetMaster0IP

func (c *Cluster) GetMaster0IP() string

func (*Cluster) GetMaster0IPAndPort

func (c *Cluster) GetMaster0IPAndPort() string

func (*Cluster) GetMasterIPAndPortList

func (c *Cluster) GetMasterIPAndPortList() []string

func (*Cluster) GetMasterIPList

func (c *Cluster) GetMasterIPList() []string

func (*Cluster) GetNodeIPAndPortList

func (c *Cluster) GetNodeIPAndPortList() []string

func (*Cluster) GetNodeIPList

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

func (*Cluster) GetRegistryIP

func (c *Cluster) GetRegistryIP() string

func (*Cluster) GetRegistryIPAndPort

func (c *Cluster) GetRegistryIPAndPort() string

func (*Cluster) GetRegistryIPAndPortList

func (c *Cluster) GetRegistryIPAndPortList() []string

func (*Cluster) GetRegistryIPList

func (c *Cluster) GetRegistryIPList() []string

func (*Cluster) GetRolesByIP

func (c *Cluster) GetRolesByIP(ip string) []string

func (*Cluster) GetRootfsImage

func (c *Cluster) GetRootfsImage() *MountImage

func (*Cluster) GetVIP

func (c *Cluster) GetVIP() string

func (*Cluster) ReplaceRootfsImage

func (c *Cluster) ReplaceRootfsImage()

func (*Cluster) SetNewImages

func (c *Cluster) SetNewImages(images []string)

func (*Cluster) String

func (c *Cluster) String() string

type ClusterCondition

type ClusterCondition 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"`
}

ClusterCondition describes the state of a cluster at a certain point.

func NewFailedClusterCondition

func NewFailedClusterCondition(message string) ClusterCondition

func NewSuccessClusterCondition

func NewSuccessClusterCondition() ClusterCondition

func UpdateCondition

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

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

func (*ClusterCondition) DeepCopy

func (in *ClusterCondition) DeepCopy() *ClusterCondition

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

func (*ClusterCondition) DeepCopyInto

func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)

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

type ClusterPhase

type ClusterPhase string
const (
	ClusterFailed    ClusterPhase = "ClusterFailed"
	ClusterSuccess   ClusterPhase = "ClusterSuccess"
	ClusterInProcess ClusterPhase = "ClusterInProcess"
)

type ClusterSpec

type ClusterSpec struct {
	// desired state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	// Foo is an example field of Cluster. Edit Cluster_types.go to remove/update
	Image ImageList `json:"image,omitempty"`
	SSH   SSH       `json:"ssh"`
	Hosts []Host    `json:"hosts,omitempty"`
	// Why env not using map[string]string
	// Because some argument is list, like: CertSANS=127.0.0.1 CertSANS=localhost, if ENV is map, will merge those two values
	// but user want to InfraMetadata a list, using array we can convert it to {CertSANS:[127.0.0.1, localhost]}
	Env []string `json:"env,omitempty"`
	// Entrypoint array. Not executed within a shell.
	// The docker image's ENTRYPOINT is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
	// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
	// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
	// of whether the variable exists or not. Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Command []string `json:"command,omitempty"`
}

ClusterSpec defines the desired state of InfraMetadata

func (*ClusterSpec) DeepCopy

func (in *ClusterSpec) DeepCopy() *ClusterSpec

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

func (*ClusterSpec) DeepCopyInto

func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)

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

type ClusterStatus

type ClusterStatus struct {
	Phase             ClusterPhase       `json:"phase,omitempty"`
	Mounts            []MountImage       `json:"mounts,omitempty"`
	Conditions        []ClusterCondition `json:"conditions,omitempty"`
	CommandConditions []CommandCondition `json:"commandCondition,omitempty"`
}

func (*ClusterStatus) DeepCopy

func (in *ClusterStatus) DeepCopy() *ClusterStatus

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

func (*ClusterStatus) DeepCopyInto

func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)

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

type CommandCondition

type CommandCondition struct {
	Type              string             `json:"type"`
	Status            v1.ConditionStatus `json:"status"`
	LastHeartbeatTime metav1.Time        `json:"lastHeartbeatTime,omitempty"`

	// +optional
	Images []string `json:"images"`
	// +optional
	Reason string `json:"reason,omitempty"`
	// +optional
	Message string `json:"message,omitempty"`
}

func NewCancelledCommandCondition

func NewCancelledCommandCondition(message string) CommandCondition

func NewFailedCommandCondition

func NewFailedCommandCondition(message string) CommandCondition

func UpdateCommandCondition

func UpdateCommandCondition(cmdConditions []CommandCondition, cmdCondition CommandCondition) []CommandCondition

UpdateCommandCondition updates condition in cluster conditions using giving condition, append only

func (*CommandCondition) DeepCopy

func (in *CommandCondition) DeepCopy() *CommandCondition

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

func (*CommandCondition) DeepCopyInto

func (in *CommandCondition) DeepCopyInto(out *CommandCondition)

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

type Config

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

	Spec ConfigSpec `json:"spec,omitempty"`
}

Config is the Schema for the configs API

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

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

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

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

func (*Config) DeepCopyObject

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

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

type ConfigList

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

ConfigList contains a list of Config

func (*ConfigList) DeepCopy

func (in *ConfigList) DeepCopy() *ConfigList

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

func (*ConfigList) DeepCopyInto

func (in *ConfigList) DeepCopyInto(out *ConfigList)

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

func (*ConfigList) DeepCopyObject

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

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

type ConfigSpec

type ConfigSpec struct {
	Match    string       `json:"match,omitempty"`
	Strategy StrategyType `json:"strategy,omitempty"`
	Data     string       `json:"data,omitempty"`
	Path     string       `json:"path,omitempty"`
}

ConfigSpec defines the desired state of Config

func (*ConfigSpec) DeepCopy

func (in *ConfigSpec) DeepCopy() *ConfigSpec

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

func (*ConfigSpec) DeepCopyInto

func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec)

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

type Host

type Host struct {
	IPS   []string `json:"ips,omitempty"`
	Roles []string `json:"roles,omitempty"`
	Env   []string `json:"env,omitempty"` // overwrite env
	SSH   *SSH     `json:"ssh,omitempty"` // overwrite global ssh config
}

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.

type ImageList

type ImageList []string

func (ImageList) DeepCopy

func (in ImageList) DeepCopy() ImageList

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

func (ImageList) DeepCopyInto

func (in ImageList) DeepCopyInto(out *ImageList)

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

type ImageType

type ImageType string

type MountImage

type MountImage struct {
	Name       string            `json:"name"`
	Type       ImageType         `json:"type"`
	ImageName  string            `json:"imageName"`
	MountPoint string            `json:"mountPoint"`
	Env        map[string]string `json:"env,omitempty"`
	Labels     map[string]string `json:"labels,omitempty"`
	Cmd        []string          `json:"cmd,omitempty"`
	Entrypoint []string          `json:"entrypoint,omitempty"`
}

func (*MountImage) DeepCopy

func (in *MountImage) DeepCopy() *MountImage

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

func (*MountImage) DeepCopyInto

func (in *MountImage) DeepCopyInto(out *MountImage)

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

func (*MountImage) IsApplication

func (m *MountImage) IsApplication() bool

func (*MountImage) IsPatch

func (m *MountImage) IsPatch() bool

func (*MountImage) IsRootFs

func (m *MountImage) IsRootFs() bool

func (*MountImage) KubeVersion

func (m *MountImage) KubeVersion() string

type RegistryConfig

type RegistryConfig struct {
	IP       string `json:"ip,omitempty"`
	Domain   string `json:"domain,omitempty"`
	Port     string `json:"port,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Data     string `json:"data,omitempty"`
}

func (*RegistryConfig) DeepCopy

func (in *RegistryConfig) DeepCopy() *RegistryConfig

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

func (*RegistryConfig) DeepCopyInto

func (in *RegistryConfig) DeepCopyInto(out *RegistryConfig)

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

type SSH

type SSH struct {
	User     string `json:"user,omitempty"`
	Passwd   string `json:"passwd,omitempty"`
	PkName   string `json:"pkName,omitempty"`
	PkData   string `json:"pkData,omitempty"`
	Pk       string `json:"pk,omitempty"`
	PkPasswd string `json:"pkPasswd,omitempty"`
	Port     uint16 `json:"port,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.

func (*SSH) DefaultPort

func (s *SSH) DefaultPort() uint16

type StrategyType

type StrategyType string
const (
	Merge    StrategyType = "merge"
	Override StrategyType = "override"
	Insert   StrategyType = "insert"
	Append   StrategyType = "append"
)

Jump to

Keyboard shortcuts

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