Skip to content

Commit 9ce2642

Browse files
hc-github-team-nomad-coretempaimeeu
authored
Manual Backport of Docs: Clarify service.port allowed value types into release/1.9.x (#26347)
* no-op commit due to failed cherry-picking * add table to service.port entry (#26344) * fix cherry-pick --------- Co-authored-by: temp <[email protected]> Co-authored-by: Aimee Ukasick <[email protected]>
1 parent a5814d7 commit 9ce2642

File tree

2 files changed

+34
-29
lines changed

2 files changed

+34
-29
lines changed

website/content/docs/job-specification/connect.mdx

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ job "countdash" {
4949
Used to configure a connect service. Only one of `native`, `sidecar_service`,
5050
or `gateway` may be realized per `connect` block.
5151

52-
- `native` - `(bool: false)` - This is used to configure the service as supporting
53-
[Connect Native](/consul/docs/connect/native) applications.
52+
- `native` - `(bool: false)` - This is used to configure the service as
53+
supporting [Consul service mesh native][consul-service-mesh-native]
54+
applications.
5455

5556
- `sidecar_service` - <code>([sidecar_service][]: nil)</code> - This is used to
5657
configure the sidecar service created by Nomad for Consul Connect.
@@ -66,8 +67,11 @@ or `gateway` may be realized per `connect` block.
6667
### Using Connect Native
6768

6869
The following example is a minimal service block for a
69-
[Consul Connect Native](/consul/docs/connect/native)
70-
application implemented by a task named `generate`.
70+
[Consul service mesh native][consul-service-mesh-native]
71+
application implemented by a task named `generate`. Make sure to include the
72+
[service `name`](/nomad/docs/job-specification/service#name) and [service
73+
`port`](/nomad/docs/job-specification/service##port) fields so that Consul
74+
advertizes the service with your desired values.
7175

7276
```hcl
7377
service {
@@ -240,23 +244,13 @@ job "ingress-demo" {
240244
### Limitations
241245

242246
[gateway]: /nomad/docs/job-specification/gateway
243-
244247
[gh-7221]: https://github.com/hashicorp/nomad/issues/7221
245-
246-
[group]: /nomad/docs/job-specification/group "Nomad group Job Specification"
247-
248-
[interpolation]: /nomad/docs/runtime/interpolation "Nomad interpolation"
249-
250-
[job]: /nomad/docs/job-specification/job "Nomad job Job Specification"
251-
252-
[native]: /consul/docs/connect/native
253-
254-
[service_task]: /nomad/docs/job-specification/service#task-1 "Nomad service task"
255-
256-
[sidecar_service]: /nomad/docs/job-specification/sidecar_service "Nomad sidecar service Specification"
257-
258-
[sidecar_task]: /nomad/docs/job-specification/sidecar_task "Nomad sidecar task config Specification"
259-
260-
[task]: /nomad/docs/job-specification/task "Nomad task Job Specification"
261-
262-
[upstreams]: /nomad/docs/job-specification/upstreams "Nomad sidecar service upstreams Specification"
248+
[group]: /nomad/docs/job-specification/group
249+
[interpolation]: /nomad/docs/reference/runtime-variable-interpolation
250+
[job]: /nomad/docs/job-specification/job
251+
[service_task]: /nomad/docs/job-specification/service#task-1
252+
[sidecar_service]: /nomad/docs/job-specification/sidecar_service
253+
[sidecar_task]: /nomad/docs/job-specification/sidecar_task
254+
[task]: /nomad/docs/job-specification/task
255+
[upstreams]: /nomad/docs/job-specification/upstreams
256+
[consul-service-mesh-native]: /consul/docs/automate/native

website/content/docs/job-specification/service.mdx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ description: |-
1616
/>
1717

1818
The `service` block instructs Nomad to register a service with the specified
19-
provider; Nomad or Consul. This section of the documentation will discuss the
20-
configuration, but please also read the
19+
provider: Nomad or Consul. This section of the documentation discusses the
20+
configuration, but you should also read the
2121
[Nomad service discovery documentation][service-discovery] for more detailed
2222
information about the external integrations.
2323

@@ -71,13 +71,13 @@ job "docs" {
7171
}
7272
```
7373

74-
This section of the documentation only cover the job file fields and blocks
75-
for service discovery. For more details on using Nomad with Consul please see
74+
This section of the documentation only covers the job file fields and blocks
75+
for service discovery. For more details on using Nomad with Consul, refer to
7676
the [Consul integration documentation][service-discovery].
7777

7878
The `service` block can also be at task group level.
7979
This enables services in the same task group to opt into [Consul
80-
Service Mesh][connect] integration.
80+
service mesh][connect] integration.
8181

8282
## `service` Parameters
8383

@@ -152,6 +152,15 @@ Service Mesh][connect] integration.
152152
- `host` - Advertise the host port for this service. `port` must match a port
153153
_label_ specified in the [`network`][network] block.
154154

155+
| Service kind | Allowed port value type |
156+
| -------- | ------- |
157+
| Normal | Numeric or port mapping label |
158+
| Uses [`connect` native][connect-native] | Numeric or port mapping label |
159+
| Uses [`connect` sidecar][connect-sidecar] | Numeric |
160+
| Ingress gateway | Port mapping label (optional) |
161+
| Terminating gateway | None (optional) |
162+
| Mesh gateway | External port mapping label |
163+
155164
- `tags` `(array<string>: [])` - Specifies the list of tags to associate with
156165
this service. If this is not supplied, no tags will be assigned to the service
157166
when it is registered.
@@ -202,7 +211,7 @@ Service Mesh][connect] integration.
202211

203212
- `task` `(string: "")` - Specifies the name of the Nomad task associated with
204213
this service definition. Only available on group services. Must be set if this
205-
service definition represents a Consul Connect-native service and there is more
214+
service definition represents a Consul service mesh native service and there is more
206215
than one task in the task group.
207216

208217
- `meta` <code>([Meta][]: nil)</code> - Specifies a key-value map that annotates
@@ -549,3 +558,5 @@ advertise and check directly since Nomad isn't managing any port assignments.
549558
[`consul.service_identity`]: /nomad/docs/configuration/consul#service_identity
550559
[identity_block]: /nomad/docs/job-specification/identity
551560
[weights]: /consul/docs/services/configuration/services-configuration-reference#weights
561+
[connect-sidecar]: /nomad/docs/job-specification/connect#using-sidecar-service
562+
[connect-native]: /nomad/docs/job-specification/connect#using-consul-service-mesh-native

0 commit comments

Comments
 (0)