From d2279028be5e37868b7d9a59263df2c028a97f12 Mon Sep 17 00:00:00 2001 From: Adrian Cowan Date: Sun, 18 May 2025 21:53:44 +1000 Subject: [PATCH] Remove the hello world services initially added for testing --- 2-nomad-config/2-services.tf | 12 +----- 2-nomad-config/hello-world.nomad.hcl | 61 ---------------------------- 2-nomad-config/webapp.nomad.hcl | 42 ------------------- 3 files changed, 2 insertions(+), 113 deletions(-) delete mode 100644 2-nomad-config/hello-world.nomad.hcl delete mode 100644 2-nomad-config/webapp.nomad.hcl diff --git a/2-nomad-config/2-services.tf b/2-nomad-config/2-services.tf index 813165f..a4e61f0 100644 --- a/2-nomad-config/2-services.tf +++ b/2-nomad-config/2-services.tf @@ -2,13 +2,8 @@ resource "nomad_job" "glance" { jobspec = file("glance.nomad.hcl") } -resource "nomad_job" "hello_world" { - jobspec = file("hello-world.nomad.hcl") -} - - -resource "nomad_job" "webapp" { - jobspec = file("webapp.nomad.hcl") +resource "nomad_job" "transfer" { + jobspec = file("transfer.nomad.hcl") } resource "nomad_csi_volume_registration" "unraid_transfer" { @@ -36,9 +31,6 @@ resource "nomad_csi_volume_registration" "unraid_transfer" { } } -resource "nomad_job" "transfer" { - jobspec = file("transfer.nomad.hcl") -} resource "nomad_csi_volume_registration" "unraid_appdata_transferfilebrowser" { #Note: Before chaning the definition of this volume you need to stop the jobs that are using it diff --git a/2-nomad-config/hello-world.nomad.hcl b/2-nomad-config/hello-world.nomad.hcl deleted file mode 100644 index 8dd1c21..0000000 --- a/2-nomad-config/hello-world.nomad.hcl +++ /dev/null @@ -1,61 +0,0 @@ -job "hello-world" { - group "servers" { - network { - port "www" { - to = -1 - } - } - - service { - name = "hello-world" - port = "www" - - tags = [ - "traefik.enable=true", - "traefik.http.routers.hello-world.middlewares=auth@file", - ] - - check { - name = "alive" - type = "tcp" - port = "www" - interval = "10s" - timeout = "2s" - } - } - - - # Tasks are individual units of work that are run by Nomad. - task "web" { - # This particular task starts a simple web server within a Docker container - driver = "docker" - - config { - image = "busybox:1" - command = "httpd" - args = ["-v", "-f", "-p", "${NOMAD_PORT_www}", "-h", "/local"] - ports = ["www"] - } - - template { - data = <<-EOF -

Hello, Nomad!

- - EOF - destination = "local/index.html" - } - - # Specify the maximum resources required to run the task - resources { - cpu = 50 - memory = 64 - } - } - } -} diff --git a/2-nomad-config/webapp.nomad.hcl b/2-nomad-config/webapp.nomad.hcl deleted file mode 100644 index d4723f6..0000000 --- a/2-nomad-config/webapp.nomad.hcl +++ /dev/null @@ -1,42 +0,0 @@ -job "demo-webapp" { - group "demo" { - count = 3 - - network { - port "http" { - to = -1 - } - } - - service { - name = "demo-webapp" - port = "http" - - tags = [ - "traefik.enable=true", - "traefik.http.routers.demo-webapp.middlewares=auth@file", - ] - - check { - type = "http" - path = "/" - interval = "2s" - timeout = "2s" - } - } - - task "server" { - env { - PORT = NOMAD_PORT_http - NODE_IP = NOMAD_IP_http - } - - driver = "docker" - - config { - image = "hashicorp/demo-webapp-lb-guide" - ports = ["http"] - } - } - } -}