Class: KubesGoogle::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/kubes_google/config.rb

Constant Summary collapse

@@config =
nil

Instance Method Summary collapse

Instance Method Details

#configObject



21
22
23
# File 'lib/kubes_google/config.rb', line 21

def config
  @@config ||= defaults
end

#configure {|config| ... } ⇒ Object

Yields:



25
26
27
# File 'lib/kubes_google/config.rb', line 25

def configure
  yield(config)
end

#defaultsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kubes_google/config.rb', line 5

def defaults
  c = ActiveSupport::OrderedOptions.new
  c.gke = ActiveSupport::OrderedOptions.new
  c.gke.cluster_name = nil
  c.gke.enable_get_credentials = nil
  c.gke.enable_hooks = nil # nil since need cluster_name also. setting to false will explicitly disable hooks
  c.gke.google_project = nil
  c.gke.google_region = nil
  c.gke.whitelist_ip = nil # default will auto-detect IP
  c.secrets = ActiveSupport::OrderedOptions.new
  c.secrets.fetcher = "sdk"
  c.secrets.base64 = true
  c
end