model

package
v0.0.0-...-2bff06c Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_CREATED      = "created"
	STATUS_PROVISIONING = "provisioning"
	STATUS_COMPLETED    = "completed"
	STATUS_FAILED       = "failed"
)
View Source
const (
	STATUS_UNKNOWN   = 0
	STATUS_SUCCESS   = 1
	STATUS_NOT_EXIST = 404
)
View Source
const (
	KIND_STATUS       = "Status"
	KIND_CLUSTER      = "Cluster"
	KIND_CLUSTER_LIST = "ClusterList"
	KIND_NODE         = "Node"
	KIND_NODE_LIST    = "NodeList"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Model
	Status        string `json:"status"`
	UId           string `json:"uid"`
	MCIS          string `json:"mcis"`
	Namespace     string `json:"namespace"`
	ClusterConfig string `json:"clusterConfig"`
	CpLeader      string `json:"cpLeader"`
	NetworkCni    string `json:"networkCni"`
	Nodes         []Node `json:"nodes"`
}

func NewCluster

func NewCluster(namespace string, name string) *Cluster

func (*Cluster) Complete

func (self *Cluster) Complete() error

func (*Cluster) Delete

func (self *Cluster) Delete() error

func (*Cluster) Fail

func (self *Cluster) Fail() error

func (*Cluster) Insert

func (self *Cluster) Insert() error

func (*Cluster) Select

func (self *Cluster) Select() error

func (*Cluster) Update

func (self *Cluster) Update() error

type ClusterList

type ClusterList struct {
	ListModel

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

func NewClusterList

func NewClusterList(namespace string) *ClusterList

func (*ClusterList) SelectList

func (self *ClusterList) SelectList() error

type ClusterReq

type ClusterReq struct {
	Name         string       `json:"name"`
	ControlPlane []NodeConfig `json:"controlPlane"`
	Worker       []NodeConfig `json:"worker"`
	Config       Config       `json:"config"`
}

type Config

type Config struct {
	Kubernetes Kubernetes `json:"kubernetes"`
}

type Kubernetes

type Kubernetes struct {
	NetworkCni       string `json:"networkCni"`
	PodCidr          string `json:"podCidr"`
	ServiceCidr      string `json:"serviceCidr"`
	ServiceDnsDomain string `json:"serviceDnsDomain"`
}

type ListModel

type ListModel struct {
	Kind string `json:"kind"`
}

type Model

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

type Node

type Node struct {
	Model

	Credential string     `json:"credential"`
	PublicIP   string     `json:"publicIp"`
	UId        string     `json:"uid"`
	Role       string     `json:"role"`
	Spec       string     `json:"spec"`
	Csp        config.CSP `json:"csp"`
	// contains filtered or unexported fields
}

func NewNode

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

func NewNodeVM

func NewNodeVM(namespace string, clusterName string, vm VM) *Node

func (*Node) Delete

func (self *Node) Delete() error

func (*Node) Insert

func (self *Node) Insert() error

func (*Node) Select

func (self *Node) Select() error

type NodeConfig

type NodeConfig struct {
	Connection string `json:"connection"`
	Count      int    `json:"count"`
	Spec       string `json:"spec"`
}

type NodeList

type NodeList struct {
	ListModel

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

func NewNodeList

func NewNodeList(namespace string, clusterName string) *NodeList

func (*NodeList) SelectList

func (self *NodeList) SelectList() error

type NodeReq

type NodeReq struct {
	ControlPlane []NodeConfig `json:"controlPlane"`
	Worker       []NodeConfig `json:"worker"`
}

type Status

type Status struct {
	Kind    string `json:"kind"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func NewStatus

func NewStatus() *Status

type VM

type VM struct {
	Name         string     `json:"name"`
	Config       string     `json:"connectionName"`
	VPC          string     `json:"vNetId"`
	Subnet       string     `json:"subnetId"`
	Firewall     []string   `json:"securityGroupIds"`
	SSHKey       string     `json:"sshKeyId"`
	Image        string     `json:"imageId"`
	Spec         string     `json:"specId"`
	UserAccount  string     `json:"vmUserAccount"`
	UserPassword string     `json:"vmUserPassword"`
	Description  string     `json:"description"`
	PublicIP     string     `json:"publicIP"` // output
	Credential   string     // private
	UId          string     `json:"uid"`
	Role         string     `json:"role"`
	Csp          config.CSP `json:"csp"`
	IsCPLeader   bool       `json:"isCPLeader"`
}

func (*VM) Bootstrap

func (self *VM) Bootstrap(sshInfo *ssh.SSHInfo) error

func (*VM) ConnectionTest

func (self *VM) ConnectionTest(sshInfo *ssh.SSHInfo) error

func (*VM) ControlPlaneInit

func (self *VM) ControlPlaneInit(sshInfo *ssh.SSHInfo, reqKubernetes Kubernetes) ([]string, string, error)

func (*VM) ControlPlaneJoin

func (self *VM) ControlPlaneJoin(sshInfo *ssh.SSHInfo, CPJoinCmd *string) error

func (*VM) CopyScripts

func (self *VM) CopyScripts(sshInfo *ssh.SSHInfo, networkCni string) error

func (*VM) InstallHAProxy

func (self *VM) InstallHAProxy(sshInfo *ssh.SSHInfo, IPs []string) error

func (*VM) InstallNetworkCNI

func (self *VM) InstallNetworkCNI(sshInfo *ssh.SSHInfo, networkCni string) error

func (*VM) SetSystemd

func (self *VM) SetSystemd(sshInfo *ssh.SSHInfo, networkCni string) error

func (*VM) WorkerJoin

func (self *VM) WorkerJoin(sshInfo *ssh.SSHInfo, workerJoinCmd *string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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