Class: Porkadot::Configs::Kubernetes::Proxy
- Inherits:
-
Object
- Object
- Porkadot::Configs::Kubernetes::Proxy
- 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
- #bootstrap_args ⇒ Object
- #component_name ⇒ Object
- #default_args ⇒ Object
-
#initialize(config) ⇒ Proxy
constructor
A new instance of Proxy.
- #proxy_config(kubeconfig = nil) ⇒ Object
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) ⇒ Proxy
Returns a new instance of Proxy.
207 208 209 210 |
# File 'lib/porkadot/configs/kubernetes.rb', line 207 def initialize config @config = config @raw = config.raw.kubernetes.proxy end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Porkadot::ConfigUtils
Instance Method Details
#bootstrap_args ⇒ Object
224 225 226 227 228 |
# File 'lib/porkadot/configs/kubernetes.rb', line 224 def bootstrap_args return %W( --config=/etc/kubernetes/bootstrap/kube-proxy-bootstrap.yaml ).map {|i| i.split('=', 2)}.to_h end |
#component_name ⇒ Object
220 221 222 |
# File 'lib/porkadot/configs/kubernetes.rb', line 220 def component_name 'kube-proxy' end |
#default_args ⇒ Object
230 231 232 233 234 235 |
# File 'lib/porkadot/configs/kubernetes.rb', line 230 def default_args return %W( --config=/var/lib/kube-proxy/config.conf --hostname-override=$(NODE_NAME) ).map {|i| i.split('=', 2)}.to_h end |
#proxy_config(kubeconfig = nil) ⇒ Object
212 213 214 215 216 217 218 |
# File 'lib/porkadot/configs/kubernetes.rb', line 212 def proxy_config kubeconfig=nil self.raw.config['clusterCIDR'] = config.k8s.networking.pod_subnet if kubeconfig self.raw.config['clientConnection']['kubeconfig'] = kubeconfig end self.raw.config.to_hash.to_yaml end |