model

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ClusterPhasePending      = ClusterPhase("Pending")
	ClusterPhaseProvisioning = ClusterPhase("Provisioning")
	ClusterPhaseProvisioned  = ClusterPhase("Provisioned")
	ClusterPhaseFailed       = ClusterPhase("Failed")
	ClusterPhaseDeleting     = ClusterPhase("Deleting")

	GetMCISFailedReason                       = ClusterReason("GetMCISFailedReason")
	AlreadyExistMCISFailedReason              = ClusterReason("AlreadyExistMCISFailedReason")
	InvalidMCIRReason                         = ClusterReason("InvalidMCIRReason")
	CreateMCISFailedReason                    = ClusterReason("CreateMCISFailedReason")
	GetControlPlaneConnectionInfoFailedReason = ClusterReason("GetControlPlaneConnectionInfoFailedReason")
	GetWorkerConnectionInfoFailedReason       = ClusterReason("GetWorkerConnectionInfoFailedReason")
	CreateVpcFailedReason                     = ClusterReason("CreateVpcFailedReason")
	CreateSecurityGroupFailedReason           = ClusterReason("CreateSecurityGroupFailedReason")
	CreateSSHKeyFailedReason                  = ClusterReason("CreateSSHKeyFailedReason")
	CreateVmImageFailedReason                 = ClusterReason("CreateVmImageFailedReason")
	CreateVmSpecFailedReason                  = ClusterReason("CreateVmSpecFailedReason")
	CreateNLBFailedReason                     = ClusterReason("CreateNLBFailedReason")
	AddNodeEntityFailedReason                 = ClusterReason("AddNodeEntityFailedReason")
	SetupBoostrapFailedReason                 = ClusterReason("SetupBoostrapFailedReason")
	SetupHaproxyFailedReason                  = ClusterReason("SetupHaproxyFailedReason")
	InitControlPlaneFailedReason              = ClusterReason("InitControlPlaneFailedReason")
	InitExternalEtcdFailedReason              = ClusterReason("InitExternalEtcdFailedReason")
	SetupNetworkCNIFailedReason               = ClusterReason("SetupNetworkCNIFailedReason")
	SetupStorageClassFailedReason             = ClusterReason("SetupStorageClassFailedReason")
	JoinControlPlaneFailedReason              = ClusterReason("JoinControlPlaneFailedReason")
	JoinWorkerFailedReason                    = ClusterReason("JoinWorkerFailedReason")
	SetupCCMFailedReason                      = ClusterReason("SetupCCMFailedReason")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Model
	Status          ClusterStatus    `json:"status"`
	MCIS            string           `json:"mcis"`
	Namespace       string           `json:"namespace"`
	Version         string           `json:"k8sVersion"`
	ClusterConfig   string           `json:"clusterConfig"`
	CpLeader        string           `json:"cpLeader"`
	CpGroup         string           `json:"cpGroup"`
	NetworkCni      app.NetworkCni   `json:"networkCni" enums:"canal,kilo"`
	Label           string           `json:"label"`
	InstallMonAgent string           `json:"installMonAgent" example:"no" default:"yes"`
	Loadbalancer    app.Loadbalancer `json:"loadbalancer" enums:"haproxy,nlb" example:"haproxy" default:"haproxy"`
	Etcd            app.Etcd         `json:"etcd" enums:"local,external" example:"local" default:"local"`
	Description     string           `json:"description"`
	CreatedTime     string           `json:"createdTime" example:"2022-01-02T12:00:00Z" default:""`
	ServiceType     app.ServiceType  `json:"serviceType" enums:"multi,single" default:"multi"`
	Nodes           []*Node          `json:"nodes"`
}

func NewCluster

func NewCluster(namespace string, name string) *Cluster

new instance of cluster-entity

func (*Cluster) Delete

func (self *Cluster) Delete() error

func (*Cluster) DeleteNode added in v0.7.2

func (self *Cluster) DeleteNode(nodeName string) error

func (*Cluster) ExistsNode added in v0.7.2

func (self *Cluster) ExistsNode(nodeName string) bool

func (*Cluster) FailReason added in v0.7.2

func (self *Cluster) FailReason(reason ClusterReason, message string) error

func (*Cluster) GetNode added in v0.7.2

func (self *Cluster) GetNode(nodeName string) *Node

func (*Cluster) NextNodeIndex added in v0.7.2

func (self *Cluster) NextNodeIndex(role app.ROLE) int

func (*Cluster) PutStore added in v0.7.2

func (self *Cluster) PutStore() error

func (*Cluster) Select

func (self *Cluster) Select() (bool, error)

func (*Cluster) UpdatePhase added in v0.7.2

func (self *Cluster) UpdatePhase(phase ClusterPhase) error

cluster-entity

type ClusterList

type ClusterList struct {
	ListModel

	Items []Cluster `json:"items"`
	// contains filtered or unexported fields
}

func NewClusterList

func NewClusterList(namespace string) *ClusterList

new instance of cluster-entity list

func (*ClusterList) SelectList

func (self *ClusterList) SelectList() error

type ClusterPhase added in v0.7.2

type ClusterPhase string

type ClusterReason added in v0.7.2

type ClusterReason string

type ClusterStatus added in v0.7.2

type ClusterStatus struct {
	Phase   ClusterPhase  `json:"phase" enums:"Pending,Provisioning,Provisioned,Failed"`
	Reason  ClusterReason `json:"reason"`
	Message string        `json:"message"`
}

type ListModel added in v0.3.5

type ListModel struct {
	Kind app.Kind `json:"kind"`
}

type Model

type Model struct {
	Name string   `json:"name"`
	Kind app.Kind `json:"kind"`
}

type Node

type Node struct {
	Model

	Credential  string   `json:"credential"`
	PublicIP    string   `json:"publicIp"`
	PrivateIP   string   `json:"privateIp"`
	Role        app.ROLE `json:"role" enums:"control-plane,worker"`
	Spec        string   `json:"spec"`
	Csp         app.CSP  `json:"csp" enums:"aws,gcp,azure,alibaba,tencent,openstack,ibm,cloudit,ncp,ncpvpc,nhncloud"`
	CreatedTime string   `json:"createdTime" example:"2022-01-02T12:00:00Z" default:""`
	CspLabel    string   `json:"cspLabel"`
	RegionLabel string   `json:"regionLabel"`
	ZoneLabel   string   `json:"zoneLabel"`
	// contains filtered or unexported fields
}

func NewNode

func NewNode(namespace string, clusterName string, nodeName string) *Node

new instance of node-entity

type NodeList

type NodeList struct {
	ListModel

	Items []*Node `json:"items"`
	// contains filtered or unexported fields
}

func NewNodeList

func NewNodeList(namespace string, clusterName string) *NodeList

new instance of node-entity list

Jump to

Keyboard shortcuts

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