Class: Porkadot::Configs::Kubernetes::Scheduler

Inherits:
Object
  • Object
show all
Includes:
Porkadot::ConfigUtils, Component
Defined in:
lib/porkadot/configs/kubernetes.rb

Constant Summary

Constants included from Component

Component::RECOMMENDED_LABEL_PREFIX

Instance Method Summary collapse

Methods included from Component

#args, #instance_labels, #labels, #log_level

Methods included from Porkadot::ConfigUtils

#asset_path, #config, #logger, #method_missing, #raw, #respond_to_missing?, #secrets_path

Constructor Details

#initialize(config) ⇒ Scheduler

Returns a new instance of Scheduler.



142
143
144
145
# File 'lib/porkadot/configs/kubernetes.rb', line 142

def initialize config
  @config = config
  @raw = config.raw.kubernetes.scheduler
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Porkadot::ConfigUtils

Instance Method Details

#bootstrap_argsObject



151
152
153
154
155
156
157
# File 'lib/porkadot/configs/kubernetes.rb', line 151

def bootstrap_args
  return %W(
    --kubeconfig=/etc/kubernetes/bootstrap/kubeconfig-bootstrap.yaml
    --authentication-kubeconfig=/etc/kubernetes/bootstrap/kubeconfig-bootstrap.yaml
    --authorization-kubeconfig=/etc/kubernetes/bootstrap/kubeconfig-bootstrap.yaml
  ).map {|i| i.split('=', 2)}.to_h
end

#component_nameObject



147
148
149
# File 'lib/porkadot/configs/kubernetes.rb', line 147

def component_name
  'kube-scheduler'
end

#default_argsObject



159
160
161
162
163
164
# File 'lib/porkadot/configs/kubernetes.rb', line 159

def default_args
  return %W(
    --leader-elect=true
    --v=#{self.log_level}
  ).map {|i| i.split('=', 2)}.to_h
end