Class: Porkadot::Cmd::Install::Bootstrap::Cli

Inherits:
SubCommandBase show all
Includes:
Utils
Defined in:
lib/porkadot/cmd/install/bootstrap.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

#config, #logger

Methods inherited from SubCommandBase

banner

Constructor Details

#initialize(*arg) ⇒ Cli

Returns a new instance of Cli.



6
7
8
# File 'lib/porkadot/cmd/install/bootstrap.rb', line 6

def initialize(*arg)
  super
end

Class Method Details

.subcommand_prefixObject



45
46
47
# File 'lib/porkadot/cmd/install/bootstrap.rb', line 45

def self.subcommand_prefix
  'install bootstrap'
end

Instance Method Details

#allObject



12
13
14
15
16
# File 'lib/porkadot/cmd/install/bootstrap.rb', line 12

def all
  invoke :node
  invoke :kubernetes
  invoke :cleanup
end

#cleanupObject



38
39
40
41
42
43
# File 'lib/porkadot/cmd/install/bootstrap.rb', line 38

def cleanup
  logger.info "Cleanup bootstrap node"
  bootstrap = Porkadot::Install::Bootstrap.new(self.config)
  bootstrap.cleanup
  ""
end

#kubernetesObject



29
30
31
32
33
34
35
# File 'lib/porkadot/cmd/install/bootstrap.rb', line 29

def kubernetes
  logger.info "Installing bootstrap kubernetes"
  bootstrap = Porkadot::Install::Bootstrap.new(self.config)
  k8s = Porkadot::Install::Kubernetes.new(self.config)
  k8s.install(bootstrap.host)
  ""
end

#nodeObject



19
20
21
22
23
24
25
26
# File 'lib/porkadot/cmd/install/bootstrap.rb', line 19

def node
  logger.info "Installing bootstrap node"
  bootstrap = Porkadot::Install::Bootstrap.new(self.config)
  kubelets = Porkadot::Install::KubeletList.new(self.config)
  kubelets.install hosts: [bootstrap.host]
  bootstrap.install
  ""
end