Module: KubeQueue::Worker::DSL

Included in:
ClassMethods
Defined in:
lib/kube_queue/worker/dsl.rb

Instance Method Summary collapse

Instance Method Details

#active_deadline_seconds(seconds) ⇒ Object



32
33
34
# File 'lib/kube_queue/worker/dsl.rb', line 32

def active_deadline_seconds(seconds)
  job_spec.active_deadline_seconds = seconds.to_s
end

#backoff_limit(limit) ⇒ Object



36
37
38
# File 'lib/kube_queue/worker/dsl.rb', line 36

def backoff_limit(limit)
  job_spec.backoff_limit = limit
end

#command(*command) ⇒ Object



24
25
26
# File 'lib/kube_queue/worker/dsl.rb', line 24

def command(*command)
  job_spec.command = command
end

#concurrent_policy(policy) ⇒ Object



76
77
78
# File 'lib/kube_queue/worker/dsl.rb', line 76

def concurrent_policy(policy)
  job_spec.concurrent_policy = policy
end

#container_name(container_name) ⇒ Object



12
13
14
# File 'lib/kube_queue/worker/dsl.rb', line 12

def container_name(container_name)
  job_spec.container_name = container_name
end

#cpu_limit(limit) ⇒ Object



56
57
58
# File 'lib/kube_queue/worker/dsl.rb', line 56

def cpu_limit(limit)
  job_spec.cpu_limit = limit
end

#cpu_request(request) ⇒ Object



64
65
66
# File 'lib/kube_queue/worker/dsl.rb', line 64

def cpu_request(request)
  job_spec.cpu_request = request
end

#env(env) ⇒ Object



40
41
42
# File 'lib/kube_queue/worker/dsl.rb', line 40

def env(env)
  job_spec.env = env
end

#env_from_config_map(*config_map_names) ⇒ Object



48
49
50
# File 'lib/kube_queue/worker/dsl.rb', line 48

def env_from_config_map(*config_map_names)
  job_spec.env_from_config_map = config_map_names
end

#env_from_secret(*secret_names) ⇒ Object



52
53
54
# File 'lib/kube_queue/worker/dsl.rb', line 52

def env_from_secret(*secret_names)
  job_spec.env_from_config_map = secret_names
end

#image(image) ⇒ Object



16
17
18
# File 'lib/kube_queue/worker/dsl.rb', line 16

def image(image)
  job_spec.image = image
end

#job_specObject



4
5
6
# File 'lib/kube_queue/worker/dsl.rb', line 4

def job_spec
  @job_spec ||= JobSpecification.new(self)
end

#labels(labels) ⇒ Object



44
45
46
# File 'lib/kube_queue/worker/dsl.rb', line 44

def labels(labels)
  job_spec.labels = labels
end

#memory_limit(limit) ⇒ Object



60
61
62
# File 'lib/kube_queue/worker/dsl.rb', line 60

def memory_limit(limit)
  job_spec.memory_limit = limit
end

#memory_request(request) ⇒ Object



68
69
70
# File 'lib/kube_queue/worker/dsl.rb', line 68

def memory_request(request)
  job_spec.memory_request = request
end

#namespace(namespace) ⇒ Object



20
21
22
# File 'lib/kube_queue/worker/dsl.rb', line 20

def namespace(namespace)
  job_spec.namespace = namespace
end

#restart_policy(policy) ⇒ Object



28
29
30
# File 'lib/kube_queue/worker/dsl.rb', line 28

def restart_policy(policy)
  job_spec.restart_policy = policy
end

#starting_deadline_seconds(seconds) ⇒ Object



72
73
74
# File 'lib/kube_queue/worker/dsl.rb', line 72

def starting_deadline_seconds(seconds)
  job_spec.starting_deadline_seconds = seconds
end

#worker_name(name) ⇒ Object



8
9
10
# File 'lib/kube_queue/worker/dsl.rb', line 8

def worker_name(name)
  job_spec.worker_name = name
end