Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add key connect.gateway in nomad_job.jobspec #155

Closed
cageyv opened this issue Oct 9, 2020 · 1 comment
Closed

Feature request: Add key connect.gateway in nomad_job.jobspec #155

cageyv opened this issue Oct 9, 2020 · 1 comment

Comments

@cageyv
Copy link

cageyv commented Oct 9, 2020

Terraform Version

0.13.4

Nomad Version

0.12.5

Affected Resource(s)

  • nomad_job

Terraform Configuration Files

  • ingress.hcl
job "ingress" {
  datacenters = ["dc1"]
  group "ingress" {
    network {
      port "inbound" {
        static = 8080
      }
    }
    service {
      name = "ingress-service"
      port = "8080"
      connect {
        gateway {
          proxy {
            connect_timeout = "500ms"
          }
          ingress {
            tls {
              enabled = false
            }
            listener {
              port     = 8080
              protocol = "http"
              service {
                name  = "web"
                hosts = ["example.com", "example.com:8080"]
              }
            }
            listener {
              port     = 3306
              protocol = "tcp"
              service {
                name  = "database"
              }
            }
          }
        }
      }
    }
  }
}
  • main.tf
provider "nomad" {
  address = "http://127.0.0.1:4646"
}

data "template_file" "ingress" {
  template = file("${path.module}/ingress.hcl")
}

resource "nomad_job" "ingress" {
  jobspec          = data.template_file.ingress.rendered
}

Expected Behavior

https://www.nomadproject.io/docs/job-specification/gateway#gateway-stanza

Actual Behavior

Error: error parsing jobspec: error parsing 'job': 1 error occurred:
        * group: 'ingress', service (0): 'ingress-service', connect -> invalid key: gateway

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

https://www.consul.io/docs/connect/gateways
parse_service.go#L146

UDP:
If we try to write a configuration in json format, we will get an error about the absence of a gateway because parse_service.go don't parse gateway.
Right now is no way for deploy gateways with provider. I think json + direct API call will be useful now.

@lgfa29
Copy link
Contributor

lgfa29 commented Oct 28, 2020

Closed by #158

@lgfa29 lgfa29 closed this as completed Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants