Class: Porkadot::Assets::KubeletDefault
- Inherits:
-
Object
- Object
- Porkadot::Assets::KubeletDefault
- Includes:
- Porkadot::Assets
- Defined in:
- lib/porkadot/assets/kubelet.rb
Constant Summary collapse
- TEMPLATE_DIR =
File.join(File.dirname(__FILE__), "kubelet-default")
Instance Attribute Summary collapse
-
#certs ⇒ Object
readonly
Returns the value of attribute certs.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#global_config ⇒ Object
readonly
Returns the value of attribute global_config.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(config) ⇒ KubeletDefault
constructor
A new instance of KubeletDefault.
- #render ⇒ Object
- #render_ca_crt ⇒ Object
Methods included from Porkadot::Assets
#render_erb, #render_secrets_erb
Constructor Details
#initialize(config) ⇒ KubeletDefault
Returns a new instance of KubeletDefault.
44 45 46 47 48 49 |
# File 'lib/porkadot/assets/kubelet.rb', line 44 def initialize config @config = config @logger = config.logger @global_config = config.config @certs = Porkadot::Assets::Certs::Kubernetes.new(global_config) end |
Instance Attribute Details
#certs ⇒ Object (readonly)
Returns the value of attribute certs.
42 43 44 |
# File 'lib/porkadot/assets/kubelet.rb', line 42 def certs @certs end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
40 41 42 |
# File 'lib/porkadot/assets/kubelet.rb', line 40 def config @config end |
#global_config ⇒ Object (readonly)
Returns the value of attribute global_config.
39 40 41 |
# File 'lib/porkadot/assets/kubelet.rb', line 39 def global_config @global_config end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
41 42 43 |
# File 'lib/porkadot/assets/kubelet.rb', line 41 def logger @logger end |
Instance Method Details
#render ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/porkadot/assets/kubelet.rb', line 51 def render logger.info "--> Rendering Kubelet default configs" unless File.directory?(config.addon_path) FileUtils.mkdir_p(config.addon_path) end unless File.directory?(config.addon_secrets_path) FileUtils.mkdir_p(config.addon_secrets_path) end render_ca_crt render_erb 'setup-node.sh' render_erb 'setup-containerd.sh' render_erb 'install.sh' render_erb 'install-deps.sh' render_erb 'install-pkgs.sh' end |
#render_ca_crt ⇒ Object
68 69 70 71 72 73 |
# File 'lib/porkadot/assets/kubelet.rb', line 68 def render_ca_crt logger.info "----> ca.crt" open(config.ca_crt_path, 'w') do |out| out.write self.certs.ca_cert(false).to_pem end end |