Class: Kuby::Kubernetes::Provider

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

Direct Known Subclasses

BareMetalProvider, DockerDesktopProvider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ Provider

Returns a new instance of Provider.



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

def initialize(environment)
  @environment = environment
  after_initialize
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



8
9
10
# File 'lib/kuby/kubernetes/provider.rb', line 8

def environment
  @environment
end

Instance Method Details

#after_configurationObject

called after all providers and plugins have been configured



24
25
26
# File 'lib/kuby/kubernetes/provider.rb', line 24

def after_configuration
  # do nothing by default
end

#after_deploy(manifest) ⇒ Object

called after the deploy has completed



44
45
46
# File 'lib/kuby/kubernetes/provider.rb', line 44

def after_deploy(manifest)
  # do nothing by default
end

#after_setupObject

called after all providers and plugins have been setup



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

def after_setup
  # do nothing by default
end

#before_deploy(manifest) ⇒ Object

called before the deploy is initiated



39
40
41
# File 'lib/kuby/kubernetes/provider.rb', line 39

def before_deploy(manifest)
  # do nothing by default
end

#before_setupObject

called before any providers or plugins have been setup



29
30
31
# File 'lib/kuby/kubernetes/provider.rb', line 29

def before_setup
  # do nothing by default
end

#configure(&block) ⇒ Object



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

def configure(&block)
  # do nothing by default
end

#deployObject



48
49
50
# File 'lib/kuby/kubernetes/provider.rb', line 48

def deploy
  deployer.deploy
end

#deployerObject



68
69
70
# File 'lib/kuby/kubernetes/provider.rb', line 68

def deployer
  @deployer ||= Kuby::Kubernetes::Deployer.new(environment)
end

#helm_cliObject



60
61
62
# File 'lib/kuby/kubernetes/provider.rb', line 60

def helm_cli
  @helm_cli ||= ::HelmCLI.new(kubeconfig_path)
end

#kubeconfig_pathObject

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/kuby/kubernetes/provider.rb', line 64

def kubeconfig_path
  raise NotImplementedError, "please define #{__method__} in #{self.class.name}"
end

#kubernetes_cliObject



56
57
58
# File 'lib/kuby/kubernetes/provider.rb', line 56

def kubernetes_cli
  @kubernetes_cli ||= ::KubernetesCLI.new(kubeconfig_path)
end

#rollbackObject



52
53
54
# File 'lib/kuby/kubernetes/provider.rb', line 52

def rollback
  deployer.rollback
end

#setupObject



19
20
21
# File 'lib/kuby/kubernetes/provider.rb', line 19

def setup
  # do nothing by default
end