Commit Graph

25038 Commits

Author SHA1 Message Date
Daniel Bennett
22cbb913db csi: rename volume Mounter to Manager (#18434)
to align with its broader purpose,
and the volumeManager implementation
2023-09-08 15:33:46 -05:00
Tim Gross
3ee6c31241 ACLs: allow/deny/default config for Consul/Vault clusters by namespace (#18425)
In Nomad Enterprise when multiple Vault/Consul clusters are configured, cluster admins can control access to clusters for jobs via namespace ACLs, similar to how we've done so for node pools. This changeset updates the ACL configuration structs, but doesn't wire them up.
2023-09-08 11:37:20 -04:00
Tim Gross
b022346575 fingerprint: backoff on Consul fingerprint after initial success (#18426)
In the original design of Consul fingerprinting, we would poll every period so
that we could change the client's fingerprint if Consul became unavailable. As
of 1.4.0 (ref #14673) we no longer update the fingerprint in order to avoid
excessive `Node.Register` RPCs when someone's Consul cluster is flapping.

This allows us to safely backoff Consul fingerprinting on success, just as we
have with Vault.
2023-09-08 08:17:07 -04:00
Tim Gross
a8e68e6479 fingerprint: add support for fingerprinting multiple Consul clusters (#18392)
fingerprint: add support for fingerprinting multiple Consul clusters

Add fingerprinting we'll need to accept multiple Consul clusters in upcoming
Nomad Enterprise features. The fingerprinter will create a map of Consul clients
by cluster name. In Nomad CE, all but the default cluster will be ignored and
there will be no visible behavior change.

Ref: https://github.com/hashicorp/team-nomad/issues/404
2023-09-07 14:05:35 -04:00
Tim Gross
7cdd592809 jobspec: support cluster field for Vault block (#18408)
This field supports the upcoming ENT-only multiple Vault clusters feature. The
job validation and mutation hooks will come in a separate PR.

Ref: https://github.com/hashicorp/team-nomad/issues/404
2023-09-07 10:15:28 -04:00
Tim Gross
c145e8b30f fingerprint: add warning in CE when there are multiple vaults (#18412)
Nomad CE only supports a single (default) Vault cluster, so log a warning if the
user has configured multiple Vaults.
2023-09-07 09:51:48 -04:00
Tim Gross
7863d7bcbb jobspec: support cluster field for Consul and Service blocks (#18409)
This field supports the upcoming ENT-only multiple Consul clusters feature. The
job validation and mutation hooks will come in a separate PR.

Ref: https://github.com/hashicorp/team-nomad/issues/404
2023-09-07 09:48:49 -04:00
James Rasell
0f94bc2482 test: fix name of state service registration test file. (#18406) 2023-09-07 10:30:05 +01:00
James Rasell
4f3a2e1a7d docs: fix broken link to Consul DNS overview page (#18410) 2023-09-07 08:39:49 +01:00
James Rasell
b6f6541f50 test: add test for state custom iterator. (#18407) 2023-09-07 08:35:05 +01:00
Daniel Bennett
c28cd59655 fix panic from zero JobTrackedVersions config (#18393)
that occurred during server fsm restore,
which later produced a negative slice index
when trying to upsertJobVersion.
2023-09-06 11:11:52 -05:00
Dao Thanh Tung
82cbbacf69 Update the order of docker auth method (#18399)
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
2023-09-06 11:24:37 +01:00
James Rasell
652532b8ca docs: improve diagram on jobspec overview for multi group + tasks. (#18394) 2023-09-06 08:54:05 +01:00
Piotr Kazmierczak
2fffb96604 client: new Consul client (#18370)
This PR introduces a new Consul client that returns SI tokens based on requests
that contain JWTs.
2023-09-05 20:55:36 +02:00
dependabot[bot]
a03aa0cebb build(deps-dev): bump word-wrap from 1.2.3 to 1.2.5 in /website (#18107) 2023-09-05 13:37:10 +01:00
Dao Thanh Tung
6ba600cbf1 Add unit test for api/deployments.go (#18380) 2023-09-05 07:44:54 +01:00
James Rasell
290a310544 fsm: tidy up wording and func signature in fsm ce file. (#18383) 2023-09-04 11:31:55 +01:00
Luiz Aoqui
b614ef3b01 client: fix panic on alloc restore (#18356)
When restoring an allocation `WIDMgr` was not being set in the alloc
runner config, resulting in a nil panic when the task runner attempted
to start.

Since we will often require the same configuration values when creating
or restoring a new allocation, this commit moves the logic to a shared
function to ensure that `addAlloc` and `restoreState` configure alloc
runners with the same values.
2023-09-01 11:42:00 -03:00
James Rasell
776a26bce7 raft: remove use of deprecated Leader func. (#18352)
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2023-09-01 10:01:34 +01:00
Luiz Aoqui
7466496608 config: fix identity config for Consul service (#18363)
Rename the agent configuraion for workload identity to
`WorkloadIdentityConfig` to make its use more explicit and remove the
`ServiceName` field since it is never expected to be defined in a
configuration file.

Also update the job mutation to inject a service identity following
these rules:

1. Don't inject identity if `consul.use_identity` is false.
2. Don't inject identity if `consul.service_identity` is not specified.
3. Don't inject identity if service provider is not `consul`.
4. Set name and service name if the service specifies an identity.
5. Inject `consul.service_identity` if service does not specify an
   identity.
2023-08-31 11:22:48 -03:00
Seth Hoenig
05c3322214 Revert "client: include response body in output for successful HTTP checks (#18345)" (#18362)
* Revert "client: include response body in output for successful HTTP checks (#18345)"

This reverts commit d0a93f12d1.

* cr: add comment about dropping ok output

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>

---------

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2023-08-30 08:22:28 -05:00
Matthew Salsamendi
d0a93f12d1 client: include response body in output for successful HTTP checks (#18345) 2023-08-28 19:15:06 -04:00
Gerard Nguyen
f187afab9f jobspec: add diff for Task Group Scaling block (#18332) 2023-08-28 18:37:00 -04:00
stswidwinski
f25480c9e9 Ensure that the index processed by the client is at least as new as the last one processed. (#18269)
Ensure that the index processed by the client is at least as new as the last index processed so that stale data does not impact the running allocations.
2023-08-25 15:54:58 -07:00
Luiz Aoqui
da830b1046 nds: add validation for tls_skip_verify (#18333) 2023-08-25 11:55:10 -04:00
James Rasell
96cc610b3c ci: migrate semgrep action from deprecated wrapper (#18324) 2023-08-25 15:24:23 +01:00
James Rasell
a9d5beb141 test: use correct parallel test setup func (#18326) 2023-08-25 13:51:36 +01:00
Piotr Kazmierczak
af2a08cc13 job_endpoint hooks: fix identity block mutator behavior (#18320)
If there's an identity block present in the config, do not overwrite it
completely. Only set the Name and ServiceName fields, and keep the rest.
2023-08-25 11:09:03 +02:00
James Rasell
f7a336d2ba test: use must package for state store restore test file. (#18316) 2023-08-25 09:10:34 +01:00
Luiz Aoqui
c16f268d22 jobspec: add diff for alternate workload identities (#18319) 2023-08-24 18:16:29 -04:00
Piotr Kazmierczak
1c7b34543c job_endpoint: jobIdentityCreator hook (#18317)
This PR introduces a job-mutating hook that inserts an Identity block for
services that use the consul provider.
2023-08-24 19:36:51 +02:00
Piotr Kazmierczak
b430d21a67 agent: add consul.service_identity and consul.template_identity blocks (#18279)
This PR introduces updates to the agent config required for workload identity support.
2023-08-24 17:45:34 +02:00
James Rasell
c43dcb4bf8 ci: ensure semgrep tests all state store funcs for FSM time rule. (#18315) 2023-08-24 15:08:53 +01:00
Seth Hoenig
f5b0da1d55 all: swap exp packages for maps, slices (#18311) 2023-08-23 15:42:13 -05:00
Luiz Aoqui
e69e3c6677 docs: expand on where node_class may be used (#18288) 2023-08-23 15:59:43 -04:00
Kevin Wang
462427455d (website): node 16 (#18302) 2023-08-23 11:41:17 -04:00
Luiz Aoqui
6c43080b55 docs: remove datacenter from job examples (#18289) 2023-08-23 11:37:40 -04:00
Iwan Aucamp
f122d291d2 docs: fix a sentence in vault-integration.mdx (#18296) 2023-08-23 11:24:23 +01:00
Андрей Неустроев
3e61b3a37d Add multiple times in periodic jobs (#17858) 2023-08-22 15:42:31 -04:00
Luiz Aoqui
7548eecbaa docs: clarify reference to network.mode in docker network_mode config (#18277) 2023-08-22 15:07:22 -04:00
Lance Haig
0b9cf4e7b7 Deprecate the Original Bootstrap Token Code (#17792) 2023-08-22 08:06:15 +01:00
Luiz Aoqui
14a38bee7b client: 404 when accessing files for GC'ed alloc (#18232)
When an allocation is garbage collected from the client, but not from
the servers, the API request is routed to the client and the client
does attempt to read the file, but the alloc dir has already been
deleted, resulting in a 500 error.

This happens because the client GC only destroys the alloc runner
(deleting the alloc dir), but it keeps a reference to the alloc runner
until the alloc is garbage collected from the servers as well.

This commit adjusts this logic by checking if the alloc runner (and the
alloc files) has been destroyed, returning a 404 if so.
2023-08-21 16:09:24 -04:00
Piotr Kazmierczak
9fa39eb829 jobspec: add nomad_service field and identity block (#18239)
This PR introduces updates to the jobspec required for workload identity support for services.
---------

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2023-08-21 20:07:47 +02:00
Luiz Aoqui
6b374f6487 changelog: add v1.3.16 (#18259) 2023-08-21 12:29:54 -04:00
János Szathmáry
1e9ccc3ed8 feat: improve policy documentation for "query_window" property (#17929) 2023-08-18 17:43:23 -04:00
Tim Gross
b51b2a2705 fingerprint: add support for fingerprinting multiple Vault clusters (#18253)
Add fingerprinting we'll need to accept multiple Vault clusters in upcoming
Nomad Enterprise features. The fingerprinter will create a map of Vault clients
by cluster name. In Nomad CE, all but the default cluster will be ignored and
there will be no visible behavior change.
2023-08-18 15:33:22 -04:00
Luiz Aoqui
196213c451 jobspec: add role to vault (#18257) 2023-08-18 15:29:02 -04:00
Tim Gross
a8bad048b6 config: parsing support for multiple Consul clusters in agent config (#18255)
Add the plumbing we need to accept multiple Consul clusters in Nomad agent
configuration, to support upcoming Nomad Enterprise features. The `consul` blocks
are differentiated by a new `name` field, and if the `name` is omitted it
becomes the "default" Consul configuration. All blocks with the same name are
merged together, as with the existing behavior.

As with the `vault` block, we're still using HCL1 for parsing configuration and
the `Decode` method doesn't parse multiple blocks differentiated only by a field
name without a label. So we've had to add an extra parsing pass, similar to what
we've done for HCL1 jobspecs. This also revealed a subtle bug in the `vault`
block handling of extra keys when there are multiple `vault` blocks, which I've
fixed here.

For now, all existing consumers will use the "default" Consul configuration, so
there's no user-facing behavior change in this changeset other than the contents
of the agent self API.

Ref: https://github.com/hashicorp/team-nomad/issues/404
2023-08-18 15:25:16 -04:00
Phil Renaud
30a9b6eda7 ui: Use ]] and [[ to paginate index pages (#18210)
* bracket keynav enabled

* Use the right testcluster

* Modifier made to be conditional

* Lintfix

* Custom ignore rule

* changelog
2023-08-18 09:18:15 -04:00
James Rasell
6108f5c4c3 admin: rename _oss files to _ce (#18209) 2023-08-18 07:47:24 +01:00