Class: Porkadot::Configs::Kubernetes::ControllerManager

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

Constant Summary

Constants included from Component

Porkadot::Configs::Kubernetes::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) ⇒ ControllerManager

Returns a new instance of ControllerManager.



171
172
173
174
# File 'lib/porkadot/configs/kubernetes.rb', line 171

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

Dynamic Method Handling

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

Instance Method Details

#bootstrap_argsObject



180
181
182
183
184
# File 'lib/porkadot/configs/kubernetes.rb', line 180

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

#component_nameObject



176
177
178
# File 'lib/porkadot/configs/kubernetes.rb', line 176

def component_name
  'kube-controller-manager'
end

#default_argsObject



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/porkadot/configs/kubernetes.rb', line 186

def default_args
  return %W(
    --allocate-node-cidrs=true
    --cluster-cidr=#{config.k8s.networking.pod_subnet}
    --cluster-signing-cert-file=/etc/kubernetes/pki/kubernetes/ca.crt
    --cluster-signing-key-file=/etc/kubernetes/pki/kubernetes/ca.key
    --controllers=*,bootstrapsigner,tokencleaner
    --leader-elect=true
    --root-ca-file=/etc/kubernetes/pki/kubernetes/ca.crt
    --service-account-private-key-file=/etc/kubernetes/pki/kubernetes/sa.key
    --service-cluster-ip-range=#{config.k8s.networking.service_subnet}
    --use-service-account-credentials=true
    --v=#{self.log_level}
  ).map {|i| i.split('=', 2)}.to_h
end