Class: OodCore::Job::Adapters::Kubernetes::Resources::TCPProbe

Inherits:
Object
  • Object
show all
Defined in:
lib/ood_core/job/adapters/kubernetes/resources.rb

Overview

Utility class for kuberenetes probe settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port, data) ⇒ TCPProbe

Returns a new instance of TCPProbe.



41
42
43
44
45
46
47
# File 'lib/ood_core/job/adapters/kubernetes/resources.rb', line 41

def initialize(port, data)
  data ||= {}
  @port = port
  @initial_delay_seconds = data[:initial_delay_seconds] || 2
  @failure_threshold = data[:failure_threshold] || 5
  @period_seconds = data[:period_seconds] || 5
end

Instance Attribute Details

#failure_thresholdObject

Returns the value of attribute failure_threshold.



39
40
41
# File 'lib/ood_core/job/adapters/kubernetes/resources.rb', line 39

def failure_threshold
  @failure_threshold
end

#initial_delay_secondsObject

Returns the value of attribute initial_delay_seconds.



39
40
41
# File 'lib/ood_core/job/adapters/kubernetes/resources.rb', line 39

def initial_delay_seconds
  @initial_delay_seconds
end

#period_secondsObject

Returns the value of attribute period_seconds.



39
40
41
# File 'lib/ood_core/job/adapters/kubernetes/resources.rb', line 39

def period_seconds
  @period_seconds
end

#portObject

Returns the value of attribute port.



39
40
41
# File 'lib/ood_core/job/adapters/kubernetes/resources.rb', line 39

def port
  @port
end

Instance Method Details

#to_hObject



49
50
51
52
53
54
55
56
# File 'lib/ood_core/job/adapters/kubernetes/resources.rb', line 49

def to_h
  {
    port: port,
    initial_delay_seconds: initial_delay_seconds,
    failure_threshold: failure_threshold,
    period_seconds: period_seconds,
  }
end