Class: Kuby::GKE::Provider
- Inherits:
-
Kubernetes::Provider
- Object
- Kubernetes::Provider
- Kuby::GKE::Provider
- Defined in:
- lib/kuby/gke/provider.rb
Constant Summary collapse
- STORAGE_CLASS_NAME =
'default'.freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #deploy ⇒ Object
- #kubeconfig_path ⇒ Object
- #kubernetes_cli ⇒ Object
- #storage_class_name ⇒ Object
Instance Attribute Details
#config ⇒ Object (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 |
#deploy ⇒ Object
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_path ⇒ Object
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_cli ⇒ Object
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_name ⇒ Object
25 26 27 |
# File 'lib/kuby/gke/provider.rb', line 25 def storage_class_name STORAGE_CLASS_NAME end |