Class: Porkadot::Configs::Kubernetes
- Inherits:
-
Object
- Object
- Porkadot::Configs::Kubernetes
- Includes:
- Porkadot::ConfigUtils
- Defined in:
- lib/porkadot/configs/kubernetes.rb
Defined Under Namespace
Modules: Component Classes: Apiserver, ControllerManager, Networking, Proxy, Scheduler
Instance Attribute Summary collapse
-
#apiserver ⇒ Object
readonly
Returns the value of attribute apiserver.
-
#controller_manager ⇒ Object
readonly
Returns the value of attribute controller_manager.
-
#networking ⇒ Object
readonly
Returns the value of attribute networking.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#scheduler ⇒ Object
readonly
Returns the value of attribute scheduler.
Instance Method Summary collapse
- #cluster_name ⇒ Object
- #control_plane_endpoint_host_and_port ⇒ Object
-
#initialize(config) ⇒ Kubernetes
constructor
A new instance of Kubernetes.
- #manifests_path ⇒ Object
- #target_path ⇒ Object
- #target_secrets_path ⇒ Object
Methods included from Porkadot::ConfigUtils
#asset_path, #config, #logger, #method_missing, #raw, #respond_to_missing?, #secrets_path
Constructor Details
#initialize(config) ⇒ Kubernetes
Returns a new instance of Kubernetes.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/porkadot/configs/kubernetes.rb', line 10 def initialize config @config = config @raw = config.raw.kubernetes @networking = Networking.new(config) @proxy = Proxy.new(config) @apiserver = Apiserver.new(config) @controller_manager = ControllerManager.new(config) @scheduler = Scheduler.new(config) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Porkadot::ConfigUtils
Instance Attribute Details
#apiserver ⇒ Object (readonly)
Returns the value of attribute apiserver.
6 7 8 |
# File 'lib/porkadot/configs/kubernetes.rb', line 6 def apiserver @apiserver end |
#controller_manager ⇒ Object (readonly)
Returns the value of attribute controller_manager.
7 8 9 |
# File 'lib/porkadot/configs/kubernetes.rb', line 7 def controller_manager @controller_manager end |
#networking ⇒ Object (readonly)
Returns the value of attribute networking.
4 5 6 |
# File 'lib/porkadot/configs/kubernetes.rb', line 4 def networking @networking end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
5 6 7 |
# File 'lib/porkadot/configs/kubernetes.rb', line 5 def proxy @proxy end |
#scheduler ⇒ Object (readonly)
Returns the value of attribute scheduler.
8 9 10 |
# File 'lib/porkadot/configs/kubernetes.rb', line 8 def scheduler @scheduler end |
Instance Method Details
#cluster_name ⇒ Object
21 22 23 |
# File 'lib/porkadot/configs/kubernetes.rb', line 21 def cluster_name self.raw.cluster_name || 'porkadot' end |
#control_plane_endpoint_host_and_port ⇒ Object
37 38 39 40 41 42 |
# File 'lib/porkadot/configs/kubernetes.rb', line 37 def control_plane_endpoint_host_and_port endpoint = self.config.k8s.control_plane_endpoint raise "kubernetes.control_plane_endpoint should not be nil" unless endpoint index = endpoint.rindex(':') return [endpoint[0, index], endpoint[index+1, 6]] end |
#manifests_path ⇒ Object
33 34 35 |
# File 'lib/porkadot/configs/kubernetes.rb', line 33 def manifests_path File.join(self.target_path, 'manifests') end |
#target_path ⇒ Object
25 26 27 |
# File 'lib/porkadot/configs/kubernetes.rb', line 25 def target_path File.join(self.config.assets_dir, 'kubernetes') end |
#target_secrets_path ⇒ Object
29 30 31 |
# File 'lib/porkadot/configs/kubernetes.rb', line 29 def target_secrets_path File.join(self.config.secrets_root_dir, 'kubernetes') end |