Add ability to set priority for service templates
This commit is contained in:
parent
2a1a7fb6b7
commit
cdbd6a9cb3
@ -1,6 +1,7 @@
|
||||
resource "nomad_job" "service" {
|
||||
jobspec = templatefile("${path.module}/service_template.nomad", {
|
||||
name = var.name
|
||||
priority = var.priority
|
||||
image = var.image
|
||||
image_pull_timeout = var.image_pull_timeout
|
||||
args = var.args
|
||||
|
@ -3,6 +3,7 @@ job "${name}" {
|
||||
datacenters = ["dc1"]
|
||||
|
||||
type = "service"
|
||||
priority = ${priority}
|
||||
|
||||
group "${name}" {
|
||||
network {
|
||||
|
@ -3,6 +3,13 @@ variable "name" {
|
||||
description = "Name of the service"
|
||||
}
|
||||
|
||||
variable "priority" {
|
||||
type = number
|
||||
default = 50
|
||||
description = "Scheduler priority of the service"
|
||||
}
|
||||
|
||||
|
||||
variable "image" {
|
||||
type = string
|
||||
description = "Image that should be run"
|
||||
|
Loading…
Reference in New Issue
Block a user