Add instance count to service template
This commit is contained in:
parent
85db434c1f
commit
2b91b6dc8f
@ -1,6 +1,7 @@
|
||||
resource "nomad_job" "service" {
|
||||
jobspec = templatefile("${path.module}/service_template.nomad", {
|
||||
name = var.name
|
||||
count = var.instance_count
|
||||
priority = var.priority
|
||||
image = var.image
|
||||
image_pull_timeout = var.image_pull_timeout
|
||||
|
@ -6,6 +6,8 @@ job "${name}" {
|
||||
priority = ${priority}
|
||||
|
||||
group "${name}" {
|
||||
count = ${count}
|
||||
|
||||
network {
|
||||
mode = "bridge"
|
||||
%{ if service_port != null ~}
|
||||
|
@ -3,6 +3,12 @@ variable "name" {
|
||||
description = "Name of the service"
|
||||
}
|
||||
|
||||
variable "instance_count" {
|
||||
type = number
|
||||
default = 1
|
||||
description = "Number of desired group instances"
|
||||
}
|
||||
|
||||
variable "priority" {
|
||||
type = number
|
||||
default = 50
|
||||
|
Loading…
Reference in New Issue
Block a user