Class: Kuby::Kubernetes::Deployer

Inherits:
Object
  • Object
show all
Defined in:
lib/kuby/kubernetes/deployer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition) ⇒ Deployer

Returns a new instance of Deployer.



11
12
13
# File 'lib/kuby/kubernetes/deployer.rb', line 11

def initialize(definition)
  @definition = definition
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



9
10
11
# File 'lib/kuby/kubernetes/deployer.rb', line 9

def definition
  @definition
end

Instance Method Details

#deployObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/kuby/kubernetes/deployer.rb', line 15

def deploy
  namespaced, global = all_resources.partition do |resource|
    # Unfortunately we can't use respond_to here because all KubeDSL
    # objects use ObjectMeta, which has a namespace field. Not sure
    # why, since it makes no sense for a namespace to have a namespace.
    # Instead we just check for nil here.
    resource..namespace
  end

  deploy_global_resources(global)
  deploy_namespaced_resources(namespaced)
end