Class: Kuby::EKS::Provider

Inherits:
Kubernetes::Provider
  • Object
show all
Defined in:
lib/kuby/eks/provider.rb

Constant Summary collapse

STORAGE_CLASS_NAME =
'gp2'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



13
14
15
# File 'lib/kuby/eks/provider.rb', line 13

def config
  @config
end

Instance Method Details

#before_deployObject



34
35
36
# File 'lib/kuby/eks/provider.rb', line 34

def before_deploy(*)
  refresh_kubeconfig
end

#before_setupObject



30
31
32
# File 'lib/kuby/eks/provider.rb', line 30

def before_setup
  refresh_kubeconfig
end

#configure(&block) ⇒ Object



15
16
17
# File 'lib/kuby/eks/provider.rb', line 15

def configure(&block)
  config.instance_eval(&block)
end

#kubeconfig_pathObject



19
20
21
22
23
24
# File 'lib/kuby/eks/provider.rb', line 19

def kubeconfig_path
  File.join(
    kubeconfig_dir,
    "#{environment.app_name.downcase}-#{config.hash_value}-kubeconfig.yaml"
  )
end

#kubernetes_cliObject



38
39
40
41
42
43
44
# File 'lib/kuby/eks/provider.rb', line 38

def kubernetes_cli
  @kubernetes_cli ||= ::KubernetesCLI.new(kubeconfig_path).tap do |cli|
    cli.before_execute do
      refresh_kubeconfig
    end
  end
end

#storage_class_nameObject



26
27
28
# File 'lib/kuby/eks/provider.rb', line 26

def storage_class_name
  STORAGE_CLASS_NAME
end