Class: Porkadot::Cmd::Render::Cli

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

#config, #logger

Methods inherited from SubCommandBase

banner

Class Method Details

.subcommand_prefixObject



63
64
65
# File 'lib/porkadot/cmd/render.rb', line 63

def self.subcommand_prefix
  'render'
end

Instance Method Details

#allObject



8
9
10
11
12
13
14
# File 'lib/porkadot/cmd/render.rb', line 8

def all
  invoke "porkadot:cmd:render:certs:cli:all", [], options
  invoke :kubelet, [], options
  invoke :etcd, [], options
  invoke :bootstrap, [], options
  invoke :kubernetes, [], options
end

#bootstrapObject



46
47
48
49
50
51
52
53
# File 'lib/porkadot/cmd/render.rb', line 46

def bootstrap
  logger.info "Generating bootstrap related files"
  bootstrap = Porkadot::Assets::Bootstrap.new(self.config)
  kubelet = Porkadot::Assets::Kubelet.new(self.config.bootstrap.kubelet_config)
  kubelet.render
  bootstrap.render
  ""
end

#etcdObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/porkadot/cmd/render.rb', line 34

def etcd
  logger.info "Generating etcd related files"
  etcds = Porkadot::Assets::EtcdList.new(self.config)
  if node = options[:node]
    etcds[node].render
  else
    etcds.render
  end
  ""
end

#kubeletObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/porkadot/cmd/render.rb', line 21

def kubelet
  logger.info "Generating kubelet related files"
  kubelets = Porkadot::Assets::KubeletList.new(self.config)
  if node = options[:node]
    kubelets[node].render
  else
    kubelets.render
  end
  ""
end

#kubernetesObject



56
57
58
59
60
61
# File 'lib/porkadot/cmd/render.rb', line 56

def kubernetes
  logger.info "Generating kubernetes manifests"
  k8s = Porkadot::Assets::Kubernetes.new(self.config)
  k8s.render
  ""
end