@@ -116,9 +116,10 @@ agents.
116
116
117
117
- ` token ` ` (string: "") ` - Specifies the token used to provide a per-request ACL
118
118
token. This option overrides the Consul Agent's default token. If the token is
119
- not set here or on the Consul agent, it will default to Consul's anonymous policy,
120
- which may or may not allow writes. Will default to the ` CONSUL_HTTP_TOKEN `
121
- environment variable if set.
119
+ not set here or on the Consul agent, it defaults to Consul's anonymous policy,
120
+ which may or may not allow writes. Defaults to the ` CONSUL_HTTP_TOKEN `
121
+ environment variable if set. Nomad cannot refresh this token; if the token is
122
+ deleted, Nomad is not able to communicate with Consul.
122
123
123
124
- ` verify_ssl ` ` (bool: true) ` - Specifies if SSL peer verification should be used
124
125
when communicating to the Consul API client over HTTPS. Will default to the
@@ -334,6 +335,58 @@ consul {
334
335
}
335
336
```
336
337
338
+ ### Consul ACL policy for Nomad
339
+
340
+ Nomad agents need access to Consul in order to register themselves in the
341
+ service catalog and discover other Nomad agents via service discovery for
342
+ automatic clustering. Nomad clients use Consul tokens from Workload Identity to
343
+ register services and checks but need permissions on their own token to
344
+ deregister. Nomad servers also create [ configuration
345
+ entries] [ consul_config_entry ] for Consul Service Mesh, so the specific
346
+ permissions vary slightly between Nomad servers and clients. The following
347
+ Consul ACL policies represent the minimal permissions Nomad servers and clients
348
+ need.
349
+
350
+ <Tabs >
351
+ <Tab heading = " Nomad Servers" >
352
+
353
+ ``` hcl
354
+ agent_prefix "" {
355
+ policy = "read"
356
+ }
357
+
358
+ node_prefix "" {
359
+ policy = "write"
360
+ }
361
+
362
+ service_prefix "" {
363
+ policy = "write"
364
+ }
365
+
366
+ acl = "write"
367
+ mesh = "write"
368
+ ```
369
+
370
+ </Tab >
371
+ <Tab heading = " Nomad Clients" >
372
+
373
+ ``` hcl
374
+ agent_prefix "" {
375
+ policy = "read"
376
+ }
377
+
378
+ node_prefix "" {
379
+ policy = "write"
380
+ }
381
+
382
+ service_prefix "" {
383
+ policy = "write"
384
+ }
385
+ ```
386
+
387
+ </Tab >
388
+ </Tabs >
389
+
337
390
### Consul Namespace <EnterpriseAlert inline />
338
391
339
392
Consul does not allow ACL policies associated with namespaces to use agent
@@ -383,3 +436,4 @@ namespace "nomad-ns" {
383
436
[ taskuser ] : /nomad/docs/job-specification/task#user " Nomad task Block "
384
437
[ consul_bound_aud ] : /consul/docs/security/acl/auth-methods/jwt#boundaudiences
385
438
[ `consul.namespace` ] : /nomad/docs/job-specification/consul#namespace
439
+ [ consul_config_entry ] : /consul/docs/connect/config-entries
0 commit comments