provision

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REMOTE_TARGET_PATH = "/tmp"

	CNI_CANAL_FILE        = "addons/cni/canal/canal_v3.20.0.yaml"
	CNI_KILO_CRDS_FILE    = "addons/cni/kilo/crds_v0.3.0.yaml"
	CNI_KILO_KUBEADM_FILE = "addons/cni/kilo/kilo-kubeadm-flannel_v0.3.0.yaml"
	CNI_KILO_FLANNEL_FILE = "addons/cni/kilo/kube-flannel_v0.14.0.yaml"
	CNI_FLANNEL_FILE      = "addons/cni/flannel/kube-flannel_v0.19.0.yml"
	CNI_CALICO_FILE       = "addons/cni/calico/calico-v0.3.1.yaml"

	SC_NFS_RBAC_FILE  = "addons/nfs/rbac_v4.0.16.yaml"
	SC_NFS_CLASS_FILE = "addons/nfs/class_v4.0.16.yaml"

	CCM_CLOUD_CONFIG_FILE            = "cloud-config"
	CCM_AWS_ROLE_SA_FILE             = "addons/ccm/aws/clusterrole-service-account.yaml"
	CCM_AWS_DS_FILE                  = "addons/ccm/aws/aws-cloud-controller-manager-daemonset.yaml"
	CCM_OPENSTACK_ROLE_BINDINGS_FILE = "addons/ccm/openstack/cloud-controller-manager-role-bindings.yaml"
	CCM_OPENSTACK_ROLES_FILE         = "addons/ccm/openstack/cloud-controller-manager-roles.yaml"
	CCM_OPENSTACK_DS_FILE            = "addons/ccm/openstack/openstack-cloud-controller-manager-ds.yaml"
	CCM_NCPVPC_ROLE_SA_FILE          = "addons/ccm/ncpvpc/clusterrole-service-account.yaml"
	CCM_NCPVPC_DS_FILE               = "addons/ccm/ncpvpc/ncp-cloud-controller-manager-daemonset.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlPlaneMachine

type ControlPlaneMachine struct {
	*Machine
}

func (*ControlPlaneMachine) JoinControlPlane

func (self *ControlPlaneMachine) JoinControlPlane(CPJoinCmd *string) error

control-plane join

type Machine

type Machine struct {
	Name       string
	NameInCsp  string
	PublicIP   string
	PrivateIP  string
	Username   string
	CSP        app.CSP
	Role       app.ROLE
	Region     string
	Zone       string
	Spec       string
	Credential string
}

func (*Machine) ConnectionTest

func (self *Machine) ConnectionTest() error

ssh connect test

func (*Machine) GetHostname

func (self *Machine) GetHostname() (string, error)

func (*Machine) NewNode

func (self *Machine) NewNode() *model.Node

new instance of node-entity

type Provisioner

type Provisioner struct {
	Cluster *model.Cluster

	ControlPlaneMachines map[string]*ControlPlaneMachine
	WorkerNodeMachines   map[string]*WorkerNodeMachine
	// contains filtered or unexported fields
}

func NewProvisioner

func NewProvisioner(cluster *model.Cluster) *Provisioner

new a instance of provider

func (*Provisioner) AppendControlPlaneMachine

func (self *Provisioner) AppendControlPlaneMachine(name string, csp app.CSP, region string, zone string, credential string)

append a control-plane-machine

func (*Provisioner) AppendWorkerNodeMachine

func (self *Provisioner) AppendWorkerNodeMachine(name string, csp app.CSP, region string, zone string, credential string)

append a worker-node-machine

func (*Provisioner) AssignNodeLabelAnnotation

func (self *Provisioner) AssignNodeLabelAnnotation() error

assign node labels

func (*Provisioner) BindVM

func (self *Provisioner) BindVM(vms []tumblebug.VM) ([]*model.Node, error)

set fileds each machines (public-ip, region, zone, spec, username)

func (*Provisioner) Bootstrap

func (self *Provisioner) Bootstrap() error

bootstrap

func (*Provisioner) BuildAllMachines

func (self *Provisioner) BuildAllMachines() error

func (*Provisioner) CleanupAllResources

func (self *Provisioner) CleanupAllResources() error

func (*Provisioner) DrainAndDeleteNode

func (self *Provisioner) DrainAndDeleteNode(nodeName string) error

drain a node + delete node + delete a VM

func (*Provisioner) GetMachinesAll

func (self *Provisioner) GetMachinesAll() []*Machine

get machines

func (*Provisioner) InitControlPlane

func (self *Provisioner) InitControlPlane(kubernetesConfigReq app.ClusterConfigKubernetesReq) ([]string, string, error)

coantrol-plane init

func (*Provisioner) InitExternalEtcd

func (self *Provisioner) InitExternalEtcd() error

func (*Provisioner) InstallCcm

func (self *Provisioner) InstallCcm(cloudConfig string) error

install cloud-controller-manager

func (*Provisioner) InstallHAProxy

func (self *Provisioner) InstallHAProxy() error

setup haproxy

func (*Provisioner) InstallNetworkCni

func (self *Provisioner) InstallNetworkCni() error

install network-cni

func (*Provisioner) InstallStorageClassNFS

func (self *Provisioner) InstallStorageClassNFS(storageReq app.ClusterStorageClassNfsReq) error

func (*Provisioner) Kubectl

func (self *Provisioner) Kubectl(format string, a ...interface{}) (string, error)

execute kubectl

func (*Provisioner) NewWorkerJoinCommand

func (self *Provisioner) NewWorkerJoinCommand() (string, error)

new generate worker-node join command

type WorkerNodeMachine

type WorkerNodeMachine struct {
	*Machine
}

func (*WorkerNodeMachine) JoinWorker

func (self *WorkerNodeMachine) JoinWorker(workerJoinCmd *string) error

woker node join

Jump to

Keyboard shortcuts

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