Class: Kuby::GKE::Provider

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

Constant Summary collapse

STORAGE_CLASS_NAME =
'default'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/kuby/gke/provider.rb', line 12

def config
  @config
end

Instance Method Details

#configure(&block) ⇒ Object



14
15
16
# File 'lib/kuby/gke/provider.rb', line 14

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

#deployObject



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

def deploy
  with_env({ 'GOOGLE_APPLICATION_CREDENTIALS' => config.keyfile }) do
    super
  end
end

#kubeconfig_pathObject



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

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

#kubernetes_cliObject



29
30
31
32
33
34
35
36
37
# File 'lib/kuby/gke/provider.rb', line 29

def kubernetes_cli
  @kubernetes_cli ||= begin
    refresh_kubeconfig

    super.tap do |cli|
      cli.env['GOOGLE_APPLICATION_CREDENTIALS'] = config.keyfile
    end
  end
end

#storage_class_nameObject



25
26
27
# File 'lib/kuby/gke/provider.rb', line 25

def storage_class_name
  STORAGE_CLASS_NAME
end