github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/e2e/consul/input/namespaces/connect_ingress.nomad (about)

     1  job "connect_ingress" {
     2    datacenters = ["dc1"]
     3    type        = "service"
     4  
     5    constraint {
     6      attribute = "${attr.kernel.name}"
     7      value     = "linux"
     8    }
     9  
    10    group "ingress-group" {
    11  
    12      consul {
    13        namespace = "apple"
    14      }
    15  
    16      network {
    17        mode = "bridge"
    18        port "inbound" {
    19          static = 8080
    20          to     = 8080
    21        }
    22      }
    23  
    24      service {
    25        name = "my-ingress-service"
    26        port = "8080"
    27  
    28        connect {
    29          gateway {
    30            ingress {
    31              listener {
    32                port     = 8080
    33                protocol = "tcp"
    34                service {
    35                  name = "uuid-api"
    36                }
    37              }
    38            }
    39          }
    40        }
    41      }
    42    }
    43  
    44    group "ingress-group-z" {
    45  
    46      # consul namespace not set
    47  
    48      network {
    49        mode = "bridge"
    50        port "inbound" {
    51          static = 8081
    52          to     = 8080
    53        }
    54      }
    55  
    56      service {
    57        name = "my-ingress-service-z"
    58        port = "8081"
    59  
    60        connect {
    61          gateway {
    62            ingress {
    63              listener {
    64                port     = 8080
    65                protocol = "tcp"
    66                service {
    67                  name = "uuid-api-z"
    68                }
    69              }
    70            }
    71          }
    72        }
    73      }
    74    }
    75  
    76    group "generator" {
    77  
    78      consul {
    79        namespace = "apple"
    80      }
    81  
    82      network {
    83        mode = "host"
    84        port "api" {}
    85      }
    86  
    87      service {
    88        name = "uuid-api"
    89        port = "${NOMAD_PORT_api}"
    90  
    91        connect {
    92          native = true
    93        }
    94      }
    95  
    96      task "generate" {
    97        driver = "docker"
    98  
    99        config {
   100          image        = "hashicorpdev/uuid-api:v3"
   101          network_mode = "host"
   102        }
   103  
   104        env {
   105          BIND = "0.0.0.0"
   106          PORT = "${NOMAD_PORT_api}"
   107        }
   108      }
   109    }
   110  
   111    group "generator-z" {
   112  
   113      # consul namespace not set
   114  
   115      network {
   116        mode = "host"
   117        port "api" {}
   118      }
   119  
   120      service {
   121        name = "uuid-api-z"
   122        port = "${NOMAD_PORT_api}"
   123  
   124        connect {
   125          native = true
   126        }
   127      }
   128  
   129      task "generate-z" {
   130        driver = "docker"
   131  
   132        config {
   133          image        = "hashicorpdev/uuid-api:v3"
   134          network_mode = "host"
   135        }
   136  
   137        env {
   138          BIND = "0.0.0.0"
   139          PORT = "${NOMAD_PORT_api}"
   140        }
   141      }
   142    }
   143  }