Documentation
¶
Index ¶
- Constants
- func FormatAndMountVolumeCmd(device, mountPoint, fileSystem, mountOptions string) string
- func UmountVolumeCmd(mountPoint string) string
- type Frame
- func (f *Frame) AddClusterNodesLayer() *models.TaskLayer
- func (f *Frame) AttachKeyPairsLayer(nodeKeyPairDetails models.NodeKeyPairDetails) *models.TaskLayer
- func (f *Frame) CreateClusterLayer() *models.TaskLayer
- func (f *Frame) DeleteClusterLayer() *models.TaskLayer
- func (f *Frame) DeleteClusterNodesLayer() *models.TaskLayer
- func (f *Frame) DetachKeyPairsLayer(nodeKeyPairDetails models.NodeKeyPairDetails) *models.TaskLayer
- func (f *Frame) ParseClusterConf(versionId, runtimeId, conf string) (*models.ClusterWrapper, error)
- func (f *Frame) StartClusterLayer() *models.TaskLayer
- func (f *Frame) StopClusterLayer() *models.TaskLayer
- type FrameHandler
- type FrameInterface
- type Frontgate
- type Metadata
- func (m *Metadata) GetClusterCnodes() map[string]interface{}
- func (m *Metadata) GetClusterMetadataCnodes() map[string]interface{}
- func (m *Metadata) GetClusterNodeCnodes(nodeIds []string) map[string]interface{}
- func (m *Metadata) GetCmdCnodes(nodeId, cmd string) map[string]interface{}
- func (m *Metadata) GetEmptyClusterCnodes() map[string]interface{}
- func (m *Metadata) GetEmptyClusterNodeCnodes(nodeIds []string) map[string]interface{}
- func (m *Metadata) GetEmptyHostsCnodes(nodeIds []string) map[string]interface{}
- func (m *Metadata) GetEnvCnodes() map[string]interface{}
- func (m *Metadata) GetHostsCnodes(nodeIds []string) map[string]interface{}
- func (m *Metadata) GetScalingCnodes(nodeIds []string, path string) map[string]interface{}
- type MetadataConfig
- type MetadataV1
- func (m *MetadataV1) GetClusterCnodes() map[string]interface{}
- func (m *MetadataV1) GetClusterMetadataCnodes() map[string]interface{}
- func (m *MetadataV1) GetClusterNodeCnodes(nodeIds []string) map[string]interface{}
- func (m *MetadataV1) GetEmptyClusterCnodes() map[string]interface{}
- func (m *MetadataV1) GetEmptyClusterNodeCnodes(nodeIds []string) map[string]interface{}
- func (m *MetadataV1) GetEmptyHostsCnodes(nodeIds []string) map[string]interface{}
- func (m *MetadataV1) GetHostCnodes(nodeId string) map[string]interface{}
- func (m *MetadataV1) GetHostsCnodes(nodeIds []string) map[string]interface{}
- func (m *MetadataV1) GetScalingCnodes(nodeIds []string, path string) map[string]interface{}
- func (m *MetadataV1) GetSelfEnvCnodes(nodeId string) map[string]interface{}
- type Parser
- func (p *Parser) Parse(clusterConf app.ClusterConf) (*models.ClusterWrapper, error)
- func (p *Parser) ParseCluster(clusterConf app.ClusterConf) (*models.Cluster, error)
- func (p *Parser) ParseClusterCommon(clusterConf app.ClusterConf, node app.Node) (*models.ClusterCommon, error)
- func (p *Parser) ParseClusterLinks(clusterConf app.ClusterConf) map[string]*models.ClusterLink
- func (p *Parser) ParseClusterLoadbalancer(node app.Node) []*models.ClusterLoadbalancer
- func (p *Parser) ParseClusterNode(node app.Node, subnetId string) (map[string]*models.ClusterNode, error)
- func (p *Parser) ParseClusterRole(clusterConf app.ClusterConf, node app.Node) (*models.ClusterRole, error)
- type ProviderHandlerInterface
Constants ¶
View Source
const ( ActionRunInstances = "RunInstances" ActionStartInstances = "StartInstances" ActionStopInstances = "StopInstances" ActionTerminateInstances = "TerminateInstances" ActionCreateVolumes = "CreateVolumes" ActionAttachVolumes = "AttachVolumes" ActionDetachVolumes = "DetachVolumes" ActionDeleteVolumes = "DeleteVolumes" ActionResizeVolumes = "ResizeVolumes" ActionFormatAndMountVolume = "FormatAndMountVolume" ActionWaitFrontgateAvailable = "WaitFrontgateAvailable" ActionRegisterMetadata = "RegisterMetadata" ActionDeregisterMetadata = "DeregisterMetadata" ActionRegisterCmd = "RegisterCmd" ActionDeregisterCmd = "DeregisterCmd" ActionStartConfd = "StartConfd" ActionStopConfd = "StopConfd" ActionSetFrontgateConfig = "SetFrontgateConfig" ActionSetDroneConfig = "SetDroneConfig" ActionPingDrone = "PingDrone" ActionPingFrontgate = "PingFrontgate" ActionRunCommandOnDrone = "RunCommandOnDrone" ActionRemoveContainerOnDrone = "RemoveContainerOnDrone" ActionRemoveContainerOnFrontgate = "RemoveContainerOnFrontgate" ActionRunCommandOnFrontgateNode = "RunCommandOnFrontgateNode" )
View Source
const ( RegisterClustersRootPath = "clusters" RegisterNodeHosts = "hosts" RegisterNodeHost = "host" RegisterNodeCluster = "cluster" RegisterNodeEnv = "env" RegisterNodeLoadbalancer = "loadbalancer" RegisterNodeCmd = "cmd" RegisterNodeCmdId = "id" RegisterNodeCmdTimeout = "timeout" RegisterNodeEndpoint = "endpoints" RegisterNodeAdding = "adding-hosts" RegisterNodeDeleting = "deleting-hosts" RegisterNodeVerticalScalingRoles = "vertical-scaling-roles" )
View Source
const ( // second TimeoutStartConfd = 60 TimeoutStopConfd = 60 TimeoutDeregister = 60 TimeoutRegister = 60 TimeoutFormatAndMountVolume = 600 TimeoutUmountVolume = 120 TimeoutSshKeygen = 120 TimeoutRemoveContainer = 120 TimeoutKeyPair = 60 )
View Source
const ( OpenPitrixBasePath = "/opt/openpitrix/" OpenPitrixExecFile = "/etc/rc.local" OpenPitrixConfPath = OpenPitrixBasePath + "conf/" OpenPitrixSbinPath = OpenPitrixBasePath + "sbin/" OpenPitrixConfFile = "openpitrix.conf" DroneConfFile = "drone.conf" FrontgateConfFile = "frontgate.conf" UpdateFstabFile = "update_fstab.sh" ConfdPath = "/etc/confd/" MetadataLogLevel = "debug" ConfdBackendType = "libconfd-backend-etcdv3" ConfdCmdLogPath = "/opt/openpitrix/log/cmd.log" HostCmdPrefix = "nsenter -t 1 -m -u -n -i sh -c" MetadataNodeName = "metadata" DefaultNodeName = "node" )
Variables ¶
This section is empty.
Functions ¶
func FormatAndMountVolumeCmd ¶
func UmountVolumeCmd ¶
Types ¶
type Frame ¶
type Frame struct {
Job *models.Job
ClusterWrapper *models.ClusterWrapper
FrontgateClusterWrapper *models.ClusterWrapper
Runtime *runtimeclient.Runtime
Logger *logger.Logger
ImageConfig *config.ImageConfig
}
func (*Frame) AddClusterNodesLayer ¶
func (*Frame) AttachKeyPairsLayer ¶ added in v0.1.7
func (f *Frame) AttachKeyPairsLayer(nodeKeyPairDetails models.NodeKeyPairDetails) *models.TaskLayer
func (*Frame) CreateClusterLayer ¶
func (*Frame) DeleteClusterLayer ¶
func (*Frame) DeleteClusterNodesLayer ¶
func (*Frame) DetachKeyPairsLayer ¶ added in v0.1.7
func (f *Frame) DetachKeyPairsLayer(nodeKeyPairDetails models.NodeKeyPairDetails) *models.TaskLayer
func (*Frame) ParseClusterConf ¶ added in v0.1.7
func (f *Frame) ParseClusterConf(versionId, runtimeId, conf string) (*models.ClusterWrapper, error)
func (*Frame) StartClusterLayer ¶
func (*Frame) StopClusterLayer ¶
type FrameHandler ¶
func (*FrameHandler) WaitFrontgateAvailable ¶
func (f *FrameHandler) WaitFrontgateAvailable(task *models.Task) error
type FrameInterface ¶
type FrameInterface interface {
CreateClusterLayer() *models.TaskLayer
StopClusterLayer() *models.TaskLayer
StartClusterLayer() *models.TaskLayer
DeleteClusterLayer() *models.TaskLayer
AddClusterNodesLayer() *models.TaskLayer
DeleteClusterNodesLayer() *models.TaskLayer
AttachKeyPairsLayer(nodeKeyPairDetails models.NodeKeyPairDetails) *models.TaskLayer
DetachKeyPairsLayer(nodeKeyPairDetails models.NodeKeyPairDetails) *models.TaskLayer
ParseClusterConf(versionId, runtimeId, conf string) (*models.ClusterWrapper, error)
}
func NewFrameInterface ¶
type Frontgate ¶
type Frontgate struct {
*Frame
}
func (*Frontgate) CreateClusterLayer ¶
func (*Frontgate) DeleteClusterLayer ¶
func (*Frontgate) StartClusterLayer ¶
func (*Frontgate) StopClusterLayer ¶
type Metadata ¶
type Metadata struct {
ClusterWrapper *models.ClusterWrapper
Logger *logger.Logger
}
func (*Metadata) GetClusterCnodes ¶
Compose cluster info into the following format, in order to register cluster to configuration management service.
{
"<cluster_id>": {
"hosts": {
<The data from the function GetHostsCnodes below>
},
"cluster": {
<The data from the function GetClusterMetadataCnodes below>
},
"env": { # optional
<The data from the function GetEnvCnodes below>
}
},
"self": {
"192.168.100.10": {
<The data from the function GetClusterSelfCnodes below>
}
}
}
func (*Metadata) GetClusterMetadataCnodes ¶
func (*Metadata) GetClusterNodeCnodes ¶
func (*Metadata) GetCmdCnodes ¶
func (*Metadata) GetEmptyClusterCnodes ¶
func (*Metadata) GetEmptyClusterNodeCnodes ¶
func (*Metadata) GetEmptyHostsCnodes ¶
func (*Metadata) GetEnvCnodes ¶
{
"master": {
"p1": "v1",
"p2": "v2"
}
}
or (without role)
{
"p1": "v1",
"p2": "v2"
}
func (*Metadata) GetHostsCnodes ¶
{
"master": {
"i-abcdefg": {
"ip":<ip>,
"server_id":<server id>,
"pub_key": <pub_key>
},
"i-xuzabcd": {
"ip":<ip>,
"server_id":<server id>,
"pub_key": <pub_key>
}
}
}
or (without role)
{
"i-abcdefg": {
"ip":<ip>,
"server_id":<server id>
},
"i-xuzabcd": {
"ip":<ip>,
"server_id":<server id>
}
}
type MetadataConfig ¶
type MetadataConfig struct {
ClusterWrapper *models.ClusterWrapper
}
func (*MetadataConfig) GetDroneConfig ¶
func (m *MetadataConfig) GetDroneConfig(nodeId string) string
func (*MetadataConfig) GetFrontgateConfig ¶
func (m *MetadataConfig) GetFrontgateConfig(nodeId string) string
type MetadataV1 ¶
type MetadataV1 struct {
ClusterWrapper *models.ClusterWrapper
Logger *logger.Logger
}
func (*MetadataV1) GetClusterCnodes ¶
func (m *MetadataV1) GetClusterCnodes() map[string]interface{}
Compose cluster info into the following format, in order to register cluster to configuration management service.
{
"<ip>": {
"hosts": {
<The data from the function GetHostsCnodes below>
},
"host": {
<The data from the function GetHostCnodes below>
},
"cluster": {
<The data from the function GetClusterMetadataCnodes below>
},
"env": { # optional
<The data from the function GetEnvCnodes below>
}
}
}
func (*MetadataV1) GetClusterMetadataCnodes ¶
func (m *MetadataV1) GetClusterMetadataCnodes() map[string]interface{}
func (*MetadataV1) GetClusterNodeCnodes ¶
func (m *MetadataV1) GetClusterNodeCnodes(nodeIds []string) map[string]interface{}
func (*MetadataV1) GetEmptyClusterCnodes ¶
func (m *MetadataV1) GetEmptyClusterCnodes() map[string]interface{}
func (*MetadataV1) GetEmptyClusterNodeCnodes ¶
func (m *MetadataV1) GetEmptyClusterNodeCnodes(nodeIds []string) map[string]interface{}
func (*MetadataV1) GetEmptyHostsCnodes ¶
func (m *MetadataV1) GetEmptyHostsCnodes(nodeIds []string) map[string]interface{}
func (*MetadataV1) GetHostCnodes ¶
func (m *MetadataV1) GetHostCnodes(nodeId string) map[string]interface{}
{
"ip":<ip>,
"server_id":<server id>
}
func (*MetadataV1) GetHostsCnodes ¶
func (m *MetadataV1) GetHostsCnodes(nodeIds []string) map[string]interface{}
{
"master": {
"i-abcdefg": {
"ip":<ip>,
"server_id":<server id>,
"pub_key": <pub_key>
},
"i-xuzabcd": {
"ip":<ip>,
"server_id":<server id>,
"pub_key": <pub_key>
}
}
}
or (without role)
{
"i-abcdefg": {
"ip":<ip>,
"server_id":<server id>
},
"i-xuzabcd": {
"ip":<ip>,
"server_id":<server id>
}
}
func (*MetadataV1) GetScalingCnodes ¶
func (m *MetadataV1) GetScalingCnodes(nodeIds []string, path string) map[string]interface{}
func (*MetadataV1) GetSelfEnvCnodes ¶
func (m *MetadataV1) GetSelfEnvCnodes(nodeId string) map[string]interface{}
{
"p1": "v1",
"p2": "v2"
}
type Parser ¶ added in v0.1.7
func (*Parser) Parse ¶ added in v0.1.7
func (p *Parser) Parse(clusterConf app.ClusterConf) (*models.ClusterWrapper, error)
func (*Parser) ParseCluster ¶ added in v0.1.7
func (*Parser) ParseClusterCommon ¶ added in v0.1.7
func (p *Parser) ParseClusterCommon(clusterConf app.ClusterConf, node app.Node) (*models.ClusterCommon, error)
func (*Parser) ParseClusterLinks ¶ added in v0.1.7
func (p *Parser) ParseClusterLinks(clusterConf app.ClusterConf) map[string]*models.ClusterLink
func (*Parser) ParseClusterLoadbalancer ¶ added in v0.1.7
func (p *Parser) ParseClusterLoadbalancer(node app.Node) []*models.ClusterLoadbalancer
func (*Parser) ParseClusterNode ¶ added in v0.1.7
func (*Parser) ParseClusterRole ¶ added in v0.1.7
func (p *Parser) ParseClusterRole(clusterConf app.ClusterConf, node app.Node) (*models.ClusterRole, error)
type ProviderHandlerInterface ¶
type ProviderHandlerInterface interface {
RunInstances(task *models.Task) error
WaitRunInstances(task *models.Task) error
StopInstances(task *models.Task) error
WaitStopInstances(task *models.Task) error
StartInstances(task *models.Task) error
WaitStartInstances(task *models.Task) error
DeleteInstances(task *models.Task) error
WaitDeleteInstances(task *models.Task) error
CreateVolumes(task *models.Task) error
WaitCreateVolumes(task *models.Task) error
DetachVolumes(task *models.Task) error
WaitDetachVolumes(task *models.Task) error
AttachVolumes(task *models.Task) error
WaitAttachVolumes(task *models.Task) error
DeleteVolumes(task *models.Task) error
WaitDeleteVolumes(task *models.Task) error
WaitFrontgateAvailable(task *models.Task) error
DescribeSubnet(runtimeId, subnetId string) (*models.Subnet, error)
DescribeVpc(runtimeId, vpcId string) (*models.Vpc, error)
}
Click to show internal directories.
Click to hide internal directories.